-
Notifications
You must be signed in to change notification settings - Fork 688
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
Bulk update integer display width #19393
Conversation
Skipping CI for Draft Pull Request. |
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.
Just some questions about origin of output, if MySQL/DM or TiDB Cloud/Serverless has the same output and/or version
@@ -124,7 +124,7 @@ binlog-schema list -s mysql-replica-01 task_single db_single t1 | |||
"sources": [ | |||
{ | |||
"result": true, | |||
"msg": "CREATE TABLE `t1` ( `c1` int(11) NOT NULL, `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin", | |||
"msg": "CREATE TABLE `t1` ( `c1` int NOT NULL, `c2` int DEFAULT NULL, PRIMARY KEY (`c1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin", |
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.
Since this is a MySQL Source, should it be updated or not? Is it generated by MySQL, TiDB or DM?
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.
@lance6716 Should we exclude dm/
for now or not?
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.
dm will only save TableInfo and recover the SHOW CREATE TABLE statement using TiDB functions, so it should also be updated
@@ -1615,7 +1615,7 @@ curl -X 'GET' \ | |||
{ | |||
"schema_name": "db1", | |||
"table_name": "table1", | |||
"schema_create_sql": "CREATE TABLE `t1` (`id` int(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" | |||
"schema_create_sql": "CREATE TABLE `t1` (`id` int NOT NULL AUTO_INCREMENT,PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin" |
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.
Same here, which is the source and where is it generated? MySQL, TiDB or DM?
@@ -1637,7 +1637,7 @@ curl -X 'PUT' \ | |||
-H 'accept: */*' \ | |||
-H 'Content-Type: application/json' \ | |||
-d '{ | |||
"sql_content": "CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL, `c3` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;", |
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.
Here it is input, so I guess it does not matter, and removing the display width should work regardless.
@@ -116,7 +116,7 @@ To extract the source information of upstream sharded tables to the merged table | |||
|
|||
```sql | |||
CREATE TABLE `test`.`t` ( | |||
a int(11) PRIMARY KEY, | |||
a int PRIMARY KEY, |
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.
Similar here I assume MySQL is the upstream, but I have no issues with updating these as well (unless the output is still including the display width from MySQL or DM).
@@ -184,7 +184,7 @@ mysql> select * from test.t; | |||
```sql | |||
CREATE TABLE `test`.`t` ( | |||
c_table varchar(10) DEFAULT NULL, | |||
a int(11) PRIMARY KEY, | |||
a int PRIMARY KEY, |
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.
Same here, where does it origin from and will it be with or without display width?
@@ -331,7 +331,7 @@ The operation processes are: | |||
"mode": "pessimistic" | |||
"owner": "mysql-replica-02", | |||
"DDLs": [ | |||
"USE `shard_db`; ALTER TABLE `shard_db`.`shard_table` ADD COLUMN `c2` int(11);" | |||
"USE `shard_db`; ALTER TABLE `shard_db`.`shard_table` ADD COLUMN `c2` int;" |
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.
Is this generated by MySQL or DM? Will it use display width or not?
@mjonss: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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
/hold |
/unhold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Oreoxmt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What is changed, added or deleted? (Required)
Related to:
What this does is basically the following, with some manual changes:
Things to consider:
releases/
tinyint(1)
is a special case as it is an alias forbool
(seedata-type-numeric.md
)decimal.NewFromInt(10000)
)tidb-cloud/
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?