Skip to content

Commit

Permalink
fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
heroicNeZha committed Dec 30, 2021
1 parent 938737b commit d58878c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/graph/util/ExpressionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ class ExpressionUtils {

static bool checkExprDepth(const Expression* expr);

private:
static constexpr int32_t kMaxDepth = 512;
};

Expand Down
4 changes: 3 additions & 1 deletion src/parser/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ expression
: expression_internal {
if(!graph::ExpressionUtils::checkExprDepth($1)){
delete $1;
throw nebula::GraphParser::syntax_error(@1, "The above expression's depth exceeds the maximum depth:512!");
std::ostringstream errStr;
errStr << "The above expression's depth exceeds the maximum depth:" << graph::ExpressionUtils::kMaxDepth;
throw nebula::GraphParser::syntax_error(@1, errStr.str());
}
$$ = $1;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/tck/features/expression/Depth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Feature: Check Expression Depth
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS result
"""
Then a SyntaxError should be raised at runtime: The above expression's depth exceeds the maximum depth!
Then a SyntaxError should be raised at runtime: The above expression's depth exceeds the maximum depth
When executing query:
"""
YIELD 1 IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS
Expand Down Expand Up @@ -156,4 +156,4 @@ Feature: Check Expression Depth
NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS
NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL IS NULL AS result
"""
Then a SyntaxError should be raised at runtime: The above expression's depth exceeds the maximum depth!
Then a SyntaxError should be raised at runtime: The above expression's depth exceeds the maximum depth

0 comments on commit d58878c

Please sign in to comment.