Skip to content

Commit 1f54617

Browse files
committed
test(cypher): align the explicit-LIMIT case with the engine projection budget
b798350 capped an explicit LIMIT at max_rows so an oversized limit cannot bypass the engine projection budget, and added cypher_return_distinct_counts_ distinct_rows_against_cap_issue1364 to lock that in. cypher_apply_limit still carried the older TestApplyLimitRespectsExplicit reading (LIMIT 30 with max_rows=10 returns 30 rows), so the two contracts collided on release-tooling and the Jenkins shard failed on it. The clamp is deliberate: it ships with its own regression test and matches the engine-budget contract, so update cypher_apply_limit to expect the capped 10 rows and truncated:true instead of reverting the guard.
1 parent f0e1f8e commit 1f54617

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tests/test_cypher.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,12 +3091,14 @@ TEST(cypher_apply_limit) {
30913091
ASSERT_TRUE(r.truncated);
30923092
cbm_cypher_result_free(&r);
30933093

3094-
/* LIMIT above max_rows → explicit limit wins */
3094+
/* LIMIT above max_rows → the engine budget still bounds the projection:
3095+
* an explicit limit larger than max_rows is capped at max_rows, not
3096+
* allowed to bypass it (#1364, oversized-limit guard). */
30953097
memset(&r, 0, sizeof(r));
30963098
rc = cbm_cypher_execute(s, "MATCH (f:Function) RETURN f.name LIMIT 30", "lim", 10, &r);
30973099
ASSERT_EQ(rc, 0);
3098-
ASSERT_EQ(r.row_count, 30);
3099-
ASSERT_FALSE(r.truncated);
3100+
ASSERT_EQ(r.row_count, 10);
3101+
ASSERT_TRUE(r.truncated);
31003102
cbm_cypher_result_free(&r);
31013103

31023104
cbm_store_close(s);

0 commit comments

Comments
 (0)