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

Function _ValidateCreateRelation

src/ast/ast_validations.c:283–298  ·  view source on GitHub ↗

Validate that the relation alias of an edge is not bound

Source from the content-addressed store, hash-verified

281
282// Validate that the relation alias of an edge is not bound
283static AST_Validation _ValidateCreateRelation
284(
285 const cypher_astnode_t *entity, // ast-node
286 rax *defined_aliases // bounded variables
287) {
288 const cypher_astnode_t *identifier = cypher_ast_rel_pattern_get_identifier(entity);
289 if(identifier) {
290 const char *alias = cypher_ast_identifier_get_name(identifier);
291 if(raxFind(defined_aliases, (unsigned char *)alias, strlen(alias)) != raxNotFound) {
292 ErrorCtx_SetError("The bound variable '%s' can't be redeclared in a CREATE clause", alias);
293 return AST_INVALID;
294 }
295 }
296
297 return AST_VALID;
298}
299
300// Validate each entity referenced in a single path of a CREATE clause.
301static AST_Validation _Validate_CREATE_Entities

Callers 1

_Validate_rel_patternFunction · 0.85

Calls 1

ErrorCtx_SetErrorFunction · 0.85

Tested by

no test coverage detected