validate the parameters of a statement expression are not EXPLAIN or PROFILE
| 2219 | |
| 2220 | // validate the parameters of a statement expression are not EXPLAIN or PROFILE |
| 2221 | static AST_Validation _ValidateParamsOnly |
| 2222 | ( |
| 2223 | const cypher_astnode_t *statement // statement |
| 2224 | ) { |
| 2225 | uint noptions = cypher_ast_statement_noptions(statement); |
| 2226 | for(uint i = 0; i < noptions; i++) { |
| 2227 | const cypher_astnode_t *option = cypher_ast_statement_get_option(statement, i); |
| 2228 | const cypher_astnode_type_t type = cypher_astnode_type(option); |
| 2229 | if((type == CYPHER_AST_EXPLAIN_OPTION) || (type == CYPHER_AST_PROFILE_OPTION)) { |
| 2230 | const char *invalid_option_name = cypher_astnode_typestr(type); |
| 2231 | ErrorCtx_SetError("Please use GRAPH.%s 'key' 'query' command instead of GRAPH.QUERY 'key' '%s query'", |
| 2232 | invalid_option_name, invalid_option_name); |
| 2233 | return AST_INVALID; |
| 2234 | } |
| 2235 | } |
| 2236 | return AST_VALID; |
| 2237 | } |
| 2238 | |
| 2239 | // Make sure no duplicated parameters are given in a statement expression |
| 2240 | static AST_Validation _ValidateDuplicateParameters |
no test coverage detected