From a0ec8abe845402263444fee50947cbdae23623e0 Mon Sep 17 00:00:00 2001 From: davis zhen Date: Mon, 9 Dec 2024 15:38:37 +0800 Subject: [PATCH] fix show index (#20636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改show index 导致的navicat兼容性问题。 在8.0.30版本上,show index的expression字段 应该与 column name字段的值相同 Approved by: @ouyuanning, @badboynt1, @heni02 --- pkg/sql/plan/build_show.go | 2 +- .../cases/array/array_index.result | 46 +++--- test/distributed/cases/ddl/alter.result | 122 +++++++-------- test/distributed/cases/ddl/alter_table.result | 146 +++++++++--------- .../ddl/alter_table_change_column.result | 110 ++++++------- .../ddl/alter_table_modify_column.result | 94 +++++------ .../ddl/alter_table_rename_column.result | 12 +- .../cases/ddl/drop_if_exists.result | 6 +- .../cases/ddl/secondary_index_alter.result | 38 ++--- .../cases/ddl/secondary_index_create.result | 30 ++-- .../cases/ddl/secondary_index_delete.result | 16 +- .../cases/ddl/secondary_index_insert.result | 4 +- .../cases/ddl/secondary_index_master.result | 6 +- test/distributed/cases/ddl/table_kind.result | 58 +++---- .../cases/dml/show/IndexMetadata.result | 68 ++++---- test/distributed/cases/dml/show/show.result | 28 ++-- test/distributed/cases/dml/show/show6.result | 10 ++ test/distributed/cases/dml/show/show6.sql | 10 ++ test/distributed/cases/dtype/binary.result | Bin 43057 -> 43057 bytes .../optimistic/transaction_enhance.result | 2 +- .../alter_table.result | 4 +- .../transaction_enhance.result | 10 +- .../cases/query_result/query_result.result | 8 +- .../query_result/query_result_cloud.result | 8 +- .../system_variable/system_variables.result | 4 +- .../account_restricted.result | 8 +- 26 files changed, 435 insertions(+), 415 deletions(-) create mode 100644 test/distributed/cases/dml/show/show6.result create mode 100644 test/distributed/cases/dml/show/show6.sql diff --git a/pkg/sql/plan/build_show.go b/pkg/sql/plan/build_show.go index 41ae6e6d2d335..801d52514962e 100644 --- a/pkg/sql/plan/build_show.go +++ b/pkg/sql/plan/build_show.go @@ -841,7 +841,7 @@ func buildShowIndex(stmt *tree.ShowIndex, ctx CompilerContext) (*Plan, error) { "`idx`.`comment` as `Index_comment`, " + "`idx`.`algo_params` as `Index_params`, " + "if(`idx`.`is_visible` = 1, 'YES', 'NO') as `Visible`, " + - "'NULL' as `Expression` " + + "`idx`.`column_name` as `Expression` " + "from `%s`.`mo_indexes` `idx` left join `%s`.`mo_columns` `tcl` " + "on (`idx`.`table_id` = `tcl`.`att_relname_id` and `idx`.`column_name` = `tcl`.`attname`) " + "where `tcl`.`att_database` = '%s' AND " + diff --git a/test/distributed/cases/array/array_index.result b/test/distributed/cases/array/array_index.result index d2af4bd158e00..9e9e25d4c9a8a 100644 --- a/test/distributed/cases/array/array_index.result +++ b/test/distributed/cases/array/array_index.result @@ -74,11 +74,11 @@ insert into tbl values(8, "[130,40,90]"); create index idx1 using IVFFLAT on tbl(embedding) lists = 2 op_type 'vector_l2_ops'; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES embedding show index from tbl where Key_name = 'idx1'; table non_unique key_name seq_in_index column_name collation cardinality sub_part packed null index_type comment index_comment index_params visible expression -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) @@ -90,8 +90,8 @@ idx1 MULTIPLE embedding ivfflat entries {"lists":"2","op_type":"v alter table tbl alter reindex idx1 ivfflat lists=3; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` USING ivfflat (`embedding`) lists = 3 op_type 'vector_l2_ops' \n) @@ -103,8 +103,8 @@ idx1 MULTIPLE embedding ivfflat entries {"lists":"3","op_type":"v alter table tbl add c vecf32(3); show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES NULL -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES embedding +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n `c` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` USING ivfflat (`embedding`) lists = 3 op_type 'vector_l2_ops' \n) @@ -118,8 +118,8 @@ create table tbl(a int primary key,b vecf32(3), c vecf64(5)); create index idx2 using IVFFLAT on tbl(b) lists = 2 op_type 'vector_l2_ops'; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL -tbl 1 idx2 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a +tbl 1 idx2 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES b show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n `c` vecf64(5) DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx2` USING ivfflat (`b`) lists = 2 op_type 'vector_l2_ops' \n) @@ -162,8 +162,8 @@ insert into tbl values(8, "[130,40,90]"); create index idx8 using IVFFLAT on tbl(b) lists = 2 op_type 'vector_l2_ops'; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL -tbl 1 idx8 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a +tbl 1 idx8 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES b show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx8` USING ivfflat (`b`) lists = 2 op_type 'vector_l2_ops' \n) @@ -180,8 +180,8 @@ insert into tbl values(1, "[1,2,3]"); insert into tbl values(2, "[1,2,4]"); show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 1 idx10 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES NULL -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL +tbl 1 idx10 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES b +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx10` USING ivfflat (`b`) lists = 1 op_type 'vector_l2_ops' \n) @@ -193,7 +193,7 @@ idx10 MULTIPLE b ivfflat entries {"lists":"1","op_type":"vector_l alter table tbl drop column b; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n PRIMARY KEY (`a`)\n) @@ -205,8 +205,8 @@ insert into tbl values(1, "[1,2,3]"); insert into tbl values(2, "[1,2,4]"); show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 1 idx11 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES NULL -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL +tbl 1 idx11 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES b +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx11` USING ivfflat (`b`) lists = 1 op_type 'vector_l2_ops' \n) @@ -218,7 +218,7 @@ idx11 MULTIPLE b ivfflat entries {"lists":"1","op_type":"vector_l alter table tbl drop index idx11; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`a`)\n) @@ -237,8 +237,8 @@ insert into tbl values(8, "[130,40,90]"); create index idx12 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL -tbl 1 idx12 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id +tbl 1 idx12 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx12` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) @@ -260,9 +260,9 @@ insert into tbl values(8, 80, "[130,40,90]"); create index idx13 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL -tbl 0 PRIMARY 2 age A 0 NULL NULL YES NULL -tbl 1 idx13 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id +tbl 0 PRIMARY 2 age A 0 NULL NULL YES age +tbl 1 idx13 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `age` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`,`age`),\n KEY `idx13` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) @@ -284,7 +284,7 @@ insert into tbl values(8, "[130,40,90]"); create index idx14 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 1 idx14 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 1 idx14 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int DEFAULT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n KEY `idx14` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) diff --git a/test/distributed/cases/ddl/alter.result b/test/distributed/cases/ddl/alter.result index 3eded851574b6..0b2f5317ec802 100644 --- a/test/distributed/cases/ddl/alter.result +++ b/test/distributed/cases/ddl/alter.result @@ -157,18 +157,18 @@ drop table if exists index01; create table index01(col1 int,key key1(col1)); show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 1 key1 1 col1 A 0 NULL NULL YES YES NULL +index01 1 key1 1 col1 A 0 NULL NULL YES YES col1 alter table index01 drop index key1; show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression alter table Index01 add index key1(col1) comment 'test'; show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 1 key1 1 col1 A 0 NULL NULL YES test YES NULL +index01 1 key1 1 col1 A 0 NULL NULL YES test YES col1 alter table index01 alter index key1 invisible; show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 1 key1 1 col1 A 0 NULL NULL YES test NO NULL +index01 1 key1 1 col1 A 0 NULL NULL YES test NO col1 drop table index01; drop table if exists index02; create table index02(col1 int,key key1(col1) comment 'test'); @@ -179,26 +179,26 @@ alter table index02 add index Key1(col1); alter table index02 alter index key1 invisible; show index from index02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index02 1 key1 1 col1 A 0 NULL NULL YES NO NULL +index02 1 key1 1 col1 A 0 NULL NULL YES NO col1 drop table index02; drop table if exists index03; create table index03(col1 int, col2 int, col3 int); alter table index03 add unique key(col1,col2) comment 'abcTest'; show index from index03; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index03 0 col1 1 col1 A 0 NULL NULL YES abcTest YES NULL -index03 0 col1 2 col2 A 0 NULL NULL YES abcTest YES NULL +index03 0 col1 1 col1 A 0 NULL NULL YES abcTest YES col1 +index03 0 col1 2 col2 A 0 NULL NULL YES abcTest YES col2 alter table index03 alter index col1 invisible; show index from index03; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index03 0 col1 1 col1 A 0 NULL NULL YES abcTest NO NULL -index03 0 col1 2 col2 A 0 NULL NULL YES abcTest NO NULL +index03 0 col1 1 col1 A 0 NULL NULL YES abcTest NO col1 +index03 0 col1 2 col2 A 0 NULL NULL YES abcTest NO col2 drop table index03; drop table if exists index03; create table index03(fld1 int, key key1(fld1) comment 'test'); show index from index03; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index03 1 key1 1 fld1 A 0 NULL NULL YES test YES NULL +index03 1 key1 1 fld1 A 0 NULL NULL YES test YES fld1 alter table index03 drop index key1; show index from index03; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression @@ -207,21 +207,21 @@ drop table if exists index04; create table index04(col1 int, col2 char, col3 varchar(10),primary key(col1,col2)); show index from index04; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index04 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index04 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL +index04 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index04 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 alter table index04 add index(col1); alter table index04 alter index col1 invisible; show index from index04; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index04 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index04 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -index04 1 col1 1 col1 A 0 NULL NULL NO NULL +index04 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index04 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +index04 1 col1 1 col1 A 0 NULL NULL NO col1 alter table index04 alter index col1 visible; show index from index04; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index04 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index04 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -index04 1 col1 1 col1 A 0 NULL NULL YES NULL +index04 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index04 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +index04 1 col1 1 col1 A 0 NULL NULL YES col1 drop table index04; drop table if exists index05; create table index05(col1 int, col2 bigint, col3 decimal); @@ -230,26 +230,26 @@ Table Non_unique Key_name Seq_in_index Column_name Collation C alter table index05 add unique key(col1,col2); show index from index05; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index05 0 col1 1 col1 A 0 NULL NULL YES YES NULL -index05 0 col1 2 col2 A 0 NULL NULL YES YES NULL +index05 0 col1 1 col1 A 0 NULL NULL YES YES col1 +index05 0 col1 2 col2 A 0 NULL NULL YES YES col2 alter table index05 alter index col1 invisible; show index from index05; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index05 0 col1 1 col1 A 0 NULL NULL YES NO NULL -index05 0 col1 2 col2 A 0 NULL NULL YES NO NULL +index05 0 col1 1 col1 A 0 NULL NULL YES NO col1 +index05 0 col1 2 col2 A 0 NULL NULL YES NO col2 drop table index05; drop table if exists index06; create table index06(col1 int not null,col2 binary, col3 float,unique key(col1)); alter table index06 add unique index(col2); show index from index06; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index06 0 col1 1 col1 A 0 NULL NULL YES NULL -index06 0 col2 1 col2 A 0 NULL NULL YES YES NULL +index06 0 col1 1 col1 A 0 NULL NULL YES col1 +index06 0 col2 1 col2 A 0 NULL NULL YES YES col2 alter table index06 alter index col2 invisible; show index from index06; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index06 0 col1 1 col1 A 0 NULL NULL YES NULL -index06 0 col2 1 col2 A 0 NULL NULL YES NO NULL +index06 0 col1 1 col1 A 0 NULL NULL YES col1 +index06 0 col2 1 col2 A 0 NULL NULL YES NO col2 drop table index06; drop table if exists index07; CREATE TABLE index07( @@ -267,36 +267,36 @@ alter table index07 add constraint unique key wwwww (col3, col4); alter table index07 add constraint abctestabbc unique key zxxxxx (col3); show index from index07; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index07 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index07 0 col3 1 col3 A 0 NULL NULL YES NULL -index07 0 col3 2 col4 A 0 NULL NULL YES NULL -index07 0 wwwww 1 col3 A 0 NULL NULL YES NULL -index07 0 wwwww 2 col4 A 0 NULL NULL YES NULL -index07 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL +index07 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index07 0 col3 1 col3 A 0 NULL NULL YES col3 +index07 0 col3 2 col4 A 0 NULL NULL YES col4 +index07 0 wwwww 1 col3 A 0 NULL NULL YES col3 +index07 0 wwwww 2 col4 A 0 NULL NULL YES col4 +index07 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 alter table index07 add unique key idx1(col3); show index from index07; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index07 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index07 0 col3 1 col3 A 0 NULL NULL YES NULL -index07 0 col3 2 col4 A 0 NULL NULL YES NULL -index07 0 wwwww 1 col3 A 0 NULL NULL YES NULL -index07 0 wwwww 2 col4 A 0 NULL NULL YES NULL -index07 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL -index07 0 idx1 1 col3 A 0 NULL NULL YES NULL +index07 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index07 0 col3 1 col3 A 0 NULL NULL YES col3 +index07 0 col3 2 col4 A 0 NULL NULL YES col4 +index07 0 wwwww 1 col3 A 0 NULL NULL YES col3 +index07 0 wwwww 2 col4 A 0 NULL NULL YES col4 +index07 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 +index07 0 idx1 1 col3 A 0 NULL NULL YES col3 alter table index07 add constraint idx2 unique key (col3); alter table index07 add constraint idx2 unique key (col4); duplicate key name 'idx2' alter table index07 alter index wwwww invisible; show index from index07; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index07 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index07 0 col3 1 col3 A 0 NULL NULL YES NULL -index07 0 col3 2 col4 A 0 NULL NULL YES NULL -index07 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL -index07 0 idx1 1 col3 A 0 NULL NULL YES NULL -index07 0 idx2 1 col3 A 0 NULL NULL YES NULL -index07 0 wwwww 1 col3 A 0 NULL NULL NO NULL -index07 0 wwwww 2 col4 A 0 NULL NULL NO NULL +index07 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index07 0 col3 1 col3 A 0 NULL NULL YES col3 +index07 0 col3 2 col4 A 0 NULL NULL YES col4 +index07 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 +index07 0 idx1 1 col3 A 0 NULL NULL YES col3 +index07 0 idx2 1 col3 A 0 NULL NULL YES col3 +index07 0 wwwww 1 col3 A 0 NULL NULL NO col3 +index07 0 wwwww 2 col4 A 0 NULL NULL NO col4 drop table index07; drop table if exists index08; CREATE TABLE index08( @@ -314,18 +314,18 @@ SQL parser error: You have an error in your SQL syntax; check the manual that co alter table index08 add constraint unique index zxxxxx (col3); show index from index08; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index08 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index08 0 col3 1 col3 A 0 NULL NULL YES NULL -index08 0 col3 2 col4 A 0 NULL NULL YES NULL -index08 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL +index08 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index08 0 col3 1 col3 A 0 NULL NULL YES col3 +index08 0 col3 2 col4 A 0 NULL NULL YES col4 +index08 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 alter table index08 add index zxxxx(col3); show index from index08; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index08 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -index08 0 col3 1 col3 A 0 NULL NULL YES NULL -index08 0 col3 2 col4 A 0 NULL NULL YES NULL -index08 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL -index08 1 zxxxx 1 col3 A 0 NULL NULL YES NULL +index08 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +index08 0 col3 1 col3 A 0 NULL NULL YES col3 +index08 0 col3 2 col4 A 0 NULL NULL YES col4 +index08 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 +index08 1 zxxxx 1 col3 A 0 NULL NULL YES col3 drop table index08; drop table if exists index09; CREATE TABLE index09( @@ -339,12 +339,12 @@ insert into index09 values(1, '1980-12-17','Abby', 21); insert into index09 values(2, '1981-02-20','Bob', 22); show index from index09; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index09 0 u1 1 col1 A 0 NULL NULL YES NULL +index09 0 u1 1 col1 A 0 NULL NULL YES col1 ALTER TABLE emp ADD UNIQUE INDEX idx1 (col1 ASC, col2 DESC); no such table test.emp show index from index09; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index09 0 u1 1 col1 A 0 NULL NULL YES NULL +index09 0 u1 1 col1 A 0 NULL NULL YES col1 drop table index09; drop table if exists index10; CREATE TABLE index10( @@ -359,14 +359,14 @@ insert into index10 values(1, '1980-12-17','Abby', 21); insert into index10 values(2, '1981-02-20','Bob', 22); show index from index10; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index10 1 idx1 1 col1 A 0 NULL NULL YES NULL -index10 1 idx2 1 col2 A 0 NULL NULL YES NULL +index10 1 idx1 1 col1 A 0 NULL NULL YES col1 +index10 1 idx2 1 col2 A 0 NULL NULL YES col2 ALTER TABLE emp ADD INDEX idx3 (col1 ASC, col2 DESC); no such table test.emp show index from index10; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index10 1 idx1 1 col1 A 0 NULL NULL YES NULL -index10 1 idx2 1 col2 A 0 NULL NULL YES NULL +index10 1 idx1 1 col1 A 0 NULL NULL YES col1 +index10 1 idx2 1 col2 A 0 NULL NULL YES col2 drop table index10; CREATE TABLE `t2` ( `a` INT DEFAULT NULL diff --git a/test/distributed/cases/ddl/alter_table.result b/test/distributed/cases/ddl/alter_table.result index f6dabbe7157ae..84eeced022289 100644 --- a/test/distributed/cases/ddl/alter_table.result +++ b/test/distributed/cases/ddl/alter_table.result @@ -57,9 +57,9 @@ insert into t1 values(7, '1981-05-01','green', 26); Duplicate entry ('\(\d{4}-\d{2}-\d{2},\w{5}\)'|'\d{5}\w\d{17}\w\d{2}') for key '(.*)' show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t1 0 idx1 1 col2 A 0 NULL NULL YES NULL -t1 0 idx1 2 col3 A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t1 0 idx1 1 col2 A 0 NULL NULL YES col2 +t1 0 idx1 2 col3 A 0 NULL NULL YES col3 select * from t1; col1 col2 col3 col4 1 1980-12-17 Abby 21 @@ -71,35 +71,35 @@ col1 col2 col3 col4 alter table t1 alter index idx1 invisible; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t1 0 idx1 1 col2 A 0 NULL NULL NO NULL -t1 0 idx1 2 col3 A 0 NULL NULL NO NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t1 0 idx1 1 col2 A 0 NULL NULL NO col2 +t1 0 idx1 2 col3 A 0 NULL NULL NO col3 alter table t1 alter index idx1 visible; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t1 0 idx1 1 col2 A 0 NULL NULL YES NULL -t1 0 idx1 2 col3 A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t1 0 idx1 1 col2 A 0 NULL NULL YES col2 +t1 0 idx1 2 col3 A 0 NULL NULL YES col3 ALTER TABLE t1 DROP INDEX idx1; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 ALTER TABLE t1 ADD UNIQUE INDEX idx2 (col2, col3); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t1 0 idx2 1 col2 A 0 NULL NULL YES NULL -t1 0 idx2 2 col3 A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t1 0 idx2 1 col2 A 0 NULL NULL YES col2 +t1 0 idx2 2 col3 A 0 NULL NULL YES col3 alter table t1 alter index idx2 invisible; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t1 0 idx2 1 col2 A 0 NULL NULL NO NULL -t1 0 idx2 2 col3 A 0 NULL NULL NO NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t1 0 idx2 1 col2 A 0 NULL NULL NO col2 +t1 0 idx2 2 col3 A 0 NULL NULL NO col3 ALTER TABLE t1 DROP INDEX idx2; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 drop table t1; drop table if exists t2; CREATE TABLE t2( @@ -118,13 +118,13 @@ insert into t2 values(6, '1981-05-01','green', 26); ALTER TABLE t2 ADD INDEX index1 (col2); show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t2 1 index1 1 col2 A 0 NULL NULL YES NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t2 1 index1 1 col2 A 0 NULL NULL YES col2 alter table t2 alter index index1 invisible; show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t2 1 index1 1 col2 A 0 NULL NULL NO NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t2 1 index1 1 col2 A 0 NULL NULL NO col2 select * from t2; col1 col2 col3 col4 1 1980-12-17 Abby 21 @@ -136,23 +136,23 @@ col1 col2 col3 col4 ALTER TABLE t2 DROP INDEX index1; show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 ALTER TABLE t2 ADD INDEX index2 (col2,col3); show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t2 1 index2 1 col2 A 0 NULL NULL YES NULL -t2 1 index2 2 col3 A 0 NULL NULL YES NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t2 1 index2 1 col2 A 0 NULL NULL YES col2 +t2 1 index2 2 col3 A 0 NULL NULL YES col3 alter table t2 alter index index2 invisible; show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t2 1 index2 1 col2 A 0 NULL NULL NO NULL -t2 1 index2 2 col3 A 0 NULL NULL NO NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t2 1 index2 1 col2 A 0 NULL NULL NO col2 +t2 1 index2 2 col3 A 0 NULL NULL NO col3 ALTER TABLE t2 DROP INDEX index2; show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 drop table t2; drop table if exists t3; CREATE TABLE t3( @@ -171,15 +171,15 @@ insert into t3 values(6, '1981-05-01','green', 26); ALTER TABLE t3 ADD INDEX index1 (col2); show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -t3 1 index1 1 col2 A 0 NULL NULL YES NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +t3 1 index1 1 col2 A 0 NULL NULL YES col2 alter table t3 alter index index1 invisible; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -t3 1 index1 1 col2 A 0 NULL NULL NO NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +t3 1 index1 1 col2 A 0 NULL NULL NO col2 select * from t3; col1 col2 col3 col4 1 1980-12-17 Abby 21 @@ -191,34 +191,34 @@ col1 col2 col3 col4 ALTER TABLE t3 DROP INDEX index1; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 ALTER TABLE t3 ADD UNIQUE INDEX index2 (col2,col3); show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -t3 0 index2 1 col2 A 0 NULL NULL YES NULL -t3 0 index2 2 col3 A 0 NULL NULL YES NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +t3 0 index2 1 col2 A 0 NULL NULL YES col2 +t3 0 index2 2 col3 A 0 NULL NULL YES col3 alter table t3 alter index index2 invisible; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -t3 0 index2 1 col2 A 0 NULL NULL NO NULL -t3 0 index2 2 col3 A 0 NULL NULL NO NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +t3 0 index2 1 col2 A 0 NULL NULL NO col2 +t3 0 index2 2 col3 A 0 NULL NULL NO col3 ALTER TABLE t3 DROP INDEX index2; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 create unique index idx3 on t3(col2,col3); show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t3 0 PRIMARY 2 col2 A 0 NULL NULL YES NULL -t3 0 idx3 1 col2 A 0 NULL NULL YES NULL -t3 0 idx3 2 col3 A 0 NULL NULL YES NULL +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t3 0 PRIMARY 2 col2 A 0 NULL NULL YES col2 +t3 0 idx3 1 col2 A 0 NULL NULL YES col2 +t3 0 idx3 2 col3 A 0 NULL NULL YES col3 drop table t3; drop table if exists t4; CREATE TABLE t4( @@ -242,12 +242,12 @@ alter table t4 add constraint idx_6dotkott2kjsp8vw4d0m25fb7 index zxxxxx (col3); SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 65 near " index zxxxxx (col3);"; show index from t4; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t4 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t4 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 alter table t4 add index zxxxxx(col3); show index from t4; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t4 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t4 1 zxxxxx 1 col3 A 0 NULL NULL YES NULL +t4 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t4 1 zxxxxx 1 col3 A 0 NULL NULL YES col3 drop table t4; drop table if exists t5; CREATE TABLE t5( @@ -268,34 +268,34 @@ alter table t5 add constraint unique key wwwww (col3, col4); alter table t5 add constraint idx_6dotkott2kjsp8vw4d0m25fb7 unique key zxxxxx (col3); show index from t5; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t5 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t5 0 col3 1 col3 A 0 NULL NULL YES NULL -t5 0 col3 2 col4 A 0 NULL NULL YES NULL -t5 0 wwwww 1 col3 A 0 NULL NULL YES NULL -t5 0 wwwww 2 col4 A 0 NULL NULL YES NULL -t5 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL +t5 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t5 0 col3 1 col3 A 0 NULL NULL YES col3 +t5 0 col3 2 col4 A 0 NULL NULL YES col4 +t5 0 wwwww 1 col3 A 0 NULL NULL YES col3 +t5 0 wwwww 2 col4 A 0 NULL NULL YES col4 +t5 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 alter table t5 add unique key zxxxxx(col3); duplicate key name 'zxxxxx' show index from t5; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t5 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t5 0 col3 1 col3 A 0 NULL NULL YES NULL -t5 0 col3 2 col4 A 0 NULL NULL YES NULL -t5 0 wwwww 1 col3 A 0 NULL NULL YES NULL -t5 0 wwwww 2 col4 A 0 NULL NULL YES NULL -t5 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL +t5 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t5 0 col3 1 col3 A 0 NULL NULL YES col3 +t5 0 col3 2 col4 A 0 NULL NULL YES col4 +t5 0 wwwww 1 col3 A 0 NULL NULL YES col3 +t5 0 wwwww 2 col4 A 0 NULL NULL YES col4 +t5 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 alter table t5 add constraint idx_6dotkott2kjsp8v unique key (col3); alter table t5 add constraint idx_6dotkott2kjsp8v unique key (col4); duplicate key name 'idx_6dotkott2kjsp8v' show index from t5; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t5 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t5 0 col3 1 col3 A 0 NULL NULL YES NULL -t5 0 col3 2 col4 A 0 NULL NULL YES NULL -t5 0 wwwww 1 col3 A 0 NULL NULL YES NULL -t5 0 wwwww 2 col4 A 0 NULL NULL YES NULL -t5 0 zxxxxx 1 col3 A 0 NULL NULL YES NULL -t5 0 idx_6dotkott2kjsp8v 1 col3 A 0 NULL NULL YES NULL +t5 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t5 0 col3 1 col3 A 0 NULL NULL YES col3 +t5 0 col3 2 col4 A 0 NULL NULL YES col4 +t5 0 wwwww 1 col3 A 0 NULL NULL YES col3 +t5 0 wwwww 2 col4 A 0 NULL NULL YES col4 +t5 0 zxxxxx 1 col3 A 0 NULL NULL YES col3 +t5 0 idx_6dotkott2kjsp8v 1 col3 A 0 NULL NULL YES col3 drop table t5; create table t5(a int); alter table t5 comment = "comment_1"; diff --git a/test/distributed/cases/ddl/alter_table_change_column.result b/test/distributed/cases/ddl/alter_table_change_column.result index 645c941ccf05e..5d2469e65292a 100644 --- a/test/distributed/cases/ddl/alter_table_change_column.result +++ b/test/distributed/cases/ddl/alter_table_change_column.result @@ -272,9 +272,9 @@ a b c d alter table t1 change b x VARCHAR(20); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 x A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 x A 0 NULL NULL YES YES x +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -289,10 +289,10 @@ a x c d alter table t1 change x y VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 y A 0 NULL NULL YES YES NULL -t1 0 y 1 y A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 y A 0 NULL NULL YES YES y +t1 0 y 1 y A 0 NULL NULL YES YES y +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -307,11 +307,11 @@ a y c d alter table t1 change y z VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 z A 0 NULL NULL YES YES NULL -t1 0 y 1 z A 0 NULL NULL YES YES NULL -t1 0 z 1 z A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 z A 0 NULL NULL YES YES z +t1 0 y 1 z A 0 NULL NULL YES YES z +t1 0 z 1 z A 0 NULL NULL YES YES z +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -342,9 +342,9 @@ a b c d alter table t1 rename column a to x; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 x A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 x A 0 NULL NULL YES NULL +t1 0 a 1 x A 0 NULL NULL YES x +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 x A 0 NULL NULL YES x desc t1; Field Type Null Key Default Extra Comment x INT(32) NO PRI null @@ -359,9 +359,9 @@ x b c d alter table t1 rename column b to y; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 x A 0 NULL NULL YES NULL -t1 0 a 2 y A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 x A 0 NULL NULL YES NULL +t1 0 a 1 x A 0 NULL NULL YES x +t1 0 a 2 y A 0 NULL NULL YES YES y +t1 0 PRIMARY 1 x A 0 NULL NULL YES x desc t1; Field Type Null Key Default Extra Comment x INT(32) NO PRI null @@ -392,10 +392,10 @@ a b c d alter table t1 change c x datetime; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 a 1 a A 0 NULL NULL YES NULL -t1 1 a 2 b A 0 NULL NULL YES YES NULL -t1 1 c 1 x A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 1 a 1 a A 0 NULL NULL YES a +t1 1 a 2 b A 0 NULL NULL YES YES b +t1 1 c 1 x A 0 NULL NULL YES YES x +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -412,11 +412,11 @@ Multiple primary key defined alter table t1 change x y VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 y 1 y A 0 NULL NULL YES YES NULL -t1 1 a 1 a A 0 NULL NULL YES NULL -t1 1 a 2 b A 0 NULL NULL YES YES NULL -t1 1 c 1 y A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 y 1 y A 0 NULL NULL YES YES y +t1 1 a 1 a A 0 NULL NULL YES a +t1 1 a 2 b A 0 NULL NULL YES YES b +t1 1 c 1 y A 0 NULL NULL YES YES y +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -645,9 +645,9 @@ a b c d alter table t1 alter column a set default 100; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI 100 @@ -662,9 +662,9 @@ a b c d alter table t1 alter column a drop default; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -679,9 +679,9 @@ a b c d alter table t1 alter column b set visible; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -712,9 +712,9 @@ a b c d alter table t1 alter column c set default '2003-12-17'; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -729,9 +729,9 @@ a b c d alter table t1 alter column c drop default; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -746,9 +746,9 @@ a b c d alter table t1 alter column b set invisible; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -1353,14 +1353,14 @@ Table Create Table index01 CREATE TABLE `index01` (\n `a` int NOT NULL,\n `bNew` varchar(20) DEFAULT NULL,\n `c` date DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n UNIQUE KEY `a` (`a`,`bNew`)\n) show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 0 a 1 a A 0 NULL NULL YES NULL -index01 0 a 2 bNew A 0 NULL NULL YES YES NULL +index01 0 a 1 a A 0 NULL NULL YES a +index01 0 a 2 bNew A 0 NULL NULL YES YES bNew alter table index01 change bNew bNewNew VARCHAR(20) UNIQUE KEY; show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 0 a 1 a A 0 NULL NULL YES NULL -index01 0 a 2 bNewNew A 0 NULL NULL YES YES NULL -index01 0 bnewnew 1 bNewNew A 0 NULL NULL YES YES NULL +index01 0 a 1 a A 0 NULL NULL YES a +index01 0 a 2 bNewNew A 0 NULL NULL YES YES bNewNew +index01 0 bnewnew 1 bNewNew A 0 NULL NULL YES YES bNewNew show create table index01; Table Create Table index01 CREATE TABLE `index01` (\n `a` int NOT NULL,\n `bNewNew` varchar(20) DEFAULT NULL,\n `c` date DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n UNIQUE KEY `a` (`a`,`bNewNew`),\n UNIQUE KEY `bnewnew` (`bNewNew`)\n) @@ -1412,11 +1412,11 @@ index02 CREATE TABLE `index02` (\n `a` int NOT NULL,\n `b` char(10) DEFAULT alter table index02 change b bnewNew VARCHAR(20) UNIQUE KEY; show index from index02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index02 0 bnewnew 1 bnewNew A 0 NULL NULL YES YES NULL -index02 1 a 1 a A 0 NULL NULL YES NULL -index02 1 a 2 bnewNew A 0 NULL NULL YES YES NULL -index02 1 c 1 c A 0 NULL NULL YES YES NULL -index02 0 PRIMARY 1 a A 0 NULL NULL YES NULL +index02 0 bnewnew 1 bnewNew A 0 NULL NULL YES YES bnewNew +index02 1 a 1 a A 0 NULL NULL YES a +index02 1 a 2 bnewNew A 0 NULL NULL YES YES bnewNew +index02 1 c 1 c A 0 NULL NULL YES YES c +index02 0 PRIMARY 1 a A 0 NULL NULL YES a show create table index02; Table Create Table index02 CREATE TABLE `index02` (\n `a` int NOT NULL,\n `bnewNew` varchar(20) DEFAULT NULL,\n `c` date DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n PRIMARY KEY (`a`),\n UNIQUE KEY `bnewnew` (`bnewNew`),\n KEY `a` (`a`,`bnewNew`),\n KEY `c` (`c`)\n) diff --git a/test/distributed/cases/ddl/alter_table_modify_column.result b/test/distributed/cases/ddl/alter_table_modify_column.result index accd772f34aed..74972b7fb1b33 100644 --- a/test/distributed/cases/ddl/alter_table_modify_column.result +++ b/test/distributed/cases/ddl/alter_table_modify_column.result @@ -259,24 +259,24 @@ a b c d alter table t1 modify b VARCHAR(20); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a alter table t1 modify b VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 b 1 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 b 1 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a alter table t1 modify b VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 a 1 a A 0 NULL NULL YES NULL -t1 0 a 2 b A 0 NULL NULL YES YES NULL -t1 0 b 1 b A 0 NULL NULL YES YES NULL -t1 0 b_2 1 b A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 a 1 a A 0 NULL NULL YES a +t1 0 a 2 b A 0 NULL NULL YES YES b +t1 0 b 1 b A 0 NULL NULL YES YES b +t1 0 b_2 1 b A 0 NULL NULL YES YES b +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -307,29 +307,29 @@ a b c d alter table t1 modify b VARCHAR(20); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 a 1 a A 0 NULL NULL YES NULL -t1 1 a 2 b A 0 NULL NULL YES YES NULL -t1 1 c 1 c A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 1 a 1 a A 0 NULL NULL YES a +t1 1 a 2 b A 0 NULL NULL YES YES b +t1 1 c 1 c A 0 NULL NULL YES YES c +t1 0 PRIMARY 1 a A 0 NULL NULL YES a alter table t1 modify b VARCHAR(20) KEY; Multiple primary key defined alter table t1 modify b VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 b 1 b A 0 NULL NULL YES YES NULL -t1 1 a 1 a A 0 NULL NULL YES NULL -t1 1 a 2 b A 0 NULL NULL YES YES NULL -t1 1 c 1 c A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 b 1 b A 0 NULL NULL YES YES b +t1 1 a 1 a A 0 NULL NULL YES a +t1 1 a 2 b A 0 NULL NULL YES YES b +t1 1 c 1 c A 0 NULL NULL YES YES c +t1 0 PRIMARY 1 a A 0 NULL NULL YES a alter table t1 modify c VARCHAR(20) UNIQUE KEY; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 b 1 b A 0 NULL NULL YES YES NULL -t1 0 c_2 1 c A 0 NULL NULL YES YES NULL -t1 1 a 1 a A 0 NULL NULL YES NULL -t1 1 a 2 b A 0 NULL NULL YES YES NULL -t1 1 c 1 c A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t1 0 b 1 b A 0 NULL NULL YES YES b +t1 0 c_2 1 c A 0 NULL NULL YES YES c +t1 1 a 1 a A 0 NULL NULL YES a +t1 1 a 2 b A 0 NULL NULL YES YES b +t1 1 c 1 c A 0 NULL NULL YES YES c +t1 0 PRIMARY 1 a A 0 NULL NULL YES a desc t1; Field Type Null Key Default Extra Comment a INT(32) NO PRI null @@ -951,14 +951,14 @@ Table Create Table index01 CREATE TABLE `index01` (\n `a` int NOT NULL,\n `b` varchar(20) DEFAULT NULL,\n `c` date DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n UNIQUE KEY `a` (`a`,`b`)\n) show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 0 a 1 a A 0 NULL NULL YES NULL -index01 0 a 2 b A 0 NULL NULL YES YES NULL +index01 0 a 1 a A 0 NULL NULL YES a +index01 0 a 2 b A 0 NULL NULL YES YES b alter table index01 modify b VARCHAR(20) UNIQUE KEY; show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 0 a 1 a A 0 NULL NULL YES NULL -index01 0 a 2 b A 0 NULL NULL YES YES NULL -index01 0 b 1 b A 0 NULL NULL YES YES NULL +index01 0 a 1 a A 0 NULL NULL YES a +index01 0 a 2 b A 0 NULL NULL YES YES b +index01 0 b 1 b A 0 NULL NULL YES YES b show create table index01; Table Create Table index01 CREATE TABLE `index01` (\n `a` int NOT NULL,\n `b` varchar(20) DEFAULT NULL,\n `c` date DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n UNIQUE KEY `a` (`a`,`b`),\n UNIQUE KEY `b` (`b`)\n) @@ -987,10 +987,10 @@ a b c d alter table index02 modify b VARCHAR(20); show index from index02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index02 1 a 1 a A 0 NULL NULL YES NULL -index02 1 a 2 b A 0 NULL NULL YES YES NULL -index02 1 c 1 c A 0 NULL NULL YES YES NULL -index02 0 PRIMARY 1 a A 0 NULL NULL YES NULL +index02 1 a 1 a A 0 NULL NULL YES a +index02 1 a 2 b A 0 NULL NULL YES YES b +index02 1 c 1 c A 0 NULL NULL YES YES c +index02 0 PRIMARY 1 a A 0 NULL NULL YES a alter table index02 modify b VARCHAR(20) KEY; Multiple primary key defined show create table index02; @@ -999,20 +999,20 @@ index02 CREATE TABLE `index02` (\n `a` int NOT NULL,\n `b` varchar(20) DEFA alter table index02 modify b VARCHAR(20) UNIQUE KEY; show index from index02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index02 0 b 1 b A 0 NULL NULL YES YES NULL -index02 1 a 1 a A 0 NULL NULL YES NULL -index02 1 a 2 b A 0 NULL NULL YES YES NULL -index02 1 c 1 c A 0 NULL NULL YES YES NULL -index02 0 PRIMARY 1 a A 0 NULL NULL YES NULL +index02 0 b 1 b A 0 NULL NULL YES YES b +index02 1 a 1 a A 0 NULL NULL YES a +index02 1 a 2 b A 0 NULL NULL YES YES b +index02 1 c 1 c A 0 NULL NULL YES YES c +index02 0 PRIMARY 1 a A 0 NULL NULL YES a alter table index02 modify c VARCHAR(20) UNIQUE KEY; show index from index02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index02 0 b 1 b A 0 NULL NULL YES YES NULL -index02 0 c_2 1 c A 0 NULL NULL YES YES NULL -index02 1 a 1 a A 0 NULL NULL YES NULL -index02 1 a 2 b A 0 NULL NULL YES YES NULL -index02 1 c 1 c A 0 NULL NULL YES YES NULL -index02 0 PRIMARY 1 a A 0 NULL NULL YES NULL +index02 0 b 1 b A 0 NULL NULL YES YES b +index02 0 c_2 1 c A 0 NULL NULL YES YES c +index02 1 a 1 a A 0 NULL NULL YES a +index02 1 a 2 b A 0 NULL NULL YES YES b +index02 1 c 1 c A 0 NULL NULL YES YES c +index02 0 PRIMARY 1 a A 0 NULL NULL YES a show create table index02; Table Create Table index02 CREATE TABLE `index02` (\n `a` int NOT NULL,\n `b` varchar(20) DEFAULT NULL,\n `c` varchar(20) DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n PRIMARY KEY (`a`),\n UNIQUE KEY `b` (`b`),\n UNIQUE KEY `c_2` (`c`),\n KEY `a` (`a`,`b`),\n KEY `c` (`c`)\n) diff --git a/test/distributed/cases/ddl/alter_table_rename_column.result b/test/distributed/cases/ddl/alter_table_rename_column.result index 5197b52343bea..931218ed291c7 100644 --- a/test/distributed/cases/ddl/alter_table_rename_column.result +++ b/test/distributed/cases/ddl/alter_table_rename_column.result @@ -300,8 +300,8 @@ Table Create Table index01 CREATE TABLE `index01` (\n `a` int NOT NULL,\n `bNew` char(10) DEFAULT NULL,\n `c` date DEFAULT NULL,\n `d` decimal(7,2) DEFAULT NULL,\n UNIQUE KEY `a` (`a`,`bNew`)\n) show index from index01; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index01 0 a 1 a A 0 NULL NULL YES NULL -index01 0 a 2 bNew A 0 NULL NULL YES YES NULL +index01 0 a 1 a A 0 NULL NULL YES a +index01 0 a 2 bNew A 0 NULL NULL YES YES bNew insert into index01 (a, b, c, d) values (5, 'bh', '1999-01-01', 3000); Unknown column 'b' in 'index01' insert into index01 (a, bnew, c, d) values (5, 'bh', '1999-01-01', 3000); @@ -363,10 +363,10 @@ a bnewnew c d 3 database 1981-02-22 500.00 show index from index02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -index02 1 a 1 a A 0 NULL NULL YES NULL -index02 1 a 2 bNewNew A 0 NULL NULL YES YES NULL -index02 1 c 1 c A 0 NULL NULL YES YES NULL -index02 0 PRIMARY 1 a A 0 NULL NULL YES NULL +index02 1 a 1 a A 0 NULL NULL YES a +index02 1 a 2 bNewNew A 0 NULL NULL YES YES bNewNew +index02 1 c 1 c A 0 NULL NULL YES YES c +index02 0 PRIMARY 1 a A 0 NULL NULL YES a show columns from index02; Field Type Null Key Default Extra Comment a INT(32) NO PRI null diff --git a/test/distributed/cases/ddl/drop_if_exists.result b/test/distributed/cases/ddl/drop_if_exists.result index d676ad4507630..0874575c14a7c 100644 --- a/test/distributed/cases/ddl/drop_if_exists.result +++ b/test/distributed/cases/ddl/drop_if_exists.result @@ -21,8 +21,8 @@ unique index idx1(ename) ); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 idx1 1 ename A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 empno A 0 NULL NULL YES NULL +t1 0 idx1 1 ename A 0 NULL NULL YES YES ename +t1 0 PRIMARY 1 empno A 0 NULL NULL YES empno create view v1 as select * from t1; show tables; Tables_in_db1 @@ -38,7 +38,7 @@ use db1; drop index if exists idx1 on t1; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 empno A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 empno A 0 NULL NULL YES empno drop view if exists v1; drop table if exists t1; show tables; diff --git a/test/distributed/cases/ddl/secondary_index_alter.result b/test/distributed/cases/ddl/secondary_index_alter.result index 297f76fdf493b..be6ed36051521 100644 --- a/test/distributed/cases/ddl/secondary_index_alter.result +++ b/test/distributed/cases/ddl/secondary_index_alter.result @@ -9,8 +9,8 @@ a Abby 24 b Deb 26 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx1 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx1 1 name A 0 NULL NULL YES YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` varchar(20) NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` (`name`)\n) @@ -23,9 +23,9 @@ update t1 set id2 = id; ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (id, id2); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 idx1 1 name A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 0 PRIMARY 2 id2 A 0 NULL NULL YES NULL +t1 1 idx1 1 name A 0 NULL NULL YES YES name +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 0 PRIMARY 2 id2 A 0 NULL NULL YES id2 show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` varchar(20) NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n `id2` varchar(20) NOT NULL,\n PRIMARY KEY (`id`,`id2`),\n KEY `idx1` (`name`)\n) @@ -42,8 +42,8 @@ name VARCHAR(255) YES MUL null age INT(32) YES null show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 idx1 1 name A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL +t1 1 idx1 1 name A 0 NULL NULL YES YES name +t1 0 PRIMARY 1 id A 0 NULL NULL YES id show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` varchar(20) NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` (`name`)\n) @@ -58,8 +58,8 @@ insert into t1 values(1,"Abby", 24); insert into t1 values(2,"Dora", 25); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx2 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx2 1 name A 0 NULL NULL YES YES name select name, type, column_name from mo_catalog.mo_indexes mi where name="idx2"; name type column_name idx2 MULTIPLE name @@ -67,7 +67,7 @@ idx2 MULTIPLE __mo_alias_id alter table t1 drop column name; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id select name, type, column_name from mo_catalog.mo_indexes mi where name="idx2"; name type column_name drop table if exists t1; @@ -77,9 +77,9 @@ insert into t1 values(1,"Abby", 24); insert into t1 values(2,"Dora", 25); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx3 1 name A 0 NULL NULL YES YES NULL -t1 1 idx3 2 age A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx3 1 name A 0 NULL NULL YES YES name +t1 1 idx3 2 age A 0 NULL NULL YES YES age select name, type, column_name from mo_catalog.mo_indexes mi where name="idx3"; name type column_name idx3 MULTIPLE name @@ -88,8 +88,8 @@ idx3 MULTIPLE __mo_alias_id alter table t1 drop column name; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 idx3 1 age A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL +t1 1 idx3 1 age A 0 NULL NULL YES YES age +t1 0 PRIMARY 1 id A 0 NULL NULL YES id select name, type, column_name from mo_catalog.mo_indexes mi where name="idx3"; name type column_name idx3 MULTIPLE age @@ -107,9 +107,9 @@ b Bob 25 c Carol 23 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx4 1 id A 0 NULL NULL YES NULL -t1 1 idx4 2 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx4 1 id A 0 NULL NULL YES id +t1 1 idx4 2 name A 0 NULL NULL YES YES name select name, type, column_name from mo_catalog.mo_indexes mi where name="idx4"; name type column_name idx4 MULTIPLE id @@ -117,7 +117,7 @@ idx4 MULTIPLE name alter table t1 drop column id; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 idx4 1 name A 0 NULL NULL YES YES NULL +t1 1 idx4 1 name A 0 NULL NULL YES YES name select name, type, column_name from mo_catalog.mo_indexes mi where name="idx4"; name type column_name idx4 MULTIPLE name diff --git a/test/distributed/cases/ddl/secondary_index_create.result b/test/distributed/cases/ddl/secondary_index_create.result index e1d0b9887b742..e3818a9a1fc94 100644 --- a/test/distributed/cases/ddl/secondary_index_create.result +++ b/test/distributed/cases/ddl/secondary_index_create.result @@ -9,8 +9,8 @@ id name age 2 Bob 25 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx1 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx1 1 name A 0 NULL NULL YES YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` int NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` (`name`)\n) @@ -31,8 +31,8 @@ id name age 3 Dora 30 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx2 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx2 1 name A 0 NULL NULL YES YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` int NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx2` (`name`)\n) @@ -51,9 +51,9 @@ id name age 2 Bob 25 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx3 1 id A 0 NULL NULL YES NULL -t1 1 idx3 2 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx3 1 id A 0 NULL NULL YES id +t1 1 idx3 2 name A 0 NULL NULL YES YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` int NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx3` (`id`,`name`)\n) @@ -74,8 +74,8 @@ b Bob 25 c Danny 26 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx4 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx4 1 name A 0 NULL NULL YES YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` varchar(255) NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx4` (`name`)\n) @@ -95,8 +95,8 @@ b Bob 25 c Carol 23 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 idx5 1 name A 0 NULL NULL YES YES NULL -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL +t1 1 idx5 1 name A 0 NULL NULL YES YES name +t1 0 PRIMARY 1 id A 0 NULL NULL YES id show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` varchar(255) NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx5` (`name`)\n) @@ -115,8 +115,8 @@ a b 2.6 200 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 a A 0 NULL NULL YES NULL -t1 1 idx6 1 a A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 a A 0 NULL NULL YES a +t1 1 idx6 1 a A 0 NULL NULL YES a show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `a` double NOT NULL,\n `b` int DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx6` (`a`)\n) @@ -129,8 +129,8 @@ create index idx7 using BTREE on t1(name); insert into t1 values(1,"Abby", 24); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx7 1 name A 0 NULL NULL YES btree YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx7 1 name A 0 NULL NULL YES btree YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` int NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx7` USING btree (`name`)\n) diff --git a/test/distributed/cases/ddl/secondary_index_delete.result b/test/distributed/cases/ddl/secondary_index_delete.result index 6b4647a8c3878..ed490e8579bf8 100644 --- a/test/distributed/cases/ddl/secondary_index_delete.result +++ b/test/distributed/cases/ddl/secondary_index_delete.result @@ -5,8 +5,8 @@ insert into t1 values(1,"Abby", 24); insert into t1 values(2,"Dora", 25); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx1 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx1 1 name A 0 NULL NULL YES YES name drop table t1; select name, type, column_name from mo_catalog.mo_indexes mi where name="idx1"; name type column_name @@ -18,9 +18,9 @@ insert into t1 values(2,"Dora", 25); delete from t1 where id = 1; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx2 1 name A 0 NULL NULL YES YES NULL -t1 1 idx2 2 age A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx2 1 name A 0 NULL NULL YES YES name +t1 1 idx2 2 age A 0 NULL NULL YES YES age select name, type,column_name from mo_catalog.mo_indexes mi where name="idx2"; name type column_name idx2 MULTIPLE name @@ -33,8 +33,8 @@ insert into t1 values(1,"Abby", 24); insert into t1 values(2,"Dora", 25); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx3 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx3 1 name A 0 NULL NULL YES YES name select name, type,column_name from mo_catalog.mo_indexes mi where name="idx3"; name type column_name idx3 MULTIPLE name @@ -45,7 +45,7 @@ t1 CREATE TABLE `t1` (\n `id` int NOT NULL,\n `name` varchar(255) DEFAULT N DROP INDEX idx3 ON t1; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id select name, type,column_name from mo_catalog.mo_indexes mi where name="idx3"; name type column_name show create table t1; diff --git a/test/distributed/cases/ddl/secondary_index_insert.result b/test/distributed/cases/ddl/secondary_index_insert.result index 09362ed5a0389..739f003d91a5f 100644 --- a/test/distributed/cases/ddl/secondary_index_insert.result +++ b/test/distributed/cases/ddl/secondary_index_insert.result @@ -20,8 +20,8 @@ id name age 3 Abby 26 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 1 idx1 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 1 idx1 1 name A 0 NULL NULL YES YES name show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `id` int NOT NULL,\n `name` varchar(255) DEFAULT NULL,\n `age` int DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` (`name`)\n) diff --git a/test/distributed/cases/ddl/secondary_index_master.result b/test/distributed/cases/ddl/secondary_index_master.result index 6863fc0eb2fd0..6019fe26974e8 100644 --- a/test/distributed/cases/ddl/secondary_index_master.result +++ b/test/distributed/cases/ddl/secondary_index_master.result @@ -72,9 +72,9 @@ select * from t1; a b c show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 c A 0 NULL NULL YES NULL -t1 1 idx1 1 a A 0 NULL NULL YES master YES NULL -t1 1 idx1 2 b A 0 NULL NULL YES master YES NULL +t1 0 PRIMARY 1 c A 0 NULL NULL YES c +t1 1 idx1 1 a A 0 NULL NULL YES master YES a +t1 1 idx1 2 b A 0 NULL NULL YES master YES b show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `a` varchar(30) DEFAULT NULL,\n `b` varchar(30) DEFAULT NULL,\n `c` varchar(30) NOT NULL,\n PRIMARY KEY (`c`),\n KEY `idx1` USING master (`a`,`b`)\n) diff --git a/test/distributed/cases/ddl/table_kind.result b/test/distributed/cases/ddl/table_kind.result index 6da55acba39d3..7f5cd3615f7e7 100644 --- a/test/distributed/cases/ddl/table_kind.result +++ b/test/distributed/cases/ddl/table_kind.result @@ -16,8 +16,8 @@ id name age 4 Dora 29 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 0 idx1 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 0 idx1 1 name A 0 NULL NULL YES YES name select name, type, column_name from mo_catalog.mo_indexes where name = 'idx1' and table_id in (select rel_id from mo_catalog.mo_tables where relname = 't1'); name type column_name idx1 UNIQUE name @@ -33,10 +33,10 @@ id name age 4 Dora 29 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 0 idx1 1 name A 0 NULL NULL YES YES NULL -t1 1 idx2 1 name A 0 NULL NULL YES YES NULL -t1 1 idx2 2 age A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 0 idx1 1 name A 0 NULL NULL YES YES name +t1 1 idx2 1 name A 0 NULL NULL YES YES name +t1 1 idx2 2 age A 0 NULL NULL YES YES age select name, type, column_name from mo_catalog.mo_indexes where name = 'idx2' and table_id in (select rel_id from mo_catalog.mo_tables where relname = 't1'); name type column_name idx2 MULTIPLE name @@ -67,8 +67,8 @@ select * from t2; a b show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 1 idx9 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES NULL -t2 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t2 1 idx9 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES b +t2 0 PRIMARY 1 a A 0 NULL NULL YES a select name, type, column_name from mo_catalog.mo_indexes where name = 'idx9' and table_id in (select rel_id from mo_catalog.mo_tables where relname = 't2'); name type column_name idx9 MULTIPLE b @@ -85,8 +85,8 @@ insert into t3 values(1, "[1,2,3]"); insert into t3 values(2, "[1,2,4]"); show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 1 idx10 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES NULL -t3 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t3 1 idx10 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES b +t3 0 PRIMARY 1 a A 0 NULL NULL YES a show create table t3; Table Create Table t3 CREATE TABLE `t3` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx10` USING ivfflat (`b`) lists = 1 op_type 'vector_l2_ops' \n) @@ -103,7 +103,7 @@ entries alter table t3 drop column b; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 PRIMARY 1 a A 0 NULL NULL YES NULL +t3 0 PRIMARY 1 a A 0 NULL NULL YES a show create table t3; Table Create Table t3 CREATE TABLE `t3` (\n `a` int NOT NULL,\n PRIMARY KEY (`a`)\n) @@ -124,8 +124,8 @@ insert into tbl values(8, "[130,40,90]"); create index idx1 using IVFFLAT on tbl(embedding) lists = 2 op_type 'vector_l2_ops'; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) @@ -142,8 +142,8 @@ entries alter table tbl alter reindex idx1 ivfflat lists=3; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES embedding show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` USING ivfflat (`embedding`) lists = 3 op_type 'vector_l2_ops' \n) @@ -160,8 +160,8 @@ entries alter table tbl add c vecf32(3); show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES NULL -tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL +tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES embedding +tbl 0 PRIMARY 1 id A 0 NULL NULL YES id show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `id` int NOT NULL,\n `embedding` vecf32(3) DEFAULT NULL,\n `c` vecf32(3) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `idx1` USING ivfflat (`embedding`) lists = 3 op_type 'vector_l2_ops' \n) @@ -180,8 +180,8 @@ create table tbl(a int primary key,b vecf32(3), c vecf64(5)); create index idx2 using IVFFLAT on tbl(b) lists = 2 op_type 'vector_l2_ops'; show index from tbl; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL -tbl 1 idx2 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL +tbl 0 PRIMARY 1 a A 0 NULL NULL YES a +tbl 1 idx2 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES b show create table tbl; Table Create Table tbl CREATE TABLE `tbl` (\n `a` int NOT NULL,\n `b` vecf32(3) DEFAULT NULL,\n `c` vecf64(5) DEFAULT NULL,\n PRIMARY KEY (`a`),\n KEY `idx2` USING ivfflat (`b`) lists = 2 op_type 'vector_l2_ops' \n) @@ -208,9 +208,9 @@ insert into src1 values (0, 'color is red', 't1'), (1, 'car is yellow', 'crazy c create fulltext index ftidx on src1 (body, title); show index from src1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -src1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -src1 1 ftidx 1 body A 0 NULL NULL YES fulltext YES NULL -src1 1 ftidx 2 title A 0 NULL NULL YES fulltext YES NULL +src1 0 PRIMARY 1 id A 0 NULL NULL YES id +src1 1 ftidx 1 body A 0 NULL NULL YES fulltext YES body +src1 1 ftidx 2 title A 0 NULL NULL YES fulltext YES title select name, type, column_name from mo_catalog.mo_indexes where name = 'ftidx' and table_id in (select rel_id from mo_catalog.mo_tables where relname = 'src1'); name type column_name ftidx MULTIPLE body @@ -221,10 +221,10 @@ i alter table src1 add fulltext index ftidx2 (body); show index from src1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -src1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -src1 1 ftidx 1 body A 0 NULL NULL YES fulltext YES NULL -src1 1 ftidx 2 title A 0 NULL NULL YES fulltext YES NULL -src1 1 ftidx2 1 body A 0 NULL NULL YES fulltext YES NULL +src1 0 PRIMARY 1 id A 0 NULL NULL YES id +src1 1 ftidx 1 body A 0 NULL NULL YES fulltext YES body +src1 1 ftidx 2 title A 0 NULL NULL YES fulltext YES title +src1 1 ftidx2 1 body A 0 NULL NULL YES fulltext YES body select name, type, column_name from mo_catalog.mo_indexes where name = 'ftidx2' and table_id in (select rel_id from mo_catalog.mo_tables where relname = 'src1'); name type column_name ftidx2 MULTIPLE body @@ -267,9 +267,9 @@ insert into src2 values (0, 'color is red', 't1'), (1, 'car is yellow', 'crazy c (10, NULL, NULL); show index from src2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -src2 1 1 title A 0 NULL NULL YES fulltext YES NULL -src2 1 2 body A 0 NULL NULL YES fulltext YES NULL -src2 0 PRIMARY 1 id A 0 NULL NULL YES NULL +src2 1 1 title A 0 NULL NULL YES fulltext YES title +src2 1 2 body A 0 NULL NULL YES fulltext YES body +src2 0 PRIMARY 1 id A 0 NULL NULL YES id select name, type, column_name from mo_catalog.mo_indexes where table_id in (select rel_id from mo_catalog.mo_tables where relname = 'src2'); name type column_name MULTIPLE title diff --git a/test/distributed/cases/dml/show/IndexMetadata.result b/test/distributed/cases/dml/show/IndexMetadata.result index fc4be93b455cf..7745788788546 100644 --- a/test/distributed/cases/dml/show/IndexMetadata.result +++ b/test/distributed/cases/dml/show/IndexMetadata.result @@ -16,8 +16,8 @@ id name age 4 Dora 29 show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 0 PRIMARY 1 id A 0 NULL NULL YES NULL -t1 0 idx 1 name A 0 NULL NULL YES YES NULL +t1 0 PRIMARY 1 id A 0 NULL NULL YES id +t1 0 idx 1 name A 0 NULL NULL YES YES name drop table t1; drop table if exists t2; create table t2 ( @@ -39,8 +39,8 @@ col1 col2 col3 col4 4 Dora 29.0 zbcvdf show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t2 0 idx 1 col2 A 0 NULL NULL YES create varchar index YES NULL +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t2 0 idx 1 col2 A 0 NULL NULL YES create varchar index YES col2 drop table t2; drop table if exists t3; create table t3(a int, b int, unique key(a) comment 'a'); @@ -51,14 +51,14 @@ Table Create Table t3 CREATE TABLE `t3` (\n `a` int DEFAULT NULL,\n `b` int DEFAULT NULL,\n UNIQUE KEY `a` (`a`) COMMENT 'a',\n UNIQUE KEY `x` (`a`) COMMENT 'x',\n KEY `xx` (`a`) COMMENT 'xx'\n) show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 a 1 a A 0 NULL NULL YES a YES NULL -t3 0 x 1 a A 0 NULL NULL YES x YES NULL -t3 1 xx 1 a A 0 NULL NULL YES xx YES NULL +t3 0 a 1 a A 0 NULL NULL YES a YES a +t3 0 x 1 a A 0 NULL NULL YES x YES a +t3 1 xx 1 a A 0 NULL NULL YES xx YES a alter table t3 drop index xx; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 a 1 a A 0 NULL NULL YES a YES NULL -t3 0 x 1 a A 0 NULL NULL YES x YES NULL +t3 0 a 1 a A 0 NULL NULL YES a YES a +t3 0 x 1 a A 0 NULL NULL YES x YES a drop table t3; drop table if exists t4; create table t4 ( @@ -80,40 +80,40 @@ col1 col2 col3 col4 4 Dora 29.0 zbcvdf show index from t4; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t4 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL -t4 0 idx 1 col2 A 0 NULL NULL YES YES NULL -t4 0 idx 2 col3 A 0 NULL NULL YES YES NULL +t4 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 +t4 0 idx 1 col2 A 0 NULL NULL YES YES col2 +t4 0 idx 2 col3 A 0 NULL NULL YES YES col3 drop table t4; drop table if exists t5; create table t5(a int, b int, unique key(a) comment 'a'); show index from t5; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t5 0 a 1 a A 0 NULL NULL YES a YES NULL +t5 0 a 1 a A 0 NULL NULL YES a YES a drop table t5; drop table if exists t6; create table t6(a int, b int, unique key(a)); create index b on t6(b); show index from t6; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t6 0 a 1 a A 0 NULL NULL YES YES NULL -t6 1 b 1 b A 0 NULL NULL YES YES NULL +t6 0 a 1 a A 0 NULL NULL YES YES a +t6 1 b 1 b A 0 NULL NULL YES YES b drop index b on t6; show index from t6; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t6 0 a 1 a A 0 NULL NULL YES YES NULL +t6 0 a 1 a A 0 NULL NULL YES YES a drop table t6; drop table if exists t7; create table t7(a int, b int); create index x ON t7(a) comment 'x'; show index from t7; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t7 1 x 1 a A 0 NULL NULL YES x YES NULL +t7 1 x 1 a A 0 NULL NULL YES x YES a drop table t7; drop table if exists t8; create table t8(a int, b int, key(a) comment 'a'); show index from t8; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t8 1 a 1 a A 0 NULL NULL YES a YES NULL +t8 1 a 1 a A 0 NULL NULL YES a YES a drop table t8; drop table if exists t9; create table t9( @@ -136,37 +136,37 @@ col1 col2 col3 col4 col5 col6 col7 col8 7934 MILLER CLERK 7782 1982-01-23 1300.00 null 10 show index from t9; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t9 0 col1 1 col1 A 0 NULL NULL YES YES NULL -t9 0 col1 2 col2 A 0 NULL NULL YES YES NULL -t9 0 col1 3 col3 A 0 NULL NULL YES YES NULL -t9 0 col1 4 col6 A 0 NULL NULL YES YES NULL -t9 0 idx_1 1 col1 A 0 NULL NULL YES YES NULL -t9 0 idx_1 2 col2 A 0 NULL NULL YES YES NULL -t9 0 idx_1 3 col3 A 0 NULL NULL YES YES NULL -t9 0 idx_1 4 col6 A 0 NULL NULL YES YES NULL +t9 0 col1 1 col1 A 0 NULL NULL YES YES col1 +t9 0 col1 2 col2 A 0 NULL NULL YES YES col2 +t9 0 col1 3 col3 A 0 NULL NULL YES YES col3 +t9 0 col1 4 col6 A 0 NULL NULL YES YES col6 +t9 0 idx_1 1 col1 A 0 NULL NULL YES YES col1 +t9 0 idx_1 2 col2 A 0 NULL NULL YES YES col2 +t9 0 idx_1 3 col3 A 0 NULL NULL YES YES col3 +t9 0 idx_1 4 col6 A 0 NULL NULL YES YES col6 alter table t9 drop index idx_1; show index from t9; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t9 0 col1 1 col1 A 0 NULL NULL YES YES NULL -t9 0 col1 2 col2 A 0 NULL NULL YES YES NULL -t9 0 col1 3 col3 A 0 NULL NULL YES YES NULL -t9 0 col1 4 col6 A 0 NULL NULL YES YES NULL +t9 0 col1 1 col1 A 0 NULL NULL YES YES col1 +t9 0 col1 2 col2 A 0 NULL NULL YES YES col2 +t9 0 col1 3 col3 A 0 NULL NULL YES YES col3 +t9 0 col1 4 col6 A 0 NULL NULL YES YES col6 drop table t9; drop table if exists t10; create table t10(a int,b binary,c char,d varchar(20)); create index index01 on t10(a,b,C); show index from t10; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t10 1 index01 1 a A 0 NULL NULL YES YES NULL -t10 1 index01 2 b A 0 NULL NULL YES YES NULL -t10 1 index01 3 c A 0 NULL NULL YES YES NULL +t10 1 index01 1 a A 0 NULL NULL YES YES a +t10 1 index01 2 b A 0 NULL NULL YES YES b +t10 1 index01 3 c A 0 NULL NULL YES YES c drop table t10; drop table if exists t11; create table t11(col1 int not null, col2 varchar(100), col3 bigint); create index ABc on t11(COL1); show index from t11; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t11 1 abc 1 col1 A 0 NULL NULL YES NULL +t11 1 abc 1 col1 A 0 NULL NULL YES col1 alter table t11 drop index ABc; show index from t11; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression diff --git a/test/distributed/cases/dml/show/show.result b/test/distributed/cases/dml/show/show.result index 5b2ec71c469c8..7a0fc4e9cb699 100644 --- a/test/distributed/cases/dml/show/show.result +++ b/test/distributed/cases/dml/show/show.result @@ -359,8 +359,8 @@ PRIMARY KEY (h1,u1) ); show INDEX FROM show_02; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -show_02 0 PRIMARY 1 h1 A 0 NULL NULL YES NULL -show_02 0 PRIMARY 2 u1 A 0 NULL NULL YES NULL +show_02 0 PRIMARY 1 h1 A 0 NULL NULL YES h1 +show_02 0 PRIMARY 2 u1 A 0 NULL NULL YES u1 DROP TABLE show_02; DROP TABLE IF EXISTS show_03; CREATE TABLE show_03(a int, b int); @@ -370,7 +370,7 @@ Table Create Table show_03 CREATE TABLE `show_03` (\n `a` int DEFAULT NULL,\n `b` int DEFAULT NULL,\n UNIQUE KEY `x` (`a`) COMMENT 'x'\n) show INDEX FROM show_03; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -show_03 0 x 1 a A 0 NULL NULL YES x YES NULL +show_03 0 x 1 a A 0 NULL NULL YES x YES a DROP TABLE show_03; CREATE TABLE show_04(a int, b int, unique key(a)); show CREATE TABLE show_04; @@ -379,8 +379,8 @@ show_04 CREATE TABLE `show_04` (\n `a` int DEFAULT NULL,\n `b` int DEFAULT CREATE INDEX b ON show_04(b); show INDEX FROM show_04; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -show_04 0 a 1 a A 0 NULL NULL YES YES NULL -show_04 1 b 1 b A 0 NULL NULL YES YES NULL +show_04 0 a 1 a A 0 NULL NULL YES YES a +show_04 1 b 1 b A 0 NULL NULL YES YES b DROP TABLE show_04; DROP DATABASE test; create database test; @@ -424,9 +424,9 @@ INDEX (col2,col3) ); show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t1 1 col2 1 col2 A 0 NULL NULL YES NULL -t1 1 col2 2 col3 A 0 NULL NULL YES NULL -t1 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t1 1 col2 1 col2 A 0 NULL NULL YES col2 +t1 1 col2 2 col3 A 0 NULL NULL YES col3 +t1 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 drop table t1; drop table if exists t2; CREATE TABLE t2 ( @@ -437,8 +437,8 @@ col4 INT NOT NULL ); show index from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t2 0 col2 1 col2 A 0 NULL NULL YES NULL -t2 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t2 0 col2 1 col2 A 0 NULL NULL YES col2 +t2 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 drop table t2; drop table if exists t3; CREATE TABLE t3 ( @@ -451,10 +451,10 @@ UNIQUE KEY (col1, col3) ); show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression -t3 0 col1 1 col1 A 0 NULL NULL YES NULL -t3 0 col1_2 1 col1 A 0 NULL NULL YES NULL -t3 0 col1_2 2 col3 A 0 NULL NULL YES NULL -t3 0 PRIMARY 1 col1 A 0 NULL NULL YES NULL +t3 0 col1 1 col1 A 0 NULL NULL YES col1 +t3 0 col1_2 1 col1 A 0 NULL NULL YES col1 +t3 0 col1_2 2 col3 A 0 NULL NULL YES col3 +t3 0 PRIMARY 1 col1 A 0 NULL NULL YES col1 drop table t3; drop database test; drop database if exists test; diff --git a/test/distributed/cases/dml/show/show6.result b/test/distributed/cases/dml/show/show6.result new file mode 100644 index 0000000000000..465e382a8a5c8 --- /dev/null +++ b/test/distributed/cases/dml/show/show6.result @@ -0,0 +1,10 @@ +drop database if exists test_show; +create database test_show; +CREATE TABLE `t1` ( +`abc` varchar(255) NOT NULL, +KEY `uidx` (`abc`) +); +SHOW INDEX FROM `t1`; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression +t1 1 uidx 1 abc A 0 NULL NULL YES abc +drop database if exists test_show; diff --git a/test/distributed/cases/dml/show/show6.sql b/test/distributed/cases/dml/show/show6.sql new file mode 100644 index 0000000000000..21ba959bc4c15 --- /dev/null +++ b/test/distributed/cases/dml/show/show6.sql @@ -0,0 +1,10 @@ +drop database if exists test_show; +create database test_show; + +CREATE TABLE `t1` ( + `abc` varchar(255) NOT NULL, + KEY `uidx` (`abc`) +); +SHOW INDEX FROM `t1`; + +drop database if exists test_show; \ No newline at end of file diff --git a/test/distributed/cases/dtype/binary.result b/test/distributed/cases/dtype/binary.result index 86460f890054e9f5212863bf649c44dda0787b8b..840584005048727184a81cf52ab85fcf437dd4bc 100644 GIT binary patch delta 19 bcmdmZfobCfrVSyYEXnyfMw=r