diff --git a/mysql-test/main/show_check.result b/mysql-test/main/show_check.result index 40fe52dd17e..d390c69fd63 100644 --- a/mysql-test/main/show_check.result +++ b/mysql-test/main/show_check.result @@ -75,7 +75,7 @@ def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 36864 0 6 def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 4096 0 8 def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 4097 0 8 def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 4097 0 8 -def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 4096 0 8 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 N 4097 0 8 def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 1024 0 N 4097 0 8 def information_schema STATISTICS STATISTICS IGNORED Ignored 253 3 2 N 4097 0 8 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored @@ -661,7 +661,7 @@ def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 36864 0 6 def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 4096 0 63 def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 4097 0 63 def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 4097 0 63 -def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 4096 0 63 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 N 4097 0 63 def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 1024 0 N 4097 0 63 def information_schema STATISTICS STATISTICS IGNORED Ignored 253 3 2 N 4097 0 63 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored @@ -932,7 +932,7 @@ def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 36864 0 6 def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 4096 0 33 def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 4097 0 33 def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 4097 0 33 -def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 4096 0 33 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 N 4097 0 33 def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 3072 0 N 4097 0 33 def information_schema STATISTICS STATISTICS IGNORED Ignored 253 9 2 N 4097 0 33 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index af3a942015b..4bc5cfbd063 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -461,7 +461,7 @@ def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NUL def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL NO NO def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO -def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO +def information_schema STATISTICS COMMENT 15 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 2afc7e9094e..35225a55ca3 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -396,7 +396,7 @@ def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NUL def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL NO NO def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO -def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO +def information_schema STATISTICS COMMENT 15 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL NO NO def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result index f271913d329..ecc428933e5 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics.result +++ b/mysql-test/suite/funcs_1/r/is_statistics.result @@ -42,7 +42,7 @@ SUB_PART bigint(3) YES NULL PACKED varchar(10) YES NULL NULLABLE varchar(3) NO NULL INDEX_TYPE varchar(16) NO NULL -COMMENT varchar(16) YES NULL +COMMENT varchar(16) NO NULL INDEX_COMMENT varchar(1024) NO NULL IGNORED varchar(3) NO NULL SHOW CREATE TABLE information_schema.STATISTICS; @@ -62,7 +62,7 @@ STATISTICS CREATE TEMPORARY TABLE `STATISTICS` ( `PACKED` varchar(10), `NULLABLE` varchar(3) NOT NULL, `INDEX_TYPE` varchar(16) NOT NULL, - `COMMENT` varchar(16), + `COMMENT` varchar(16) NOT NULL, `INDEX_COMMENT` varchar(1024) NOT NULL, `IGNORED` varchar(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci @@ -82,7 +82,7 @@ SUB_PART bigint(3) YES NULL PACKED varchar(10) YES NULL NULLABLE varchar(3) NO NULL INDEX_TYPE varchar(16) NO NULL -COMMENT varchar(16) YES NULL +COMMENT varchar(16) NO NULL INDEX_COMMENT varchar(1024) NO NULL IGNORED varchar(3) NO NULL SELECT table_catalog, table_schema, table_name, index_schema, index_name diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 7e50b2c106a..3498fd584db 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7415,9 +7415,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables, table->field[12]->store(pos, strlen(pos), cs); if (!show_table->s->keys_in_use.is_set(i)) table->field[14]->store(STRING_WITH_LEN("disabled"), cs); - else - table->field[14]->store("", 0, cs); - table->field[14]->set_notnull(); DBUG_ASSERT(MY_TEST(key_info->flags & HA_USES_COMMENT) == (key_info->comment.length > 0)); if (key_info->flags & HA_USES_COMMENT) @@ -10120,7 +10117,7 @@ ST_FIELD_INFO stat_fields_info[]= Column("PACKED", Varchar(10), NULLABLE, "Packed", OPEN_FRM_ONLY), Column("NULLABLE", Varchar(3), NOT_NULL, "Null", OPEN_FRM_ONLY), Column("INDEX_TYPE", Varchar(16), NOT_NULL, "Index_type", OPEN_FULL_TABLE), - Column("COMMENT", Varchar(16), NULLABLE, "Comment", OPEN_FULL_TABLE), + Column("COMMENT", Varchar(16), NOT_NULL, "Comment", OPEN_FULL_TABLE), Column("INDEX_COMMENT", Varchar(INDEX_COMMENT_MAXLEN), NOT_NULL, "Index_comment",OPEN_FRM_ONLY), Column("IGNORED", Varchar(3), NOT_NULL, "Ignored", OPEN_FRM_ONLY),