-
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 update bug in cluster index #18045
*: fix update bug in cluster index #18045
Conversation
executor/update_test.go
Outdated
|
||
tk.MustExec("drop table if exists t") | ||
tk.MustExec("create table t(a char(10) primary key, b char(10));") | ||
tk.MustExec("insert into t values(\"a\", \"\");") |
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.
You can use single quote to make it more readable.
executor/update_test.go
Outdated
tk.MustExec("drop table if exists t") | ||
tk.MustExec("create table t(a char(10) primary key, b char(10));") | ||
tk.MustExec("insert into t values(\"a\", \"\");") | ||
tk.MustExec("update t set a=\"c\" where t.a=\"a\" and b=\"\";") |
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.
Need select and check the result?
@@ -2827,7 +2827,7 @@ func (b *PlanBuilder) buildDataSource(ctx context.Context, tn *ast.TableName, as | |||
IsHidden: col.Hidden, | |||
} | |||
|
|||
if tableInfo.PKIsHandle && mysql.HasPriKeyFlag(col.Flag) { | |||
if col.IsPKHandleColumn(tableInfo) || col.IsCommonHandleColumn(tableInfo) { |
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.
There could be multiple handleCols if the table has a multi-column primary key.
Codecov Report
@@ Coverage Diff @@
## master #18045 +/- ##
================================================
- Coverage 80.1399% 79.4445% -0.6954%
================================================
Files 524 524
Lines 147356 142191 -5165
================================================
- Hits 118091 112963 -5128
+ Misses 20089 20073 -16
+ Partials 9176 9155 -21 |
LGTM |
/run-all-tests |
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
/run-integration-ddl-test |
Signed-off-by: wjhuang2016 huangwenjun1997@gmail.com
What problem does this PR solve?
Issue Number: close #18043
Problem Summary:
What is changed and how it works?
Related changes
Check List
Tests
Side effects
Release note