Repository navigation
Do not name the result of CASE r, the row of UPDATE and DELETE, to close #3197 - #3198
Open
zzoraemon043 wants to merge 1 commit into
Open
zzoraemon043 wants to merge 1 commit into
zzoraemon043 wants to merge 1 commit into
Conversation
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.
Closes #3197
CaseValue.toJSwraps CASE in an arrow function whose parameter is the row variable and then declareslet y, r;for the result. UPDATE, DELETE and CHECK compile with the row namedr, so the generated function fails withIdentifier 'r' has already been declared. SELECT usespand was not affected.The result is now
caseResult, which none of the row variables (a,b,g,p,r,x) can be.Same error before the fix, now working:
UPDATE s SET b = CASE WHEN a = 1 THEN 5 ELSE 1 ENDUPDATE s SET b = 1 WHERE CASE WHEN a = 1 THEN 5 ELSE 1 END = 5DELETE FROM s WHERE CASE a WHEN 2 THEN 1 ELSE 0 END = 1CREATE TABLE c (a INT, b INT, CHECK (CASE WHEN a > 0 THEN b > 0 ELSE TRUE END))test/test3197.jscovers SET, nested CASE, WHERE of UPDATE and DELETE, and a CHECK constraint. All 6 fail before the change and pass after it. The full suite has no new failures (test107-B and test2149 fail the same way on main on Windows).