-
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
executor:adjust 'show create table' for mysql compatibility #9113
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9113 +/- ##
==========================================
+ Coverage 67.17% 67.18% +<.01%
==========================================
Files 371 371
Lines 77524 77525 +1
==========================================
+ Hits 52079 52083 +4
+ Misses 20791 20789 -2
+ Partials 4654 4653 -1
Continue to review full report at Codecov.
|
/run-all-tests |
/run-common-test tidb-test=pr/724 |
show create table should not print the charset of the column if it is the same with table charset( same with MySQL)
/run-common-test tidb-test=pr/724 |
1 similar comment
/run-common-test tidb-test=pr/724 |
/run-all-tests tidb-test=pr/724 |
/run-all-tests tidb-test=pr/724 |
/run-all-tests tidb-test=pr/724 |
/run-all-tests tidb-test=pr/724 |
/run-common-test tidb-test=pr/724 |
/run-common-test tidb-test=pr/724 |
@xiekeyi98 For your reference in my test, if we create column with specific charset, even column's charset is the same as table's charset, mysql> use test
Database changed
mysql> create table t (a int,b varchar(20));
Query OK, 0 rows affected (0.02 sec)
mysql> show create table t\G
*************************** 1. row ***************************
Table: t
Create Table: CREATE TABLE `t` (
`a` int(11) DEFAULT NULL,
`b` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)
mysql> create table t1 (a int,b varchar(20) charset utf8mb4);
Query OK, 0 rows affected (0.02 sec)
mysql> show create table t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)
mysql> select version()\G
*************************** 1. row ***************************
version(): 8.0.15
1 row in set (0.00 sec)
|
@AndrewDi Thanks for your help. |
Because I don't understand how MYSQL handles it, I rolled back some commits. |
/run-all-tests tidb-test=pr/724 |
/run-all-tests tidb-test=pr/724 |
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, please cherry-pick this PR to 2.1 branch
show create table should not print the charset of the column
if it is the same with table charset( same with MySQL)
What problem does this PR solve?
If the charset of column is the same with table charset , we should better not show the carset of the column.
(In order to be consistent with MySQL.)
What is changed and how it works?
Change
func (e *ShowExec) fetchShowCreateTable() error{}
, to determine if the column charset and table charset are equal.Check List
Tests
Before
After