-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Adding columns to primary key now adds not null constraint #2435
Conversation
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.
You need tests on CreateTable as well, same rules apply
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 looks good, but it needs tests for CREATE TABLE as well. Need to assert that primary key columns get a not null constraint on them (that remains there after the primary key is dropped).
This should fail, but passes in dolt today:
create table mpks (a int null, b int, primary key (a,b));
Try it in mysql and confirm. We should have bats tests for this.
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
Also added a test case to ensure adding not null constraint to primary key column does nothing.