mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed crashing bug with alter table when table was in use (Bug #3643)
We didn't use 'only index' for tables of type 'const'. (Bug #3497)
This commit is contained in:
@@ -206,3 +206,19 @@ select i from t1 where b=repeat(_utf8 'b',310);
|
||||
i
|
||||
1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id int unsigned auto_increment, name char(50), primary key (id)) engine=myisam;
|
||||
insert into t1 (name) values ('a'), ('b'),('c'),('d'),('e'),('f'),('g');
|
||||
explain select 1 from t1 where id =2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
explain select 1 from t1 where id =2 or id=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
|
||||
explain select name from t1 where id =2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
|
||||
ALTER TABLE t1 DROP PRIMARY KEY, ADD INDEX (id);
|
||||
explain select 1 from t1 where id =2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref id id 4 const 1 Using where; Using index
|
||||
drop table t1;
|
||||
|
||||
Reference in New Issue
Block a user