-
-
Notifications
You must be signed in to change notification settings - Fork 873
TSQL: fix for hex default constraint #6586
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: fix for hex default constraint #6586
Conversation
Coverage Results ✅
|
Delimited(Ref("ColumnReferenceSegment")), | ||
Ref("ColumnReferenceSegment"), | ||
Sequence( | ||
Ref("CommaSegment"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't make sense to me, this is just the unpacking of the Delimited functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split it because I needed a way to show that the "Comma + more columns" section was optional, but that the initial single column reference is required during a DROP COLUMN statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delimited() has this behaviour by default, it includes lists of length 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I understand now. I was basing it off of this not working in 3.3.0, but that release was on Dec 10th, and now I see that a PR was merged into main on Dec 11th that fixed this specific section. But I hadn't noticed that and didnt see this Issue tagged to that PR so I thought this was still an open problem. I will remove this part of my PR leaving only the hex default constraint change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflicts on a couple of files now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Brief summary of the change made
fixes #5831
Two main things in #5831 were throwing unparsable errors. There was a binary column with a default value supplied in hexadecimal notation going in as a DEFAULT CONSTRAINT, and there was an ALTER TABLE DROP COLUMN statement that listed multiple columns.
UPDATE: The DROP COLUMN for multiple columns was fixed in #6501 (which I hadn't noticed with my first commit). I'm adding some additional test coverage to account for that scenario.
Are there any other side effects of this change that we should be aware of?
None
Pull Request checklist
Please confirm you have completed any of the necessary steps below.
Included test cases to demonstrate any code changes, which may be one or more of the following:
.yml
rule test cases intest/fixtures/rules/std_rule_cases
..sql
/.yml
parser test cases intest/fixtures/dialects
(note YML files can be auto generated withtox -e generate-fixture-yml
).test/fixtures/linter/autofix
.Added appropriate documentation for the change.
Created GitHub issues for any relevant followup/future enhancements if appropriate.