| 399 | //------------------------------------------------------------------------------ |
| 400 | |
| 401 | rax *AST_PrepareUpdateOp |
| 402 | ( |
| 403 | GraphContext *gc, |
| 404 | const cypher_astnode_t *clause |
| 405 | ) { |
| 406 | cypher_astnode_type_t type = cypher_astnode_type(clause); |
| 407 | ASSERT(type == CYPHER_AST_SET || type == CYPHER_AST_REMOVE); |
| 408 | |
| 409 | rax *updates = raxNew(); // entity alias -> EntityUpdateEvalCtx |
| 410 | if(type == CYPHER_AST_SET) { |
| 411 | uint nitems = cypher_ast_set_nitems(clause); |
| 412 | for(uint i = 0; i < nitems; i++) { |
| 413 | const cypher_astnode_t *set_item = |
| 414 | cypher_ast_set_get_item(clause, i); |
| 415 | _ConvertUpdateItem(gc, updates, set_item); |
| 416 | } |
| 417 | } else { |
| 418 | uint nitems = cypher_ast_remove_nitems(clause); |
| 419 | for(uint i = 0; i < nitems; i++) { |
| 420 | const cypher_astnode_t *remove_item = |
| 421 | cypher_ast_remove_get_item(clause, i); |
| 422 | _ConvertUpdateItem(gc, updates, remove_item); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | return updates; |
| 427 | } |
| 428 | |
| 429 | //------------------------------------------------------------------------------ |
| 430 | // CREATE operation |
no test coverage detected