合并查询的截断口径对齐查询层:取满上限之后确实还有下一行才算截断,恰好取满的完整结果不再被下游拒收

This commit is contained in:
ThearchyHelios
2026-10-03 10:28:59 +08:00
parent 98ebba384f
commit ab1f42d2ce
2 changed files with 14 additions and 5 deletions
+7
View File
@@ -213,6 +213,13 @@ def test_result_over_the_row_limit_is_truncated_and_warned():
assert "result_truncated" in [w["code"] for w in out.warnings]
def test_exactly_full_result_is_not_truncated():
"""恰好取满上限、后面没有了:和查询层同一个口径,不算截断——截断的合并结果下游会拒收,误报就是把完整的结果拒了。"""
out = execute([sales(), visits()], "SELECT * FROM s CROSS JOIN v", limits=QueryLimits(max_rows=16))
assert out.truncated is False and len(out.rows) == 16
assert "result_truncated" not in [w["code"] for w in out.warnings]
def test_byte_limit_matches_the_query_layer():
out = execute([sales(), visits()], "SELECT * FROM s CROSS JOIN v", limits=QueryLimits(max_bytes=100))
assert out.truncated is True and 0 < len(out.rows) < 16