Loading mysql-test/r/handler.result +18 −0 Original line number Diff line number Diff line Loading @@ -445,3 +445,21 @@ drop table t2; drop table t3; drop table t4; drop table t5; create table t1 (c1 int); insert into t1 values (1); handler t1 open; handler t1 read first; c1 1 send the below to another connection, do not wait for the result optimize table t1; proceed with the normal connection handler t1 read next; c1 1 handler t1 close; read the result from the other connection Table Op Msg_type Msg_text test.t1 optimize status OK proceed with the normal connection drop table t1; mysql-test/r/myisam.result +10 −0 Original line number Diff line number Diff line Loading @@ -498,6 +498,16 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct drop table t1,t2; create table t1 ( c1 varchar(32), key (c1) ) engine=myisam; alter table t1 disable keys; insert into t1 values ('a'), ('b'); select c1 from t1 order by c1 limit 1; c1 a drop table t1; CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; Got one of the listed errors create table t1 (a int, b varchar(200), c text not null) checksum=1; Loading mysql-test/t/handler.test +28 −0 Original line number Diff line number Diff line Loading @@ -347,4 +347,32 @@ drop table t3; drop table t4; drop table t5; # # Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash # create table t1 (c1 int); insert into t1 values (1); # client 1 handler t1 open; handler t1 read first; # client 2 connect (con2,localhost,root,,); connection con2; --exec echo send the below to another connection, do not wait for the result send optimize table t1; --sleep 1 # client 1 --exec echo proceed with the normal connection connection default; handler t1 read next; handler t1 close; # client 2 --exec echo read the result from the other connection connection con2; reap; # client 1 --exec echo proceed with the normal connection connection default; drop table t1; # End of 4.1 tests mysql-test/t/myisam.test +12 −0 Original line number Diff line number Diff line Loading @@ -473,6 +473,18 @@ explain select sql_big_result distinct t1.a from t1,t2 order by t2.a; explain select distinct t1.a from t1,t2 order by t2.a; drop table t1,t2; # # Bug#14616 - Freshly imported table returns error 124 when using LIMIT # create table t1 ( c1 varchar(32), key (c1) ) engine=myisam; alter table t1 disable keys; insert into t1 values ('a'), ('b'); select c1 from t1 order by c1 limit 1; drop table t1; # # Test RTREE index # Loading sql/mysql_priv.h +2 −1 Original line number Diff line number Diff line Loading @@ -701,7 +701,8 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen= 0); int mysql_ha_close(THD *thd, TABLE_LIST *tables); int mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *, List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows); int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags); int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags, bool is_locked); /* mysql_ha_flush mode_flags bits */ #define MYSQL_HA_CLOSE_FINAL 0x00 #define MYSQL_HA_REOPEN_ON_USAGE 0x01 Loading Loading
mysql-test/r/handler.result +18 −0 Original line number Diff line number Diff line Loading @@ -445,3 +445,21 @@ drop table t2; drop table t3; drop table t4; drop table t5; create table t1 (c1 int); insert into t1 values (1); handler t1 open; handler t1 read first; c1 1 send the below to another connection, do not wait for the result optimize table t1; proceed with the normal connection handler t1 read next; c1 1 handler t1 close; read the result from the other connection Table Op Msg_type Msg_text test.t1 optimize status OK proceed with the normal connection drop table t1;
mysql-test/r/myisam.result +10 −0 Original line number Diff line number Diff line Loading @@ -498,6 +498,16 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct drop table t1,t2; create table t1 ( c1 varchar(32), key (c1) ) engine=myisam; alter table t1 disable keys; insert into t1 values ('a'), ('b'); select c1 from t1 order by c1 limit 1; c1 a drop table t1; CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; Got one of the listed errors create table t1 (a int, b varchar(200), c text not null) checksum=1; Loading
mysql-test/t/handler.test +28 −0 Original line number Diff line number Diff line Loading @@ -347,4 +347,32 @@ drop table t3; drop table t4; drop table t5; # # Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash # create table t1 (c1 int); insert into t1 values (1); # client 1 handler t1 open; handler t1 read first; # client 2 connect (con2,localhost,root,,); connection con2; --exec echo send the below to another connection, do not wait for the result send optimize table t1; --sleep 1 # client 1 --exec echo proceed with the normal connection connection default; handler t1 read next; handler t1 close; # client 2 --exec echo read the result from the other connection connection con2; reap; # client 1 --exec echo proceed with the normal connection connection default; drop table t1; # End of 4.1 tests
mysql-test/t/myisam.test +12 −0 Original line number Diff line number Diff line Loading @@ -473,6 +473,18 @@ explain select sql_big_result distinct t1.a from t1,t2 order by t2.a; explain select distinct t1.a from t1,t2 order by t2.a; drop table t1,t2; # # Bug#14616 - Freshly imported table returns error 124 when using LIMIT # create table t1 ( c1 varchar(32), key (c1) ) engine=myisam; alter table t1 disable keys; insert into t1 values ('a'), ('b'); select c1 from t1 order by c1 limit 1; drop table t1; # # Test RTREE index # Loading
sql/mysql_priv.h +2 −1 Original line number Diff line number Diff line Loading @@ -701,7 +701,8 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen= 0); int mysql_ha_close(THD *thd, TABLE_LIST *tables); int mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *, List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows); int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags); int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags, bool is_locked); /* mysql_ha_flush mode_flags bits */ #define MYSQL_HA_CLOSE_FINAL 0x00 #define MYSQL_HA_REOPEN_ON_USAGE 0x01 Loading