-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: fix a bug that update statement uses point get and update plan with different tblInfo (#54183) #54259
*: fix a bug that update statement uses point get and update plan with different tblInfo (#54183) #54259
Conversation
Signed-off-by: ti-chi-bot <[email protected]>
/retest |
@@ -142,6 +143,119 @@ func newDefaultCallBack(do DomainReloader) Callback { | |||
|
|||
// ****************************** End of Default DDL Callback Instance ********************************************* | |||
|
|||
// ****************************** Start of Test DDL Callback Instance *********************************************** |
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.
This is just a code move in the file, for compatibility with the current PR test call issue.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, qw4990 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/test unit-test |
@zimulala: No presubmit jobs available for pingcap/[email protected] 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-sigs/prow repository. |
/test unit-test |
@zimulala: No presubmit jobs available for pingcap/[email protected] 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-sigs/prow repository. |
/retest |
/test unit-test |
@JaySon-Huang: No presubmit jobs available for pingcap/[email protected] 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-sigs/prow repository. |
/test unit-test |
@zimulala: No presubmit jobs available for pingcap/[email protected] 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-sigs/prow repository. |
2dc27ab
to
f135206
Compare
/test unit-test |
@zimulala: No presubmit jobs available for pingcap/[email protected] 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-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-6.5 #54259 +/- ##
================================================
Coverage ? 73.6304%
================================================
Files ? 1097
Lines ? 352812
Branches ? 0
================================================
Hits ? 259777
Misses ? 76330
Partials ? 16705 |
/cherry-pick release-6.5-20241009-v6.5.10 |
@Lloyd-Pottiger: new pull request created to branch 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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <[email protected]>
This is an automated cherry-pick of #54183
What problem does this PR solve?
Issue Number: close #53634
Problem Summary:
Case
Init SQLs:
prepare statements:
run a statement:
begin;
do DDL:
When the DDL is in Write-Only state
exec statements:
Step4. using conn1
Check the result
select * from stock;
Statement execution order table
Conclusion
The update statement in step3 uses point get and update plan, but the tblInfo used by the two plans is inconsistent, resulting in incorrect data in real storage.
After executing step3. select statement, the stock is locked in
GetRelatedTableForMDL
, sostmt.tbls[i].Meta().Revision != newTbl.Meta().Revision
is false. It meansschemaNotMatch
is false. So we needn't toPreprocess
.tidb/pkg/planner/core/plan_cache.go
Lines 114 to 119 in d5b89f8
Step3. update statement using
tblName.TableInfo
(get it when preparing statements,cct_1
is public) innewPointGetPlan
.tidb/pkg/planner/core/point_get_plan.go
Line 1317 in d5b89f8
Step3. update statement using
t
gets fromis.TableByID(tbl.ID)
(cct_1
is write-only)tidb/pkg/planner/core/point_get_plan.go
Lines 1945 to 1950 in d5b89f8
What changed and how does it work?
Add the
Revision
field comparison oftbl
(get from txn infoschema) andnewTbl
to confirm whether reprocess is required.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.