-
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
Got updateBindinfo error when upgrade from 4.x to 5.x #27064
Comments
Looks like same problem with asktug. |
/assign |
The behavior here is expected. If SQL fails to pass the parser check in the new version, an error will be generated when the corresponding binding is first loaded after the upgrade. We need to manually delete the binding that corresponds to the error so that it can be started after the upgrade. So, please check whether the bind_sql's syntax is right before the upgrade. This will be added to the upgrade checklist. |
/close |
@Reminiscent: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions[4.0.0:4.0.14],[5.0.0:5.0.3],[5.1.0:5.1.1] 6. Fixed versions |
Do we have link of the checklist? |
( FixedVersions ) fields are empty. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
In a cluster v4.0.14, use the following SQL to create bind
drop table if exists t;
create table t(a int primary key);
select * from ( (select * from t) as x), t;
create global binding for select * from ( (select * from t) as x) inner join t on x.a = t.a using select /*+ hash_join(x, t) */ * from ( (select * from t) as x) inner join t on x.a = t.a;
upgrade to v5.0.3, we got the following errors:
[FATAL] [bootstrap.go:1419] ["updateBindInfo error"] [error="line 1 column 72 near "AS
x
) JOINtest
.t
ONx
.a
=t
.a
" "] [stack="github.com/pingcap/tidb/session.updateBindInfo\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/session/bootstrap.go:1419\ngithub.com/pingcap/tidb/session.upgradeToVer67\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/session/bootstrap.go:1387\ngithub.com/pingcap/tidb/session.upgrade\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/session/bootstrap.go:639\ngithub.com/pingcap/tidb/session.runInBootstrapSession\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/session/session.go:2304\ngithub.com/pingcap/tidb/session.BootstrapSession\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/session/session.go:2175\nmain.createStoreAndDomain\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/tidb-server/main.go:269\nmain.main\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/tidb-server/main.go:183\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"]2. What did you expect to see? (Required)
upgrade successfully.
3. What did you see instead (Required)
upgrade failed.
4. What is your TiDB version? (Required)
v5.x
suggestion:
In v4.x
select * from ( (select * from t) as x), t;
is valid. But we got parser error in v5.x. That's why upgrade is failed. But this behavior is compatible with MySQL8.0. So may be we should record the orginal sql instead of the sql parsed by AST Tree.The text was updated successfully, but these errors were encountered: