Commit 5ac4bc45 authored by Sergei Golubchik's avatar Sergei Golubchik

make INFORMATION_SCHEMA.STATISTICS.COMMENT not nullable

as it can never be null (only "" or "disabled")
parent 796a3b99
...@@ -75,7 +75,7 @@ def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 36864 0 6 ...@@ -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 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 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 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 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 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 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 ...@@ -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 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 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 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 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 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 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 ...@@ -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 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 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 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 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 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 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
......
...@@ -396,7 +396,7 @@ def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NUL ...@@ -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) select NEVER NULL NO NO 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 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 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 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_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 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
......
...@@ -42,7 +42,7 @@ SUB_PART bigint(3) YES NULL ...@@ -42,7 +42,7 @@ SUB_PART bigint(3) YES NULL
PACKED varchar(10) YES NULL PACKED varchar(10) YES NULL
NULLABLE varchar(3) NO NULL NULLABLE varchar(3) NO NULL
INDEX_TYPE varchar(16) NO NULL INDEX_TYPE varchar(16) NO NULL
COMMENT varchar(16) YES NULL COMMENT varchar(16) NO NULL
INDEX_COMMENT varchar(1024) NO NULL INDEX_COMMENT varchar(1024) NO NULL
IGNORED varchar(3) NO NULL IGNORED varchar(3) NO NULL
SHOW CREATE TABLE information_schema.STATISTICS; SHOW CREATE TABLE information_schema.STATISTICS;
...@@ -62,7 +62,7 @@ STATISTICS CREATE TEMPORARY TABLE `STATISTICS` ( ...@@ -62,7 +62,7 @@ STATISTICS CREATE TEMPORARY TABLE `STATISTICS` (
`PACKED` varchar(10), `PACKED` varchar(10),
`NULLABLE` varchar(3) NOT NULL, `NULLABLE` varchar(3) NOT NULL,
`INDEX_TYPE` varchar(16) NOT NULL, `INDEX_TYPE` varchar(16) NOT NULL,
`COMMENT` varchar(16), `COMMENT` varchar(16) NOT NULL,
`INDEX_COMMENT` varchar(1024) NOT NULL, `INDEX_COMMENT` varchar(1024) NOT NULL,
`IGNORED` varchar(3) NOT NULL `IGNORED` varchar(3) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
...@@ -82,7 +82,7 @@ SUB_PART bigint(3) YES NULL ...@@ -82,7 +82,7 @@ SUB_PART bigint(3) YES NULL
PACKED varchar(10) YES NULL PACKED varchar(10) YES NULL
NULLABLE varchar(3) NO NULL NULLABLE varchar(3) NO NULL
INDEX_TYPE varchar(16) NO NULL INDEX_TYPE varchar(16) NO NULL
COMMENT varchar(16) YES NULL COMMENT varchar(16) NO NULL
INDEX_COMMENT varchar(1024) NO NULL INDEX_COMMENT varchar(1024) NO NULL
IGNORED varchar(3) NO NULL IGNORED varchar(3) NO NULL
SELECT table_catalog, table_schema, table_name, index_schema, index_name SELECT table_catalog, table_schema, table_name, index_schema, index_name
......
...@@ -7359,9 +7359,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables, ...@@ -7359,9 +7359,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
table->field[12]->store(pos, strlen(pos), cs); table->field[12]->store(pos, strlen(pos), cs);
if (!show_table->s->keys_in_use.is_set(i)) if (!show_table->s->keys_in_use.is_set(i))
table->field[14]->store(STRING_WITH_LEN("disabled"), cs); 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) == DBUG_ASSERT(MY_TEST(key_info->flags & HA_USES_COMMENT) ==
(key_info->comment.length > 0)); (key_info->comment.length > 0));
if (key_info->flags & HA_USES_COMMENT) if (key_info->flags & HA_USES_COMMENT)
...@@ -9917,7 +9914,7 @@ ST_FIELD_INFO stat_fields_info[]= ...@@ -9917,7 +9914,7 @@ ST_FIELD_INFO stat_fields_info[]=
Column("PACKED", Varchar(10), NULLABLE, "Packed", OPEN_FRM_ONLY), Column("PACKED", Varchar(10), NULLABLE, "Packed", OPEN_FRM_ONLY),
Column("NULLABLE", Varchar(3), NOT_NULL, "Null", 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("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), Column("INDEX_COMMENT", Varchar(INDEX_COMMENT_MAXLEN),
NOT_NULL, "Index_comment",OPEN_FRM_ONLY), NOT_NULL, "Index_comment",OPEN_FRM_ONLY),
Column("IGNORED", Varchar(3), NOT_NULL, "Ignored", OPEN_FRM_ONLY), Column("IGNORED", Varchar(3), NOT_NULL, "Ignored", OPEN_FRM_ONLY),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment