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

Adding columns to primary key now adds not null constraint #2435

Merged
merged 18 commits into from
Dec 2, 2021

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Nov 24, 2021

Also added a test case to ensure adding not null constraint to primary key column does nothing.

Copy link
Member

@zachmu zachmu left a 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

Copy link
Member

@zachmu zachmu left a 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.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM

@jycor jycor merged commit 1c4cc60 into main Dec 2, 2021
@Hydrocharged Hydrocharged deleted the james/fix-2324-pk-missing-not-null-constraint branch December 8, 2021 07:14
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