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

Fixed various bugs in last_insert_id #2060

Merged
merged 9 commits into from
Oct 5, 2023
Merged

Fixed various bugs in last_insert_id #2060

merged 9 commits into from
Oct 5, 2023

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented Oct 5, 2023

Fixes dolthub/dolt#6776

Also adds better test coverage for LAST_INSERT_ID() and the INSERT_ID field in the ok response for updates.

@zachmu zachmu requested a review from max-hoffman October 5, 2023 21:51
Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

Seems like it fixes the customer bug. Should we be worried about onDuplicateUpdateHandler and replaceRowHandler special cases? Some of the mysql examples also get a bit more complicated, with setting expressions and stuff.

sql/rowexec/dml_iters.go Show resolved Hide resolved
@zachmu
Copy link
Member Author

zachmu commented Oct 5, 2023

Seems like it fixes the customer bug. Should we be worried about onDuplicateUpdateHandler and replaceRowHandler special cases? Some of the mysql examples also get a bit more complicated, with setting expressions and stuff.

Those two have the same buggy behavior as before, so the reporting of last_insert_id in the response won't be correct for on duplicate key update and replace into statements.

@zachmu zachmu merged commit 4cc2f2c into main Oct 5, 2023
@Hydrocharged Hydrocharged deleted the zachmu/last-insert-id branch February 7, 2024 13:46
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.

SELECT LAST_INSERT_ID() returns BIGINT SIGNED for BIGINT UNSIGNED ids
2 participants