From 11c1b60b59a46f4a3d8ab5b5a27b95fce4c56c92 Mon Sep 17 00:00:00 2001 From: CPWstatic <13495049+CPWstatic@users.noreply.github.com> Date: Fri, 8 Oct 2021 14:22:10 +0800 Subject: [PATCH] Fix space not right when submit job after use. --- src/graph/validator/AdminJobValidator.cpp | 2 +- tests/tck/job/Job.feature | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/graph/validator/AdminJobValidator.cpp b/src/graph/validator/AdminJobValidator.cpp index c2d9cfd7793..bb1d8f7e4a6 100644 --- a/src/graph/validator/AdminJobValidator.cpp +++ b/src/graph/validator/AdminJobValidator.cpp @@ -15,7 +15,7 @@ Status AdminJobValidator::validateImpl() { if (sentence_->getOp() == meta::cpp2::AdminJobOp::ADD) { auto cmd = sentence_->getCmd(); if (requireSpace()) { - const auto &spaceInfo = qctx()->rctx()->session()->space(); + const auto &spaceInfo = vctx_->whichSpace(); auto spaceId = spaceInfo.id; const auto &spaceName = spaceInfo.name; sentence_->addPara(spaceName); diff --git a/tests/tck/job/Job.feature b/tests/tck/job/Job.feature index bace1f4a71a..dd97302e875 100644 --- a/tests/tck/job/Job.feature +++ b/tests/tck/job/Job.feature @@ -180,9 +180,18 @@ Feature: Submit job space requirements """ Then an ExecutionError should be raised at runtime:Job not in chosen space! -# This is skipped becuase it is hard to simulate the situation -# When executing query: -# """ -# RECOVER JOB; -# """ -# Then the result should be successful + # This is skipped becuase it is hard to simulate the situation + # When executing query: + # """ + # RECOVER JOB; + # """ + # Then the result should be successful + Scenario: rebuild index after use, fix #2806 + When executing query: + """ + USE nba; + REBUILD TAG INDEX; + """ + Then the result should be, in any order: + | New Job Id | + | /\d+/ |