Skip to content

Commit

Permalink
bugfix: INFORMATION_SCHEMA.STATISTICS doesn't show whether the index …
Browse files Browse the repository at this point in the history
…is disabled
  • Loading branch information
vuvova committed May 5, 2024
1 parent 179515a commit 3d75cff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions mysql-test/main/information_schema2.result
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ t3
t4
drop table t1, t2, t3, t4;
# End of 5.5 tests
# INFORMATION_SCHEMA.STATISTICS doesn't show if the index is disabled
create table t1 (a int, key(a));
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
index_name comment
a
alter table t1 disable keys;
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
index_name comment
a disabled
drop table t1;
# End of 10.5 tests
9 changes: 9 additions & 0 deletions mysql-test/main/information_schema2.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ select * from t4 order by table_name;
drop table t1, t2, t3, t4;

--echo # End of 5.5 tests

--echo # INFORMATION_SCHEMA.STATISTICS doesn't show if the index is disabled
create table t1 (a int, key(a));
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
alter table t1 disable keys;
select index_name, comment from information_schema.statistics where table_schema='test' and table_name='t1';
drop table t1;

--echo # End of 10.5 tests
2 changes: 1 addition & 1 deletion sql/sql_show.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9400,7 +9400,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_FRM_ONLY),
Column("COMMENT", Varchar(16), NULLABLE, "Comment", OPEN_FULL_TABLE),
Column("INDEX_COMMENT", Varchar(INDEX_COMMENT_MAXLEN),
NOT_NULL, "Index_comment",OPEN_FRM_ONLY),
CEnd()
Expand Down

0 comments on commit 3d75cff

Please sign in to comment.