-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
bindinfo: fix bugs when using bindings #14263
Conversation
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.
lgtm
func (e *SQLBindExec) createSQLBind(ctx context.Context) error { | ||
sqlExec := e.ctx.(sqlexec.SQLExecutor) | ||
// Use explain to check the validity of bind sql. | ||
recordSets, err := sqlExec.Execute(ctx, fmt.Sprintf("explain %s", e.bindSQL)) |
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.
explain
is much more expensive than parsing and plan building?
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.
Yes, but it much more easier by using explain
, and it could also check the privilege of select tables.
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.
LGTM
/merge |
Your auto merge job has been accepted, waiting for 14470 |
/run-all-tests |
/merge |
/run-all-tests |
@lamxTyler merge failed. |
/run-unit-test |
/run-all-tests |
What problem does this PR solve?
>= 10
, but latter the query was>= -1
, tidb will panic when binding hints.What is changed and how it works?
Check List
Tests
Unit test
Code changes
Has exported function/method change
Side effects
Related changes
Release note