Commit ebdbe9e5 authored by unknown's avatar unknown

Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.0

into mysql.com:/home/psergey/mysql-4.0-look

parents 106e1204 df1fab9d
...@@ -233,3 +233,25 @@ c decimal(4,3) YES NULL ...@@ -233,3 +233,25 @@ c decimal(4,3) YES NULL
d double(4,3) YES NULL d double(4,3) YES NULL
f float(4,3) YES NULL f float(4,3) YES NULL
drop table t1; drop table t1;
CREATE TABLE t1 ( a VARCHAR(20) );
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
CREATE TEMPORARY TABLE t2 ( index (a(20)) ) SELECT a FROM t1 GROUP BY a;
SHOW INDEX FROM t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t2 X a X X X NULL X X X BTREE
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
SHOW INDEX FROM t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t2 X a X X X 5 X X X BTREE
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`a` varchar(20) default NULL,
KEY `a` (`a`)
) TYPE=MyISAM
SHOW INDEX FROM t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t2 X a X X X 5 X X X BTREE
DROP TEMPORARY TABLE t2;
...@@ -131,3 +131,19 @@ drop table t1; ...@@ -131,3 +131,19 @@ drop table t1;
create table t1 (c decimal(3,3), d double(3,3), f float(3,3)); create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
show columns from t1; show columns from t1;
drop table t1; drop table t1;
# Fix for BUG#7519: For temporary tables, SHOW INDEX doesn't display index
# cardinality after ANALYZE.
CREATE TABLE t1 ( a VARCHAR(20) );
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
CREATE TEMPORARY TABLE t2 ( index (a(20)) ) SELECT a FROM t1 GROUP BY a;
--replace_column 2 X 4 X 5 X 6 X 8 X 9 X 10 X
SHOW INDEX FROM t2;
ANALYZE TABLE t2;
--replace_column 2 X 4 X 5 X 6 X 8 X 9 X 10 X
SHOW INDEX FROM t2;
SHOW CREATE TABLE t2;
--replace_column 2 X 4 X 5 X 6 X 8 X 9 X 10 X
SHOW INDEX FROM t2;
DROP TEMPORARY TABLE t2;
...@@ -686,7 +686,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list) ...@@ -686,7 +686,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
String *packet= &thd->packet; String *packet= &thd->packet;
KEY *key_info=table->key_info; KEY *key_info=table->key_info;
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK | HA_STATUS_TIME); table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK | HA_STATUS_TIME |
HA_STATUS_CONST);
for (uint i=0 ; i < table->keys ; i++,key_info++) for (uint i=0 ; i < table->keys ; i++,key_info++)
{ {
KEY_PART_INFO *key_part= key_info->key_part; KEY_PART_INFO *key_part= key_info->key_part;
......
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