validate limit and skip modifiers
| 959 | |
| 960 | // validate limit and skip modifiers |
| 961 | static AST_Validation _Validate_LIMIT_SKIP_Modifiers |
| 962 | ( |
| 963 | const cypher_astnode_t *limit, // limit ast-node |
| 964 | const cypher_astnode_t *skip // skip ast-node |
| 965 | ) { |
| 966 | if(limit) { |
| 967 | // Handle non-integer or non parameter types specified as LIMIT value |
| 968 | // The value validation of integer node or parameter node is done in run time evaluation. |
| 969 | if(cypher_astnode_type(limit) != CYPHER_AST_INTEGER && |
| 970 | cypher_astnode_type(limit) != CYPHER_AST_PARAMETER) { |
| 971 | ErrorCtx_SetError("LIMIT specified value of invalid type, must be a positive integer"); |
| 972 | return AST_INVALID; |
| 973 | } |
| 974 | } |
| 975 | |
| 976 | if(skip) { |
| 977 | // Handle non-integer or non parameter types specified as skip value |
| 978 | // The value validation of integer node or parameter node is done in run time evaluation. |
| 979 | if(cypher_astnode_type(skip) != CYPHER_AST_INTEGER && |
| 980 | cypher_astnode_type(skip) != CYPHER_AST_PARAMETER) { |
| 981 | ErrorCtx_SetError("SKIP specified value of invalid type, must be a positive integer"); |
| 982 | return AST_INVALID; |
| 983 | } |
| 984 | } |
| 985 | |
| 986 | return AST_VALID; |
| 987 | } |
| 988 | |
| 989 | // validate UNION clauses |
| 990 | static AST_Validation _ValidateUnion_Clauses |
no test coverage detected