Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSQL: Allow for multiple variables DECLAREd in the same statement #1651

Merged
merged 3 commits into from Oct 14, 2021

Conversation

jpers36
Copy link
Contributor

@jpers36 jpers36 commented Oct 14, 2021

The DECLARE segment was not properly parsing multiple variable declarations. This change moves AnyNumber to the correct location with the correct content. Added example to an existing test case.

@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #1651 (3ff6f3c) into main (a118069) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #1651   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          133       133           
  Lines         9250      9250           
=========================================
  Hits          9250      9250           
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_tsql.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a118069...3ff6f3c. Read the comment docs.

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

In theory, this should be possible with Delimited(...) but tried it and it won't work. I suspect because of #1366

So OK to go with this alternative for now.

@jpers36
Copy link
Contributor Author

jpers36 commented Oct 14, 2021

@tunetheweb since we can't separate the statement segments in TSQL using a delimiter, any effort to use Delimited() ends up grabbing all elements up through the next delimiter if it exists in a following statement. So the last element gets misparsed to include part of the following segment or more.

@tunetheweb tunetheweb merged commit e94158a into sqlfluff:main Oct 14, 2021
CyberShadow pushed a commit to CyberShadow/sqlfluff that referenced this pull request Oct 14, 2021
…lfluff#1651)

Co-authored-by: jpersons <jpersons@iuhealth.org>
Co-authored-by: Barry Pollard <barry@tunetheweb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants