MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _ValidateParamsOnly

Function _ValidateParamsOnly

src/ast/ast_validations.c:2221–2237  ·  view source on GitHub ↗

validate the parameters of a statement expression are not EXPLAIN or PROFILE

Source from the content-addressed store, hash-verified

2219
2220// validate the parameters of a statement expression are not EXPLAIN or PROFILE
2221static 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
2240static AST_Validation _ValidateDuplicateParameters

Callers 1

AST_Validate_QueryParamsFunction · 0.85

Calls 1

ErrorCtx_SetErrorFunction · 0.85

Tested by

no test coverage detected