-
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
*: fix a bug that update statement uses point get and update plan with different tblInfo | tidb-test=e1d0c1e615f749e7139f5be95bc4a2b8cedb7380 (#54183) (#54259) #57078
*: fix a bug that update statement uses point get and update plan with different tblInfo | tidb-test=e1d0c1e615f749e7139f5be95bc4a2b8cedb7380 (#54183) (#54259) #57078
Conversation
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
/retest |
1 similar comment
/retest |
/retest |
6 similar comments
/retest |
/retest |
/retest |
/retest |
/retest |
/retest |
/test mysql-test |
@jebter: 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 all |
@Lloyd-Pottiger: 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 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-6.5-20241009-v6.5.10 #57078 +/- ##
=================================================================
Coverage ? 73.6185%
=================================================================
Files ? 1096
Lines ? 352338
Branches ? 0
=================================================================
Hits ? 259386
Misses ? 76269
Partials ? 16683 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qw4990, tangenta 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 |
5c205a6
into
pingcap:release-6.5-20241009-v6.5.10
This is an automated cherry-pick of #54259
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.