returns true if the given ast-node will result in an eager operation
| 188 | |
| 189 | // returns true if the given ast-node will result in an eager operation |
| 190 | static bool _clause_is_eager |
| 191 | ( |
| 192 | const cypher_astnode_t *clause |
| 193 | ) { |
| 194 | // ------------------------------------------------------------------------- |
| 195 | // check if clause type is one of: CREATE, DELETE, MERGE, SET or REMOVE |
| 196 | // ------------------------------------------------------------------------- |
| 197 | cypher_astnode_type_t type = cypher_astnode_type(clause); |
| 198 | if(type == CYPHER_AST_CREATE || |
| 199 | type == CYPHER_AST_DELETE || |
| 200 | type == CYPHER_AST_MERGE || |
| 201 | type == CYPHER_AST_SET || |
| 202 | type == CYPHER_AST_REMOVE || |
| 203 | type == CYPHER_AST_FOREACH) { |
| 204 | return true; |
| 205 | } |
| 206 | |
| 207 | if(type == CYPHER_AST_CALL_SUBQUERY) { |
| 208 | return AST_IsEager(cypher_ast_call_subquery_get_query(clause)); |
| 209 | } |
| 210 | |
| 211 | // ------------------------------------------------------------------------- |
| 212 | // check if clause is a WITH or RETURN clause with an aggregation |
| 213 | // ------------------------------------------------------------------------- |
| 214 | if(type == CYPHER_AST_RETURN || type == CYPHER_AST_WITH) { |
| 215 | return AST_ClauseContainsAggregation(clause); |
| 216 | } |
| 217 | |
| 218 | return false; |
| 219 | } |
| 220 | |
| 221 | // checks if a query contains an ast-node corresponding to an eager operation |
| 222 | bool AST_IsEager |
no test coverage detected