Skip to content

Fix generator whitespace bugs: ALTER TABLE ADD INDEX and WINDOW name reference#208

Merged
llali merged 2 commits into
microsoft:mainfrom
rwestMSFT:rw-0527-fix-generator-whitespace
Jun 4, 2026
Merged

Fix generator whitespace bugs: ALTER TABLE ADD INDEX and WINDOW name reference#208
llali merged 2 commits into
microsoft:mainfrom
rwestMSFT:rw-0527-fix-generator-whitespace

Conversation

@rwestMSFT
Copy link
Copy Markdown
Contributor

Description

Two unrelated pre-existing generator bugs surfaced by round-tripping the sql-docs corpus:

  1. AlterTableAddTableElementStatement omitted the separator between column-definitions/constraints and table indexes, producing 'NOT NULLINDEX ix_...' which fails to reparse.

  2. WindowDefinition omitted whitespace between the inherited window-name reference (RefWindowName) and a following PARTITION BY or ORDER BY, producing 'win2PARTITION ...' which fails to reparse. Both fixes are local to their visitors and follow the same separator patterns already present in sibling code paths. Adds three focused regression tests under a new 'Generator Whitespace Regression Tests' region.

Code Changes

…reference

Two unrelated pre-existing generator bugs surfaced by round-tripping the
sql-docs corpus:
1. AlterTableAddTableElementStatement omitted the separator between
   column-definitions/constraints and table indexes, producing
   'NOT NULLINDEX ix_...' which fails to reparse.
2. WindowDefinition omitted whitespace between the inherited window-name
   reference (RefWindowName) and a following PARTITION BY or ORDER BY,
   producing 'win2PARTITION ...' which fails to reparse.
Both fixes are local to their visitors and follow the same separator
patterns already present in sibling code paths. Adds three focused
regression tests under a new 'Generator Whitespace Regression Tests'
region.
Comment thread Test/SqlDom/ScriptGeneratorTests.cs Outdated
Comment thread Test/SqlDom/ScriptGeneratorTests.cs Outdated
@rwestMSFT rwestMSFT force-pushed the rw-0527-fix-generator-whitespace branch from 375b2a3 to d4c3a1e Compare June 4, 2026 17:31
@llali llali merged commit 2641cbf into microsoft:main Jun 4, 2026
5 checks passed
@rwestMSFT rwestMSFT deleted the rw-0527-fix-generator-whitespace branch June 4, 2026 18:35
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.

2 participants