Improved Compatibility Around LAST_INSERT_ID#17369
Closed
systay wants to merge 26 commits intovitessio:mainfrom
Closed
Improved Compatibility Around LAST_INSERT_ID#17369systay wants to merge 26 commits intovitessio:mainfrom
systay wants to merge 26 commits intovitessio:mainfrom
Conversation
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17369 +/- ##
==========================================
- Coverage 67.52% 67.52% -0.01%
==========================================
Files 1581 1581
Lines 253948 254025 +77
==========================================
+ Hits 171480 171519 +39
- Misses 82468 82506 +38 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
0973a29 to
fbc3dbb
Compare
5 tasks
8529995 to
fbc3dbb
Compare
… modified Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
02821a8 to
a1c2707
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves last_insert_id(x) behavior to align more closely with MySQL in various scenarios.
Key changes
fetch_last_insert_idFieldIntroduced a boolean field, fetch_last_insert_id, in the ExecuteOptions proto.
SELECT last_insert_id()query immediately after executing a query containing alast_insert_id(x)expression.sqltypes.ResultUpdatesInsertIDChanged.0LIMITBehavior:LIMITto ensure all input rows are received when expectinglast_insert_idvalues.Known Shortcomings:
For queries such as:
If the results are fetched from multiple shards, the
last_insert_id()session state may not match the value of the last row returned from the query.last_insert_idbased on the final row of the query.Related Issue(s)
Fixes #17298
Checklist