Skip to content

MsSql: Keep the comma separator when displaying DECLARE lists - #2671

Open
LucaCappelletti94 wants to merge 1 commit into
mainfrom
mssql-declare-comma-separator
Open

LucaCappelletti94 wants to merge 1 commit into
mainfrom
mssql-declare-comma-separator

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

In MsSql one DECLARE keyword takes a comma-separated list of declarations, DECLARE @a INT, @b INT (https://learn.microsoft.com/en-us/sql/t-sql/language-elements/declare-local-variable-transact-sql). The parser collected the list into one Statement::Declare, but the display joined it with ; , so the statement was printed back as DECLARE @a INT; @b INT, which T-SQL reads as a different statement.

Statement::Declare gains a separator: DeclareSeparator field. The MsSql parser records Comma, and the Snowflake, BigQuery and cursor forms record Semicolon, matching Snowflake Scripting's DECLARE section where each declaration ends with ; (https://docs.snowflake.com/en/sql-reference/snowflake-scripting/declare).

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.26%. Comparing base (1aabd12) to head (b634c00).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2671      +/-   ##
==========================================
+ Coverage   81.25%   81.26%   +0.01%     
==========================================
  Files          42       42              
  Lines       33910    33920      +10     
  Branches    33910    33920      +10     
==========================================
+ Hits        27553    27566      +13     
+ Misses       2792     2790       -2     
+ Partials     3565     3564       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change bug Something isn't working SQL Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants