-
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: add column character sets when show create table #8866
Conversation
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
@AndrewDi Please fix CI |
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #8866 +/- ##
==========================================
+ Coverage 67.27% 67.27% +<.01%
==========================================
Files 371 371
Lines 75917 75919 +2
==========================================
+ Hits 51073 51076 +3
+ Misses 20345 20343 -2
- Partials 4499 4500 +1
Continue to review full report at Codecov.
|
@@ -571,6 +571,9 @@ func (e *ShowExec) fetchShowCreateTable() error { | |||
var hasAutoIncID bool | |||
for i, col := range tb.Cols() { | |||
fmt.Fprintf(&buf, " %s %s", escape(col.Name, sqlMode), col.GetTypeDesc()) | |||
if col.Charset != "binary" { |
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.
why don't we print the "binary" charset and collation?
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.
Because MySQL didn't do it either, and it will broken lots of test case...
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.
OK, this behavior is confirmed in a mysql server on my laptop:
MySQL(root@localhost:test) > create table t(a char(10) character set binary, b char(20) character set utf8mb4);
Query OK, 0 rows affected (0.03 sec)
MySQL(root@localhost:test) > show create table t\G
*************************** 1. row ***************************
Table: t
Create Table: CREATE TABLE `t` (
`a` binary(10) DEFAULT NULL,
`b` char(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)
/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
The integration test is failed, some modifications should be made to correct these test cases. |
/run-all-tests |
/run-all-tests |
/run-all-tests tidb-test=pr/718 |
/run-common-test tidb-test=pr/718 |
/run-integration-common-test tidb-test=pr/718 |
2 similar comments
/run-integration-common-test tidb-test=pr/718 |
/run-integration-common-test tidb-test=pr/718 |
/run-common-test tidb-test=pr/718 |
3 similar comments
/run-common-test tidb-test=pr/718 |
/run-common-test tidb-test=pr/718 |
/run-common-test tidb-test=pr/718 |
/run-common-test tidb-test=pr/718 |
2 similar comments
/run-common-test tidb-test=pr/718 |
/run-common-test tidb-test=pr/718 |
/run-all-tests tidb-test=pr/718 |
/run-unit-test tidb-test=pr/718 |
What problem does this PR solve?
Fix bug #8700
What is changed and how it works?
When show create table, the character sets of the non-default columns should be retained.
Check List
Tests
This change is