Skip to content

Commit 4275195

Browse files
authored
config: Make deprecate-integer-display-length default to true (#56529)
close #17682, close #56533
1 parent 44f1c14 commit 4275195

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+604
-600
lines changed

pkg/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ var defaultConf = Config{
10561056
AuthTokenRefreshInterval: DefAuthTokenRefreshInterval.String(),
10571057
DisconnectOnExpiredPassword: true,
10581058
},
1059-
DeprecateIntegerDisplayWidth: false,
1059+
DeprecateIntegerDisplayWidth: true,
10601060
EnableEnumLengthLimit: true,
10611061
StoresRefreshInterval: defTiKVCfg.StoresRefreshInterval,
10621062
EnableForwarding: defTiKVCfg.EnableForwarding,

pkg/config/config.toml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ enable-telemetry = false
101101

102102
# deprecate-integer-display-length is used to be compatible with MySQL 8.0 in which the integer declared with display length will be returned with
103103
# a warning like `Integer display width is deprecated and will be removed in a future release`.
104-
deprecate-integer-display-length = false
104+
deprecate-integer-display-length = true
105105

106106
# enable-enum-length-limit is used to deal with compatibility issues. When true, the enum/set element length is limited.
107107
# According to MySQL 8.0 Refman:

pkg/config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ enable-telemetry = true
291291
292292
# deprecate-integer-display-length is used to be compatible with MySQL 8.0 in which the integer declared with display length will be returned with
293293
# <snip>
294-
deprecate-integer-display-length = false
294+
deprecate-integer-display-length = true
295295
296296
# enable-enum-length-limit is used to deal with compatibility issues. When true, the enum/set element length is limited.
297297
# According to MySQL 8.0 Refman:

tests/integrationtest/r/cte.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ MergeJoin_36 8001.00 root inner join, left key:cte.t1.c1, right key:cte.t1.c1
449449
CTE_0 8001.00 root Recursive CTE
450450
├─TableReader_18(Seed Part) 10000.00 root data:TableFullScan_17
451451
│ └─TableFullScan_17 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
452-
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.t1.c1, 1), int(11))->cte.t1.c1
452+
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.t1.c1, 1), int)->cte.t1.c1
453453
└─Selection_20 8000.00 root lt(cte.t1.c1, 3)
454454
└─CTETable_21 10000.00 root Scan on CTE_0
455455
with recursive cte1 as (select c1 from t1 union select c1 +1 c1 from cte1 where c1 < 3) select /*+ MERGE_JOIN(dt1, dt2) */ * from t1 dt1 inner join cte1 dt2 on dt2.c1 = dt1.c1 order by 1, 2;
@@ -472,7 +472,7 @@ MergeJoin_36 8001.00 root inner join, left key:cte.t1.c1, right key:cte.tpk.c1
472472
CTE_0 8001.00 root Recursive CTE
473473
├─TableReader_18(Seed Part) 10000.00 root data:TableFullScan_17
474474
│ └─TableFullScan_17 10000.00 cop[tikv] table:tpk keep order:false, stats:pseudo
475-
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.tpk.c1, 1), int(11))->cte.tpk.c1
475+
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.tpk.c1, 1), int)->cte.tpk.c1
476476
└─Selection_20 8000.00 root lt(cte.tpk.c1, 3)
477477
└─CTETable_21 10000.00 root Scan on CTE_0
478478
with recursive cte1 as (select c1 from tpk union select c1 +1 c1 from cte1 where c1 < 3) select /*+ MERGE_JOIN(dt1, dt2) */ * from t1 dt1 inner join cte1 dt2 on dt2.c1 = dt1.c1 order by 1, 2;
@@ -632,7 +632,7 @@ CTE_0 20.00 root Recursive CTE, limit(offset:0, count:1)
632632
│ └─Projection_20 10.00 cop[tikv] cte.t2.c1
633633
│ └─Selection_25 10.00 cop[tikv] eq(cte.t2.c2, cte.t1.c2)
634634
│ └─TableFullScan_24 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
635-
└─Projection_27(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int(11))->cte.t2.c1
635+
└─Projection_27(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int)->cte.t2.c1
636636
└─CTETable_28 10.00 root Scan on CTE_0
637637
select * from t1 where c1 > all(with recursive cte1 as (select c1 from t2 where t2.c2 = t1.c2 union all select c1+1 as c1 from cte1 limit 1) select c1 from cte1);
638638
c1 c2
@@ -649,7 +649,7 @@ CTE_0 20.00 root Recursive CTE, limit(offset:0, count:10)
649649
│ └─Projection_18 10.00 cop[tikv] cte.t2.c1
650650
│ └─Selection_23 10.00 cop[tikv] eq(cte.t2.c2, cte.t1.c2)
651651
│ └─TableFullScan_22 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
652-
└─Projection_25(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int(11))->cte.t2.c1
652+
└─Projection_25(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int)->cte.t2.c1
653653
└─CTETable_26 10.00 root Scan on CTE_0
654654
select * from t1 where exists(with recursive cte1 as (select c1 from t2 where t2.c2 = t1.c2 union all select c1+1 as c1 from cte1 limit 10) select c1 from cte1);
655655
c1 c2
@@ -668,7 +668,7 @@ Projection_24 10000.00 root cte.t1.c1, cte.t1.c2
668668
CTE_0 18000.00 root Recursive CTE
669669
├─TableReader_19(Seed Part) 10000.00 root data:TableFullScan_18
670670
│ └─TableFullScan_18 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
671-
└─Projection_20(Recursive Part) 8000.00 root cast(plus(cte.t2.c1, 1), int(11))->cte.t2.c1, cast(plus(cte.t2.c2, 1), int(11))->cte.t2.c2
671+
└─Projection_20(Recursive Part) 8000.00 root cast(plus(cte.t2.c1, 1), int)->cte.t2.c1, cast(plus(cte.t2.c2, 1), int)->cte.t2.c2
672672
└─Selection_21 8000.00 root eq(cte.t2.c2, cte.t1.c2)
673673
└─CTETable_22 10000.00 root Scan on CTE_0
674674
select * from t1 where c1 > all(with recursive cte1 as (select c1, c2 from t2 union all select c1+1 as c1, c2+1 as c2 from cte1 where cte1.c2=t1.c2) select c1 from cte1);
@@ -682,7 +682,7 @@ Apply_23 10000.00 root CARTESIAN semi join
682682
CTE_0 18000.00 root Recursive CTE
683683
├─TableReader_17(Seed Part) 10000.00 root data:TableFullScan_16
684684
│ └─TableFullScan_16 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
685-
└─Projection_18(Recursive Part) 8000.00 root cast(plus(cte.t2.c1, 1), int(11))->cte.t2.c1, cast(plus(cte.t2.c2, 1), int(11))->cte.t2.c2
685+
└─Projection_18(Recursive Part) 8000.00 root cast(plus(cte.t2.c1, 1), int)->cte.t2.c1, cast(plus(cte.t2.c2, 1), int)->cte.t2.c2
686686
└─Selection_19 8000.00 root eq(cte.t2.c2, cte.t1.c2)
687687
└─CTETable_20 10000.00 root Scan on CTE_0
688688
select * from t1 where exists(with recursive cte1 as (select c1, c2 from t2 union all select c1+1 as c1, c2+1 as c2 from cte1 where cte1.c2=t1.c2) select c1 from cte1);

