Skip to content

Commit

Permalink
Fix space not right when submit job after use (#3010)
Browse files Browse the repository at this point in the history
  • Loading branch information
CPWstatic authored Oct 11, 2021
1 parent c7c1bf8 commit 7ff852b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/graph/validator/AdminJobValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
21 changes: 15 additions & 6 deletions tests/tck/job/Job.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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+/ |

0 comments on commit 7ff852b

Please sign in to comment.