Loading mysql-test/r/join_nested.result +17 −3 Original line number Diff line number Diff line Loading @@ -960,7 +960,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 Using where Loading Loading @@ -1009,7 +1009,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where Loading Loading @@ -1059,7 +1059,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where Loading Loading @@ -1467,3 +1467,17 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ref a a 5 test.t4.b X 1 SIMPLE t5 ref a a 5 test.t3.b X drop table t0, t1, t2, t3, t4, t5, t6, t7; create table t1 (a int); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t2 (a int, filler char(100), key(a)); insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B; create table t3 like t2; insert into t3 select * from t2; explain select * from t1 left join (t2 left join t3 on (t2.a = t3.a)) on (t1.a = t2.a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 1 SIMPLE t2 ref a a 5 test.t1.a 1 1 SIMPLE t3 ref a a 5 test.t2.a 1 drop table t1, t2, t3; mysql-test/r/ps.result +34 −0 Original line number Diff line number Diff line Loading @@ -825,6 +825,40 @@ execute stmt; drop table t1; set names default; deallocate prepare stmt; create table t1 ( word_id mediumint(8) unsigned not null default '0', formatted varchar(20) not null default '' ); insert into t1 values (80,'pendant'), (475,'pretendants'), (989,'tendances'), (1019,'cependant'),(1022,'abondance'),(1205,'independants'), (13,'lessiver'),(25,'lambiner'),(46,'situer'),(71,'terminer'), (82,'decrocher'); select count(*) from t1 where formatted like '%NDAN%'; count(*) 6 select count(*) from t1 where formatted like '%ER'; count(*) 5 prepare stmt from "select count(*) from t1 where formatted like ?"; set @like="%NDAN%"; execute stmt using @like; count(*) 6 set @like="%ER"; execute stmt using @like; count(*) 5 set @like="%NDAN%"; execute stmt using @like; count(*) 6 set @like="%ER"; execute stmt using @like; count(*) 5 deallocate prepare stmt; drop table t1; create table t1 (id int); prepare ins_call from "insert into t1 (id) values (1)"; execute ins_call; Loading mysql-test/t/join_nested.test +14 −0 Original line number Diff line number Diff line Loading @@ -900,3 +900,17 @@ explain select * from t2 left join join t5 on t5.a=t3.b) on t3.a=t2.b; drop table t0, t1, t2, t3, t4, t5, t6, t7; # BUG#16393 create table t1 (a int); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t2 (a int, filler char(100), key(a)); insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B; create table t3 like t2; insert into t3 select * from t2; explain select * from t1 left join (t2 left join t3 on (t2.a = t3.a)) on (t1.a = t2.a); drop table t1, t2, t3; mysql-test/t/ps.test +30 −0 Original line number Diff line number Diff line Loading @@ -870,6 +870,36 @@ drop table t1; set names default; deallocate prepare stmt; # # A test case for Bug#12734 "prepared statement may return incorrect result # set for a select SQL request": test that canDoTurboBM is reset for each # execute of a prepared statement. # create table t1 ( word_id mediumint(8) unsigned not null default '0', formatted varchar(20) not null default '' ); insert into t1 values (80,'pendant'), (475,'pretendants'), (989,'tendances'), (1019,'cependant'),(1022,'abondance'),(1205,'independants'), (13,'lessiver'),(25,'lambiner'),(46,'situer'),(71,'terminer'), (82,'decrocher'); select count(*) from t1 where formatted like '%NDAN%'; select count(*) from t1 where formatted like '%ER'; prepare stmt from "select count(*) from t1 where formatted like ?"; set @like="%NDAN%"; execute stmt using @like; set @like="%ER"; execute stmt using @like; set @like="%NDAN%"; execute stmt using @like; set @like="%ER"; execute stmt using @like; deallocate prepare stmt; drop table t1; # End of 4.1 tests # Loading sql/item_cmpfunc.cc +6 −0 Original line number Diff line number Diff line Loading @@ -3059,6 +3059,12 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) return FALSE; } void Item_func_like::cleanup() { canDoTurboBM= FALSE; Item_bool_func2::cleanup(); } #ifdef USE_REGEX bool Loading Loading
mysql-test/r/join_nested.result +17 −3 Original line number Diff line number Diff line Loading @@ -960,7 +960,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 Using where Loading Loading @@ -1009,7 +1009,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where Loading Loading @@ -1059,7 +1059,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where Loading Loading @@ -1467,3 +1467,17 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ref a a 5 test.t4.b X 1 SIMPLE t5 ref a a 5 test.t3.b X drop table t0, t1, t2, t3, t4, t5, t6, t7; create table t1 (a int); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t2 (a int, filler char(100), key(a)); insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B; create table t3 like t2; insert into t3 select * from t2; explain select * from t1 left join (t2 left join t3 on (t2.a = t3.a)) on (t1.a = t2.a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 1 SIMPLE t2 ref a a 5 test.t1.a 1 1 SIMPLE t3 ref a a 5 test.t2.a 1 drop table t1, t2, t3;
mysql-test/r/ps.result +34 −0 Original line number Diff line number Diff line Loading @@ -825,6 +825,40 @@ execute stmt; drop table t1; set names default; deallocate prepare stmt; create table t1 ( word_id mediumint(8) unsigned not null default '0', formatted varchar(20) not null default '' ); insert into t1 values (80,'pendant'), (475,'pretendants'), (989,'tendances'), (1019,'cependant'),(1022,'abondance'),(1205,'independants'), (13,'lessiver'),(25,'lambiner'),(46,'situer'),(71,'terminer'), (82,'decrocher'); select count(*) from t1 where formatted like '%NDAN%'; count(*) 6 select count(*) from t1 where formatted like '%ER'; count(*) 5 prepare stmt from "select count(*) from t1 where formatted like ?"; set @like="%NDAN%"; execute stmt using @like; count(*) 6 set @like="%ER"; execute stmt using @like; count(*) 5 set @like="%NDAN%"; execute stmt using @like; count(*) 6 set @like="%ER"; execute stmt using @like; count(*) 5 deallocate prepare stmt; drop table t1; create table t1 (id int); prepare ins_call from "insert into t1 (id) values (1)"; execute ins_call; Loading
mysql-test/t/join_nested.test +14 −0 Original line number Diff line number Diff line Loading @@ -900,3 +900,17 @@ explain select * from t2 left join join t5 on t5.a=t3.b) on t3.a=t2.b; drop table t0, t1, t2, t3, t4, t5, t6, t7; # BUG#16393 create table t1 (a int); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t2 (a int, filler char(100), key(a)); insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B; create table t3 like t2; insert into t3 select * from t2; explain select * from t1 left join (t2 left join t3 on (t2.a = t3.a)) on (t1.a = t2.a); drop table t1, t2, t3;
mysql-test/t/ps.test +30 −0 Original line number Diff line number Diff line Loading @@ -870,6 +870,36 @@ drop table t1; set names default; deallocate prepare stmt; # # A test case for Bug#12734 "prepared statement may return incorrect result # set for a select SQL request": test that canDoTurboBM is reset for each # execute of a prepared statement. # create table t1 ( word_id mediumint(8) unsigned not null default '0', formatted varchar(20) not null default '' ); insert into t1 values (80,'pendant'), (475,'pretendants'), (989,'tendances'), (1019,'cependant'),(1022,'abondance'),(1205,'independants'), (13,'lessiver'),(25,'lambiner'),(46,'situer'),(71,'terminer'), (82,'decrocher'); select count(*) from t1 where formatted like '%NDAN%'; select count(*) from t1 where formatted like '%ER'; prepare stmt from "select count(*) from t1 where formatted like ?"; set @like="%NDAN%"; execute stmt using @like; set @like="%ER"; execute stmt using @like; set @like="%NDAN%"; execute stmt using @like; set @like="%ER"; execute stmt using @like; deallocate prepare stmt; drop table t1; # End of 4.1 tests # Loading
sql/item_cmpfunc.cc +6 −0 Original line number Diff line number Diff line Loading @@ -3059,6 +3059,12 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) return FALSE; } void Item_func_like::cleanup() { canDoTurboBM= FALSE; Item_bool_func2::cleanup(); } #ifdef USE_REGEX bool Loading