tests/integrationtest/r/db_integration.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ IS_UUID(BIN_TO_UUID(c1))
2020
SHOW CREATE TABLE u1;
2121
Table Create Table
2222
u1 CREATE TABLE `u1` (
23-
`id` int(11) NOT NULL,
23+
`id` int NOT NULL,
2424
`c1` varchar(36) DEFAULT (uuid()),
2525
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
2626
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
2727
SHOW CREATE TABLE u2;
2828
Table Create Table
2929
u2 CREATE TABLE `u2` (
30-
`id` int(11) NOT NULL,
30+
`id` int NOT NULL,
3131
`c1` varbinary(16) DEFAULT (uuid_to_bin(uuid())),
3232
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
3333
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

tests/integrationtest/r/ddl/column.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ CREATE TABLE t1(id INTEGER PRIMARY KEY, authorId INTEGER AUTO_INCREMENT UNIQUE);
4343
show create table t1;
4444
Table Create Table
4545
t1 CREATE TABLE `t1` (
46-
`id` int(11) NOT NULL,
47-
`authorId` int(11) NOT NULL AUTO_INCREMENT,
46+
`id` int NOT NULL,
47+
`authorId` int NOT NULL AUTO_INCREMENT,
4848
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
4949
UNIQUE KEY `authorId` (`authorId`)
5050
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
5151
CREATE TABLE `t2`( `id` INTEGER PRIMARY KEY, `authorId` int(11) AUTO_INCREMENT, UNIQUE KEY `authorIdx` (`authorId`));
5252
show create table t2;
5353
Table Create Table
5454
t2 CREATE TABLE `t2` (
55-
`id` int(11) NOT NULL,
56-
`authorId` int(11) NOT NULL AUTO_INCREMENT,
55+
`id` int NOT NULL,
56+
`authorId` int NOT NULL AUTO_INCREMENT,
5757
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
5858
UNIQUE KEY `authorIdx` (`authorId`)
5959
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

tests/integrationtest/r/ddl/column_modify.result

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@ drop table if exists test_gv_ddl, table_with_gen_col_blanks, table_with_gen_col_
22
CREATE TABLE test_gv_ddl(a int, b int as (a+8) virtual, c int as (b + 2) stored);
33
DESC test_gv_ddl;
44
Field Type Null Key Default Extra
5-
a int(11) YES NULL
6-
b int(11) YES NULL VIRTUAL GENERATED
7-
c int(11) YES NULL STORED GENERATED
5+
a int YES NULL
6+
b int YES NULL VIRTUAL GENERATED
7+
c int YES NULL STORED GENERATED
88
show create table test_gv_ddl;
99
Table Create Table
1010
test_gv_ddl CREATE TABLE `test_gv_ddl` (
11-
`a` int(11) DEFAULT NULL,
12-
`b` int(11) GENERATED ALWAYS AS (`a` + 8) VIRTUAL,
13-
`c` int(11) GENERATED ALWAYS AS (`b` + 2) STORED
11+
`a` int DEFAULT NULL,
12+
`b` int GENERATED ALWAYS AS (`a` + 8) VIRTUAL,
13+
`c` int GENERATED ALWAYS AS (`b` + 2) STORED
1414
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1515
create table table_with_gen_col_blanks (a int, b char(20) as (cast(
1616
a
1717
as char)), c int as (a+100));
1818
show create table table_with_gen_col_blanks;
1919
Table Create Table
2020
table_with_gen_col_blanks CREATE TABLE `table_with_gen_col_blanks` (
21-
`a` int(11) DEFAULT NULL,
21+
`a` int DEFAULT NULL,
2222
`b` char(20) GENERATED ALWAYS AS (cast(`a` as char)) VIRTUAL,
23-
`c` int(11) GENERATED ALWAYS AS (`a` + 100) VIRTUAL
23+
`c` int GENERATED ALWAYS AS (`a` + 100) VIRTUAL
2424
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
2525
create table table_with_gen_col_latin1 (a int, b char(20) as (cast(
2626
a
2727
as char charset latin1)), c int as (a+100));
2828
show create table table_with_gen_col_latin1;
2929
Table Create Table
3030
table_with_gen_col_latin1 CREATE TABLE `table_with_gen_col_latin1` (
31-
`a` int(11) DEFAULT NULL,
31+
`a` int DEFAULT NULL,
3232
`b` char(20) GENERATED ALWAYS AS (cast(`a` as char charset latin1)) VIRTUAL,
33-
`c` int(11) GENERATED ALWAYS AS (`a` + 100) VIRTUAL
33+
`c` int GENERATED ALWAYS AS (`a` + 100) VIRTUAL
3434
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
3535
create table table_with_gen_col_string (first_name varchar(10), last_name varchar(10), full_name varchar(255) AS (CONCAT(first_name,' ',last_name)));
3636
show create table table_with_gen_col_string;
@@ -90,15 +90,15 @@ alter table test_gv_ddl modify column c bigint as (b+200) stored;
9090
Error 3106 (HY000): 'modifying a stored column' is not supported for generated columns.
9191
DESC test_gv_ddl;
9292
Field Type Null Key Default Extra
93-
a int(11) YES NULL
94-
b int(11) YES NULL VIRTUAL GENERATED
95-
c int(11) YES NULL STORED GENERATED
93+
a int YES NULL
94+
b int YES NULL VIRTUAL GENERATED
95+
c int YES NULL STORED GENERATED
9696
alter table test_gv_ddl change column c cnew bigint;
9797
DESC test_gv_ddl;
9898
Field Type Null Key Default Extra
99-
a int(11) YES NULL
100-
b int(11) YES NULL VIRTUAL GENERATED
101-
cnew bigint(20) YES NULL
99+
a int YES NULL
100+
b int YES NULL VIRTUAL GENERATED
101+
cnew bigint YES NULL
102102
drop table if exists t;
103103
CREATE TABLE t(c0 TEXT AS ('\\'));
104104
insert into t values ();
@@ -117,15 +117,15 @@ alter table t change a a int default 0.00;
117117
show create table t;
118118
Table Create Table
119119
t CREATE TABLE `t` (
120-
`a` int(11) DEFAULT '0'
120+
`a` int DEFAULT '0'
121121
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
122122
drop table if exists t;
123123
create table t (a int default 1.25);
124124
alter table t change a a int default 2.8;
125125
show create table t;
126126
Table Create Table
127127
t CREATE TABLE `t` (
128-
`a` int(11) DEFAULT '3'
128+
`a` int DEFAULT '3'
129129
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
130130
drop table if exists t;
131131
create table t (a float default 1.25);
@@ -255,16 +255,16 @@ alter table test_rename_column rename column col1 to col1;
255255
show create table test_rename_column;
256256
Table Create Table
257257
test_rename_column CREATE TABLE `test_rename_column` (
258-
`id` int(11) NOT NULL AUTO_INCREMENT,
259-
`col1` int(11) DEFAULT NULL,
258+
`id` int NOT NULL AUTO_INCREMENT,
259+
`col1` int DEFAULT NULL,
260260
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
261261
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
262262
alter table test_rename_column rename column col1 to col2;
263263
show create table test_rename_column;
264264
Table Create Table
265265
test_rename_column CREATE TABLE `test_rename_column` (
266-
`id` int(11) NOT NULL AUTO_INCREMENT,
267-
`col2` int(11) DEFAULT NULL,
266+
`id` int NOT NULL AUTO_INCREMENT,
267+
`col2` int DEFAULT NULL,
268268
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
269269
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
270270
alter table test_rename_column rename column non_exist_col to col3;
@@ -277,15 +277,15 @@ alter table test_rename_column rename column col1 to col2;
277277
show create table test_rename_column;
278278
Table Create Table
279279
test_rename_column CREATE TABLE `test_rename_column` (
280-
`id` int(11) DEFAULT NULL,
281-
`col2` int(11) GENERATED ALWAYS AS (`id` + 1) VIRTUAL
280+
`id` int DEFAULT NULL,
281+
`col2` int GENERATED ALWAYS AS (`id` + 1) VIRTUAL
282282
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
283283
alter table test_rename_column rename column col2 to col1;
284284
show create table test_rename_column;
285285
Table Create Table
286286
test_rename_column CREATE TABLE `test_rename_column` (
287-
`id` int(11) DEFAULT NULL,
288-
`col1` int(11) GENERATED ALWAYS AS (`id` + 1) VIRTUAL
287+
`id` int DEFAULT NULL,
288+
`col1` int GENERATED ALWAYS AS (`id` + 1) VIRTUAL
289289
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
290290
alter table test_rename_column rename column id to id1;
291291
Error 3108 (HY000): Column 'id' has a generated column dependency.
@@ -307,9 +307,9 @@ alter table test2 change c2 a int not null;
307307
show create table test2;
308308
Table Create Table
309309
test2 CREATE TABLE `test2` (
310-
`c1` int(11) DEFAULT NULL,
311-
`a` int(11) NOT NULL,
312-
`c3` int(11) DEFAULT '1',
310+
`c1` int DEFAULT NULL,
311+
`a` int NOT NULL,
312+
`c3` int DEFAULT '1',
313313
KEY `c1` (`c1`)
314314
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
315315
drop table if exists test2;

0 commit comments

Comments
 (0)