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

Bug Report: last_insert_id with argument broken starting Vitess 16.0.0 #13020

Closed
arthurschreiber opened this issue May 3, 2023 · 1 comment · Fixed by #13026
Closed

Bug Report: last_insert_id with argument broken starting Vitess 16.0.0 #13020

arthurschreiber opened this issue May 3, 2023 · 1 comment · Fixed by #13026

Comments

@arthurschreiber
Copy link
Contributor

Overview of the Issue

After bumping Vitess to v16 in our CI system, we noticed that the behaviour of last_insert_id with an argument has changed between Vitess v15 and Vitess v16.

In Vitess v15, on a sharded keyspace, calling last_insert_id with an argument to explicitly set the session's last_insert_id value "just worked" - the mysql response's last_insert_id would be set to the correct value, and calling last_insert_id in a followup query would return the value that was previously set.

In Vitess v16, doing the same on a sharded keyspace started returning a "Argument to last_insert_id() not supported" error.

The query we run in production looks something like this:

UPDATE `some_table` SET `foo` = LAST_INSERT_ID(`foo` + 1) WHERE id = 12345

Reproduction Steps

N/A

Binary Version

16.0.1

Operating System and Environment details

N/A

Log Fragments

No response

@arthurschreiber arthurschreiber added Type: Bug Needs Triage This issue needs to be correctly labelled and triaged labels May 3, 2023
@arthurschreiber
Copy link
Contributor Author

See #12997 for a potential fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants