Repository navigation
MsSql: End a RETURN without a value at the next statement keyword - #2993
Draft
colinhacks wants to merge 5 commits into
Draft
colinhacks wants to merge 5 commits into
colinhacks wants to merge 5 commits 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.
Dialects: MsSql
A
RETURNwith no value read the keyword after it as a column name.IF @f = 1 BEGIN RETURN ENDfailed withExpected: END, found: EOF, and withrequire_semicolon_stmt_delimiter = false,IF @f = 1 RETURNfollowed bySELECT id FROM ton the next line failed withExpected: an SQL statement, found: id.MsSql now parses
RETURNitself and gives it no value when the next token is a keyword that cannot be an implicit alias, such asSELECT,SET,IForEND, following the check suggested in #1949 (comment). Values such as@x,@@ERROR,SYSTEM_USER,(SELECT 1), function calls andCASEread as before, and other dialects keep the genericRETURN.This builds on #2991, which adds
SET,BEGINand the other statement keywords to the list the check reads, and its commits come first here until it merges.Refs #1800
Written with an AI coding assistant.