-
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
ddl: basic support for invisible index #15366
Conversation
/rebuild |
Codecov Report
@@ Coverage Diff @@
## master #15366 +/- ##
===========================================
Coverage ? 80.4052%
===========================================
Files ? 502
Lines ? 133495
Branches ? 0
===========================================
Hits ? 107337
Misses ? 17729
Partials ? 8429 |
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.
Rest seems ok
@@ -852,6 +863,9 @@ func ConstructResultOfShowCreateTable(ctx sessionctx.Context, tableInfo *model.T | |||
cols = append(cols, colInfo) | |||
} | |||
fmt.Fprintf(buf, "(%s)", strings.Join(cols, ",")) | |||
if idxInfo.Invisible { | |||
fmt.Fprintf(buf, ` /*!80000 INVISIBLE */`) |
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.
How does comment 80000
come?any reference?
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.
Sorry, I do not find any reference for the /*!80000 INVISIBLE */
,
but when test in MySQL 8.0, it does have this behavior.
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.
make sense
/run-all-tests tidb-test=pr/1004 |
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
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.
fix the conflicts
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
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-all-tests |
@Deardrops merge failed. |
/run-all-tests |
What problem does this PR solve?
Part of #9246
What is changed and how it works?
Store
Invisible
Flag in these statements:CREATE TABLE t (a INT, INDEX (a) INVISIBLE)
CREATE INDEX a on t(a) INVISIBLE
ALTER TABLE t ADD INDEX a INVISIBLE
Add a new column
Visible
inSHOW INDEX
:IS_VISIBLE
in tableinformation_schema.statistics
:SHOW CREATE TABLE
Check List
Tests
Code changes
Side effects
Related changes
Release note