1
0
Fork 0

Feature 3.4/relax aql limit grammar (#6361)

This commit is contained in:
Jan 2018-09-04 14:50:01 +02:00 committed by GitHub
parent 9a6cf18f8b
commit a21d6bda62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 582 additions and 568 deletions

View File

@ -1557,6 +1557,12 @@ ExecutionNode* ExecutionPlan::fromNodeLimit(ExecutionNode* previous,
auto offset = node->getMember(0);
auto count = node->getMember(1);
if (offset->type != NODE_TYPE_VALUE || count->type != NODE_TYPE_VALUE) {
THROW_ARANGO_EXCEPTION_MESSAGE(
TRI_ERROR_QUERY_NUMBER_OUT_OF_RANGE,
"LIMIT offset/count values must be constant numeric values");
}
TRI_ASSERT(offset->type == NODE_TYPE_VALUE);
TRI_ASSERT(count->type == NODE_TYPE_VALUE);

File diff suppressed because it is too large Load Diff

View File

@ -903,12 +903,12 @@ sort_direction:
;
limit_statement:
T_LIMIT simple_value {
T_LIMIT expression {
auto offset = parser->ast()->createNodeValueInt(0);
auto node = parser->ast()->createNodeLimit(offset, $2);
parser->ast()->addOperation(node);
}
| T_LIMIT simple_value T_COMMA simple_value {
| T_LIMIT expression T_COMMA expression {
auto node = parser->ast()->createNodeLimit($2, $4);
parser->ast()->addOperation(node);
}