-
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
bindinfo, record how bindings are created in SQL bindings. #17254
Conversation
PTAL~ @eurekaka @lzmhhh123 |
Codecov Report
@@ Coverage Diff @@
## master #17254 +/- ##
===========================================
Coverage ? 80.2397%
===========================================
Files ? 521
Lines ? 142579
Branches ? 0
===========================================
Hits ? 114405
Misses ? 19164
Partials ? 9010 |
session/bootstrap.go
Outdated
@@ -240,6 +240,7 @@ const ( | |||
update_time timestamp(3) NOT NULL, | |||
charset text NOT NULL, | |||
collation text NOT NULL, | |||
create_way text NOT NULL, |
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.
We'd better use alter table mysql.bind_info add column ...
and add a new version for bootstrap to avoid upgrade compatibility problems.
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.
BTW, a default value unknown
for create_way
is also necessary. Because the lower version of tidb-server doesn't have this column.
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.
done now, PTAL @lzmhhh123
/run-unit-tests |
session/bootstrap.go
Outdated
@@ -240,6 +240,7 @@ const ( | |||
update_time timestamp(3) NOT NULL, | |||
charset text NOT NULL, | |||
collation text NOT NULL, | |||
create_way varchar(20) NOT NULL default 'unknow', |
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.
create_way varchar(20) NOT NULL default 'unknow', | |
create_way varchar(10) NOT NULL default 'unknown', |
After we execute the alter column
in bootstrap, it's better not to create the column when create table.
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.
@lzmhhh123 upgradeToVer47
will only be done when the version code is lower than 47, while current version is 47, so create the column when create table is necessary.
I checked the implementation of other upgradeToVerX
functions, they did it in the same way.
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.
for instance, upgradeToVer29
adds an index, and a relevant index is created when create table, too.
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.
@lzmhhh123 and , sql_created
is more than 10 chars, so we need varchar(20). 😆 (I didn't realized it first, either.)
/rebuild |
PTAL @eurekaka |
comment addressed @eurekaka |
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 LGTM.
/run-all-tests |
@lawyerphx merge failed. |
/run-integration-copr-tests |
/run-integration-br-tests |
/merge |
/run-all-tests |
/run-cherry-picker |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-4.0 in PR #17587 |
What problem does this PR solve?
Issue Number: close #16748
Problem Summary:
What is changed and how it works?
What's Changed:
CreateWay
inBinding
to indicate the way binding created.CreateWay
when executeshow [global] bindings
How it Works:
Related changes
Check List
Tests
Side effects
Release note
CreateWay
inBinding
to help know the way binding created.