mirror of https://gitee.com/bigwinds/arangodb
fixed uninitialised value
This commit is contained in:
parent
c2ff93e99d
commit
68d2775b39
|
@ -786,6 +786,7 @@ static TRI_aql_node_t* OptimiseLimit (TRI_aql_statement_walker_t* const walker,
|
|||
TRI_aql_node_t* node) {
|
||||
TRI_aql_scope_t* scope;
|
||||
TRI_aql_node_t* limit;
|
||||
aql_optimiser_t* optimiser = (aql_optimiser_t*) walker->_data;
|
||||
int64_t limitValue;
|
||||
|
||||
assert(node);
|
||||
|
@ -794,7 +795,27 @@ static TRI_aql_node_t* OptimiseLimit (TRI_aql_statement_walker_t* const walker,
|
|||
assert(scope);
|
||||
|
||||
limit = TRI_AQL_NODE_MEMBER(node, 1);
|
||||
limitValue = TRI_AQL_NODE_INT(limit);
|
||||
|
||||
if (limit->_type != TRI_AQL_NODE_VALUE) {
|
||||
return node;
|
||||
}
|
||||
|
||||
if (limit->_value._type == TRI_AQL_TYPE_INT) {
|
||||
limitValue = TRI_AQL_NODE_INT(limit);
|
||||
}
|
||||
else if (limit->_value._type == TRI_AQL_TYPE_DOUBLE) {
|
||||
limitValue = (int64_t) TRI_AQL_NODE_DOUBLE(limit);
|
||||
}
|
||||
else if (limit->_value._type == TRI_AQL_TYPE_NULL) {
|
||||
limitValue = 0;
|
||||
}
|
||||
else if (limit->_value._type == TRI_AQL_TYPE_BOOL) {
|
||||
limitValue = (int64_t) TRI_AQL_NODE_BOOL(limit);
|
||||
}
|
||||
else {
|
||||
TRI_SetErrorContextAql(optimiser->_context, TRI_ERROR_QUERY_NUMBER_OUT_OF_RANGE, NULL);
|
||||
return node;
|
||||
}
|
||||
|
||||
// check for the easy case, a limit value of 0, e.g. LIMIT 10, 0
|
||||
if (limitValue == 0) {
|
||||
|
|
Loading…
Reference in New Issue