UNION ALL keeps every branch's row in branch order. */
| 5504 | |
| 5505 | /* UNION ALL keeps every branch's row in branch order. */ |
| 5506 | static int union_many_check(void *arg) { |
| 5507 | (void)arg; |
| 5508 | char *query = union_query(CYPHER_UNION_MANY_BRANCHES, " UNION ALL "); |
| 5509 | ASSERT_NOT_NULL(query); |
| 5510 | |
| 5511 | cbm_store_t *s = setup_cypher_store(); |
| 5512 | cbm_cypher_result_t r = {0}; |
| 5513 | /* This exercises stack depth and every result, independently of how |
| 5514 | * slowly instrumentation runs. Dedicated deadline tests retain expiry. */ |
| 5515 | cbm_cypher_test_set_deadline_clock(cypher_frozen_deadline_clock); |
| 5516 | /* Request exactly the output this fixture needs: the default 100k ceiling |
| 5517 | * also reserves 100k binding slots separately for every UNION branch. */ |
| 5518 | int rc = cbm_cypher_execute(s, query, "test", CYPHER_UNION_MANY_BRANCHES, &r); |
| 5519 | cbm_cypher_test_set_deadline_clock(NULL); |
| 5520 | free(query); |
| 5521 | if (rc != 0) { |
| 5522 | printf(" query error: %s\n", r.error ? r.error : "(none)"); |
| 5523 | } |
| 5524 | ASSERT_EQ(rc, 0); |
| 5525 | ASSERT_EQ(r.row_count, CYPHER_UNION_MANY_BRANCHES); |
| 5526 | ASSERT_TRUE(!r.truncated); |
| 5527 | for (int i = 0; i < r.row_count; i++) { |
| 5528 | ASSERT_STR_EQ(r.rows[i][0], cypher_fixture_nodes[i % CYPHER_FIXTURE_NODE_COUNT]); |
| 5529 | } |
| 5530 | cbm_cypher_result_free(&r); |
| 5531 | cbm_store_close(s); |
| 5532 | return 0; |
| 5533 | } |
| 5534 | |
| 5535 | /* 20,000 UNION ALL branches parse, run and free on the worker stack, and |
| 5536 | * every branch contributes its row. */ |
nothing calls this directly
no test coverage detected