Commit 3548e80b authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4621 select returns null for information_schema.statistics.collation field

information_schema.statistics.collation column needs OPEN_FULL_TABLE,
because it checks index_flags() for HA_READ_ORDER capability.
parent a88a4336
......@@ -40,5 +40,16 @@ nm varchar(32) YES NULL
a int(11) YES NULL
drop table t1;
#
# MDEV-4621 select returns null for information_schema.statistics.collation field
#
create table t1 (f varchar(64), key(f));
select index_name, column_name, collation, cardinality from information_schema.STATISTICS where table_schema='test' and table_name='t1';
index_name column_name collation cardinality
f f A NULL
select index_name, column_name, collation from information_schema.STATISTICS where table_schema='test' and table_name='t1';
index_name column_name collation
f f A
drop table t1;
#
# End of 10.2 tests
#
......@@ -34,6 +34,14 @@ show fields from test.t1 where field in
where table_name='t1' group by column_name) dt);
drop table t1;
--echo #
--echo # MDEV-4621 select returns null for information_schema.statistics.collation field
--echo #
create table t1 (f varchar(64), key(f));
select index_name, column_name, collation, cardinality from information_schema.STATISTICS where table_schema='test' and table_name='t1';
select index_name, column_name, collation from information_schema.STATISTICS where table_schema='test' and table_name='t1';
drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #
......@@ -8967,7 +8967,7 @@ ST_FIELD_INFO stat_fields_info[]=
{"SEQ_IN_INDEX", 2, MYSQL_TYPE_LONGLONG, 0, 0, "Seq_in_index", OPEN_FRM_ONLY},
{"COLUMN_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Column_name",
OPEN_FRM_ONLY},
{"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation", OPEN_FRM_ONLY},
{"COLLATION", 1, MYSQL_TYPE_STRING, 0, 1, "Collation", OPEN_FULL_TABLE},
{"CARDINALITY", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, 1,
"Cardinality", OPEN_FULL_TABLE},
{"SUB_PART", 3, MYSQL_TYPE_LONGLONG, 0, 1, "Sub_part", 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