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

have generated index and foreign key names match mysql #2438

Merged
merged 15 commits into from Apr 9, 2024
Merged

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Apr 5, 2024

changes:

  • auto-generated secondary index names don't match (after a conflict)
    • we started at 0, while mysql starts at 2
  • auto-generate foreign key names in a way that matches mysql
    • in-memory used to just have empty string as the constraint name

we used to error when generating foreign keys over the same sets of columns, but not anymore

related: dolthub/dolt#7650

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks good! Nice work on the test cases and reverse engineering MySQL's behavior. Very thorough work there! 👏

sql/rowexec/ddl_iters.go Outdated Show resolved Hide resolved
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.

Behavior change LGTM but tests are underspecified.

enginetest/queries/foreign_key_queries.go Show resolved Hide resolved
enginetest/queries/foreign_key_queries.go Outdated Show resolved Hide resolved
enginetest/queries/foreign_key_queries.go Outdated Show resolved Hide resolved
sql/plan/alter_foreign_key.go Outdated Show resolved Hide resolved
sql/rowexec/ddl_iters.go Show resolved Hide resolved
@jycor jycor merged commit bfde35b into main Apr 9, 2024
7 checks passed
@jycor jycor deleted the james/fks branch April 9, 2024 22:45
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

3 participants