-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove auto-increment primary key when saving as copy #16966
Conversation
I've manually tested this on postgres and mysql against auto-increment IDs, manually entered IDs and Generated UUIDs. Would love to have some unit tests for this too but have not been able to manage that so far. #15033 is still occurring on mysql. |
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've manually tested this on postgres and mysql against auto-increment IDs, manually entered IDs and Generated UUIDs.
Nice catch to cover uuid special flag as well! 👍
Would love to have some unit tests for this too but have not been able to manage that so far.
Added an attempt for it in a follow up commit. Do feel free to vet the tests as it feels like the structure can still be improved, but it should help catch these scenarios for now. 🤞
Description
When saving as copy the code was looking for the
is_generated
flag in schema which can be false for primary keys. I've updated this check to look for thehas_auto_increment
flag instead which should always be true for auto-increment IDs.Fixes #15771
Fixes ENG-179
Type of Change
Requirements Checklist
If adding a new feature: