Bulk update integer display width#19393
Conversation
|
Skipping CI for Draft Pull Request. |
mjonss
left a comment
There was a problem hiding this comment.
Just some questions about origin of output, if MySQL/DM or TiDB Cloud/Serverless has the same output and/or version
| { | ||
| "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.
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.
@lance6716 Should we exclude dm/ for now or not?
There was a problem hiding this comment.
dm will only save TableInfo and recover the SHOW CREATE TABLE statement using TiDB functions, so it should also be updated
| "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.
Same here, which is the source and where is it generated? MySQL, TiDB or DM?
| -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.
Here it is input, so I guess it does not matter, and removing the display width should work regardless.
| ```sql | ||
| CREATE TABLE `test`.`t` ( | ||
| a int(11) PRIMARY KEY, | ||
| a int PRIMARY KEY, |
There was a problem hiding this comment.
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).
| 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.
Same here, where does it origin from and will it be with or without display width?
| "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.
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. DetailsIn 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. |
|
/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 DetailsNeeds 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?