Skip to content

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Mar 11, 2025

Apparently the last_insert_id in ok result, is not the same as select last_insert_id().
When there is an auto_increment column, the insert_id in the OKResult is the first value that increments the auto_increment value.

Reverts some changes from: #2616
fixes: dolthub/dolt#8914

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.

The changes are simple, the rules for what's happening don't seem very simple. A paragraph somewhere describing what should be happening for people to refer to in the future would be helpful.

@jycor jycor merged commit 909b08b into main Mar 11, 2025
7 of 8 checks passed
@jycor jycor deleted the james/insert_id branch March 11, 2025 21:26
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.

MySQL is not consistent regarding last_insert_id; go-mysql-server ceased to emulate this inconsistency in v0.19.0
2 participants