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
gen4 planner: allow last_insert_id with arguments #13026
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
This supersedes #12997. |
Signed-off-by: Andres Taylor <andres@planetscale.com>
lowered := node.Name.Lowered() | ||
if lowered == "last_insert_id" && len(node.Exprs) > 0 { | ||
// if we are dealing with is LAST_INSERT_ID() with an argument, we don't need to rewrite it. | ||
// with an argument, this is an identity function that will update the session state and | ||
// sets the correct fields in the OK TCP packet that we send back | ||
return | ||
} | ||
bindVar, found := funcRewrites[lowered] |
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.
nit: this check can be moved down. if the function is present in funcRewrites
I was unable to backport this Pull Request to the following branches: |
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Description
We (incorrectly) decided to disallow
last_insert_id
some time ago, although it was actually working and being used.Related Issue(s)
Fixed #13020
Checklist