Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ var defaultConf = Config{
AuthTokenRefreshInterval: DefAuthTokenRefreshInterval.String(),
DisconnectOnExpiredPassword: true,
},
DeprecateIntegerDisplayWidth: false,
DeprecateIntegerDisplayWidth: true,
EnableEnumLengthLimit: true,
StoresRefreshInterval: defTiKVCfg.StoresRefreshInterval,
EnableForwarding: defTiKVCfg.EnableForwarding,
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ enable-telemetry = false

# 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
# a warning like `Integer display width is deprecated and will be removed in a future release`.
deprecate-integer-display-length = false
deprecate-integer-display-length = true

# enable-enum-length-limit is used to deal with compatibility issues. When true, the enum/set element length is limited.
# According to MySQL 8.0 Refman:
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ enable-telemetry = true

# 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
# <snip>
deprecate-integer-display-length = false
deprecate-integer-display-length = true

# enable-enum-length-limit is used to deal with compatibility issues. When true, the enum/set element length is limited.
# According to MySQL 8.0 Refman:
Expand Down
12 changes: 6 additions & 6 deletions tests/integrationtest/r/cte.result
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ MergeJoin_36 8001.00 root inner join, left key:cte.t1.c1, right key:cte.t1.c1
CTE_0 8001.00 root Recursive CTE
├─TableReader_18(Seed Part) 10000.00 root data:TableFullScan_17
│ └─TableFullScan_17 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.t1.c1, 1), int(11))->cte.t1.c1
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.t1.c1, 1), int)->cte.t1.c1
└─Selection_20 8000.00 root lt(cte.t1.c1, 3)
└─CTETable_21 10000.00 root Scan on CTE_0
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;
Expand All @@ -472,7 +472,7 @@ MergeJoin_36 8001.00 root inner join, left key:cte.t1.c1, right key:cte.tpk.c1
CTE_0 8001.00 root Recursive CTE
├─TableReader_18(Seed Part) 10000.00 root data:TableFullScan_17
│ └─TableFullScan_17 10000.00 cop[tikv] table:tpk keep order:false, stats:pseudo
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.tpk.c1, 1), int(11))->cte.tpk.c1
└─Projection_19(Recursive Part) 8000.00 root cast(plus(cte.tpk.c1, 1), int)->cte.tpk.c1
└─Selection_20 8000.00 root lt(cte.tpk.c1, 3)
└─CTETable_21 10000.00 root Scan on CTE_0
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;
Expand Down Expand Up @@ -632,7 +632,7 @@ CTE_0 20.00 root Recursive CTE, limit(offset:0, count:1)
│ └─Projection_20 10.00 cop[tikv] cte.t2.c1
│ └─Selection_25 10.00 cop[tikv] eq(cte.t2.c2, cte.t1.c2)
│ └─TableFullScan_24 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─Projection_27(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int(11))->cte.t2.c1
└─Projection_27(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int)->cte.t2.c1
└─CTETable_28 10.00 root Scan on CTE_0
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);
c1 c2
Expand All @@ -649,7 +649,7 @@ CTE_0 20.00 root Recursive CTE, limit(offset:0, count:10)
│ └─Projection_18 10.00 cop[tikv] cte.t2.c1
│ └─Selection_23 10.00 cop[tikv] eq(cte.t2.c2, cte.t1.c2)
│ └─TableFullScan_22 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─Projection_25(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int(11))->cte.t2.c1
└─Projection_25(Recursive Part) 10.00 root cast(plus(cte.t2.c1, 1), int)->cte.t2.c1
└─CTETable_26 10.00 root Scan on CTE_0
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);
c1 c2
Expand All @@ -668,7 +668,7 @@ Projection_24 10000.00 root cte.t1.c1, cte.t1.c2
CTE_0 18000.00 root Recursive CTE
├─TableReader_19(Seed Part) 10000.00 root data:TableFullScan_18
│ └─TableFullScan_18 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─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
└─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
└─Selection_21 8000.00 root eq(cte.t2.c2, cte.t1.c2)
└─CTETable_22 10000.00 root Scan on CTE_0
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);
Expand All @@ -682,7 +682,7 @@ Apply_23 10000.00 root CARTESIAN semi join
CTE_0 18000.00 root Recursive CTE
├─TableReader_17(Seed Part) 10000.00 root data:TableFullScan_16
│ └─TableFullScan_16 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─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
└─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
└─Selection_19 8000.00 root eq(cte.t2.c2, cte.t1.c2)
└─CTETable_20 10000.00 root Scan on CTE_0
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);
Expand Down
4 changes: 2 additions & 2 deletions tests/integrationtest/r/db_integration.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ IS_UUID(BIN_TO_UUID(c1))
SHOW CREATE TABLE u1;
Table Create Table
u1 CREATE TABLE `u1` (
`id` int(11) NOT NULL,
`id` int NOT NULL,
`c1` varchar(36) DEFAULT (uuid()),
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
SHOW CREATE TABLE u2;
Table Create Table
u2 CREATE TABLE `u2` (
`id` int(11) NOT NULL,
`id` int NOT NULL,
`c1` varbinary(16) DEFAULT (uuid_to_bin(uuid())),
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
8 changes: 4 additions & 4 deletions tests/integrationtest/r/ddl/column.result
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ CREATE TABLE t1(id INTEGER PRIMARY KEY, authorId INTEGER AUTO_INCREMENT UNIQUE);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`authorId` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL,
`authorId` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY `authorId` (`authorId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
CREATE TABLE `t2`( `id` INTEGER PRIMARY KEY, `authorId` int(11) AUTO_INCREMENT, UNIQUE KEY `authorIdx` (`authorId`));
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL,
`authorId` int(11) NOT NULL AUTO_INCREMENT,
`id` int NOT NULL,
`authorId` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY `authorIdx` (`authorId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
Expand Down
58 changes: 29 additions & 29 deletions tests/integrationtest/r/ddl/column_modify.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ drop table if exists test_gv_ddl, table_with_gen_col_blanks, table_with_gen_col_
CREATE TABLE test_gv_ddl(a int, b int as (a+8) virtual, c int as (b + 2) stored);
DESC test_gv_ddl;
Field Type Null Key Default Extra
a int(11) YES NULL
b int(11) YES NULL VIRTUAL GENERATED
c int(11) YES NULL STORED GENERATED
a int YES NULL
b int YES NULL VIRTUAL GENERATED
c int YES NULL STORED GENERATED
show create table test_gv_ddl;
Table Create Table
test_gv_ddl CREATE TABLE `test_gv_ddl` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS (`a` + 8) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS (`b` + 2) STORED
`a` int DEFAULT NULL,
`b` int GENERATED ALWAYS AS (`a` + 8) VIRTUAL,
`c` int GENERATED ALWAYS AS (`b` + 2) STORED
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
create table table_with_gen_col_blanks (a int, b char(20) as (cast(
a
as char)), c int as (a+100));
show create table table_with_gen_col_blanks;
Table Create Table
table_with_gen_col_blanks CREATE TABLE `table_with_gen_col_blanks` (
`a` int(11) DEFAULT NULL,
`a` int DEFAULT NULL,
`b` char(20) GENERATED ALWAYS AS (cast(`a` as char)) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS (`a` + 100) VIRTUAL
`c` int GENERATED ALWAYS AS (`a` + 100) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
create table table_with_gen_col_latin1 (a int, b char(20) as (cast(
a
as char charset latin1)), c int as (a+100));
show create table table_with_gen_col_latin1;
Table Create Table
table_with_gen_col_latin1 CREATE TABLE `table_with_gen_col_latin1` (
`a` int(11) DEFAULT NULL,
`a` int DEFAULT NULL,
`b` char(20) GENERATED ALWAYS AS (cast(`a` as char charset latin1)) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS (`a` + 100) VIRTUAL
`c` int GENERATED ALWAYS AS (`a` + 100) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
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)));
show create table table_with_gen_col_string;
Expand Down Expand Up @@ -90,15 +90,15 @@ alter table test_gv_ddl modify column c bigint as (b+200) stored;
Error 3106 (HY000): 'modifying a stored column' is not supported for generated columns.
DESC test_gv_ddl;
Field Type Null Key Default Extra
a int(11) YES NULL
b int(11) YES NULL VIRTUAL GENERATED
c int(11) YES NULL STORED GENERATED
a int YES NULL
b int YES NULL VIRTUAL GENERATED
c int YES NULL STORED GENERATED
alter table test_gv_ddl change column c cnew bigint;
DESC test_gv_ddl;
Field Type Null Key Default Extra
a int(11) YES NULL
b int(11) YES NULL VIRTUAL GENERATED
cnew bigint(20) YES NULL
a int YES NULL
b int YES NULL VIRTUAL GENERATED
cnew bigint YES NULL
drop table if exists t;
CREATE TABLE t(c0 TEXT AS ('\\'));
insert into t values ();
Expand All @@ -117,15 +117,15 @@ alter table t change a a int default 0.00;
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT '0'
`a` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
drop table if exists t;
create table t (a int default 1.25);
alter table t change a a int default 2.8;
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT '3'
`a` int DEFAULT '3'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
drop table if exists t;
create table t (a float default 1.25);
Expand Down Expand Up @@ -255,16 +255,16 @@ alter table test_rename_column rename column col1 to col1;
show create table test_rename_column;
Table Create Table
test_rename_column CREATE TABLE `test_rename_column` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`col1` int(11) DEFAULT NULL,
`id` int NOT NULL AUTO_INCREMENT,
`col1` int DEFAULT NULL,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
alter table test_rename_column rename column col1 to col2;
show create table test_rename_column;
Table Create Table
test_rename_column CREATE TABLE `test_rename_column` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`col2` int(11) DEFAULT NULL,
`id` int NOT NULL AUTO_INCREMENT,
`col2` int DEFAULT NULL,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
alter table test_rename_column rename column non_exist_col to col3;
Expand All @@ -277,15 +277,15 @@ alter table test_rename_column rename column col1 to col2;
show create table test_rename_column;
Table Create Table
test_rename_column CREATE TABLE `test_rename_column` (
`id` int(11) DEFAULT NULL,
`col2` int(11) GENERATED ALWAYS AS (`id` + 1) VIRTUAL
`id` int DEFAULT NULL,
`col2` int GENERATED ALWAYS AS (`id` + 1) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
alter table test_rename_column rename column col2 to col1;
show create table test_rename_column;
Table Create Table
test_rename_column CREATE TABLE `test_rename_column` (
`id` int(11) DEFAULT NULL,
`col1` int(11) GENERATED ALWAYS AS (`id` + 1) VIRTUAL
`id` int DEFAULT NULL,
`col1` int GENERATED ALWAYS AS (`id` + 1) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
alter table test_rename_column rename column id to id1;
Error 3108 (HY000): Column 'id' has a generated column dependency.
Expand All @@ -307,9 +307,9 @@ alter table test2 change c2 a int not null;
show create table test2;
Table Create Table
test2 CREATE TABLE `test2` (
`c1` int(11) DEFAULT NULL,
`a` int(11) NOT NULL,
`c3` int(11) DEFAULT '1',
`c1` int DEFAULT NULL,
`a` int NOT NULL,
`c3` int DEFAULT '1',
KEY `c1` (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
drop table if exists test2;
Expand Down
Loading