Repository navigation
fix(deparser): deparse FETCH/MOVE ALL from the WASM AST - #364
Open
pyramation wants to merge 1 commit into
Open
pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. No issues found — approved ✅. This PR fixes
Reviewed commit: 0ead3fc |
Contributor
|
Folded into #371 |
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.
Summary
FETCH_ALLisLONG_MAX. Inlibpg-query's 32-bit WASM buildlongis 32-bit, soFETCH ALL cparses tohowMany: 2147483647rather than 2^63−1.FetchStmtonly checked for the 64-bit value, so it turnedFETCH ALLinto a literal count:The AST round-trip didn't catch this, because the reparsed SQL yields 2147483647 again.
isAllnow accepts either sentinel. That matchesplpgsql-deparser, which already treatshow_many === 2147483647as ALL.Trade-off: a literal
FETCH 2147483647now deparses asFETCH ALL. The WASM AST can't tell the two apart anyway.Tests
pretty/misc.sql(misc-18,misc-19), rannpm run kitchen-sink, and added them to__tests__/pretty/misc-pretty.test.ts. The new snapshots areFETCH FORWARD ALL candMOVE BACKWARD ALL c.deparser.tschange:Tests: 4 failed, 34 passed(Received: "FETCH FORWARD 2147483647 c","MOVE BACKWARD 2147483647 c").packages/deparser,npx jest: 312 suites, 752 tests passing.Link to Devin session: https://app.devin.ai/sessions/91c28df261ac4b318f39d1c7242d008c
Open in Devin Desktop: https://app.devin.ai/desktop/session/91c28df261ac4b318f39d1c7242d008c?variant=devin
Requested by: @pyramation