Repository navigation
test(query): make the memory-truncation path reachable (#540) - #630
Merged
Merged
Conversation
`MemoryGuard` compared against a literal 512 and `execute` built the guard itself, so nothing could choose the floor. Provoking the real one means starving the machine of RAM, which no test should do — and the block that turns a tripped guard into a partial result was the only path through the executor no test reached (#540). Everything around it was covered: `truncation_for` picks the reason, `truncationMessage` renders it, the banner tests assert both variants, and integration tests confirm the row-limit reason survives a round trip. The block joining them up was not. The floor is now a field on QueryExecutor, defaulting to the same 512. A test setting it above the machine's free memory trips the guard on its first check and gets to assert what the user would see: a partial result that admits it is partial, carrying MemoryGuard rather than RowLimit — telling someone to lower a row limit that was never binding sends them somewhere that cannot help (#413) — and still a result set, with its columns. The third test covers both caps applying at once: the row limit is the one that stopped the read first, and the one the user can act on. Co-Authored-By: Claude Opus 5 <[email protected]>
EVWorth
force-pushed
the
test/memory-guard-floor
branch
from
September 11, 2026 05:25
a959bb7 to
d4a4999
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #629.
MemoryGuardcompared against a literal512andexecutebuilt the guard itself, so nothing could choose the floor. Provoking the real one means starving the machine of RAM, which no test should do — and the block that turns a tripped guard into a partial result was the only path through the executor no test reached.Everything around it was covered:
truncation_forpicks the reason,truncationMessagerenders it, the banner tests assert both variants, and integration tests confirm the row-limit reason survives a round trip. The block joining them up was not.The floor is now a field on
QueryExecutor, defaulting to the same 512. A test setting it above the machine's free memory trips the guard on its first check and gets to assert what the user would actually see:MemoryGuard, notRowLimit— telling someone to lower a row limit that was never binding sends them somewhere that cannot help ([P1] [bug] Truncation banner blames LIMIT when MemoryGuard triggered — misleading #413),A third test covers both caps applying at once: the row limit stopped the read first, and it is the one the user can act on.
All three pass against live MySQL 8.
Closes #540
🤖 Generated with Claude Code