Skip to content

Commit 0102b8f

Browse files
author
Guilhem Bichot
committed
fix for pb2 failures (after push of Bug#25188540 and Bug#25573143)
1 parent cb83b19 commit 0102b8f

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

mysql-test/include/with_recursive.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@ insert into t1 values
699699

700700
create table t2 select * from t1 order by rand();
701701

702+
--echo # Tree-walking query. We turn off the Query Cache: indeed
703+
--echo # sometimes pb2 enables Query Cache and as we run twice the
704+
--echo # same query the 2nd may not actually be executed so the value
705+
--echo # of Created_tmp_tables displayed at end becomes "one less").
706+
702707
let $query=
703708
with recursive tree_of_a as
704709
(
@@ -710,7 +715,7 @@ union all
710715
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
711716
t2.id=tree_of_a.rightpar
712717
)
713-
select * from tree_of_a;
718+
select sql_no_cache * from tree_of_a;
714719

715720
--echo # Note that without ORDER BY, order of rows would be random as BNL
716721
--echo # implies that the randomized t2 is the driving table in the

mysql-test/r/information_schema_ci.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,3 +2354,13 @@ SELECT INDEX_NAME FROM INFORMATION_SCHEMA.`STATISTICS` WHERE `TABLE_NAME` = 'inn
23542354
INDEX_NAME
23552355
PRIMARY
23562356
PRIMARY
2357+
#
2358+
# Bug#25188540 FIELD_TINY::VAL_INT(): ASSERTION `!TABLE || (!TABLE->READ_SET |......)' FAILED
2359+
#
2360+
CREATE TABLE t1 (a INT);
2361+
SET SESSION optimizer_switch='derived_merge=off';
2362+
SHOW FIELDS FROM t1;
2363+
Field Type Null Key Default Extra
2364+
a int(11) YES NULL
2365+
SET SESSION optimizer_switch=DEFAULT;
2366+
DROP TABLE t1;

mysql-test/r/with_recursive.result

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,10 @@ insert into t1 values
905905
# Shuffle rows to make sure the algorithm works
906906
# with any read order of rows above
907907
create table t2 select * from t1 order by rand();
908+
# Tree-walking query. We turn off the Query Cache: indeed
909+
# sometimes pb2 enables Query Cache and as we run twice the
910+
# same query the 2nd may not actually be executed so the value
911+
# of Created_tmp_tables displayed at end becomes "one less").
908912
# Note that without ORDER BY, order of rows would be random as BNL
909913
# implies that the randomized t2 is the driving table in the
910914
# joining of rows.
@@ -918,7 +922,7 @@ union all
918922
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
919923
t2.id=tree_of_a.rightpar
920924
)
921-
select * from tree_of_a order by path;
925+
select sql_no_cache * from tree_of_a order by path;
922926
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
923927
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL # 100.00 Using filesort
924928
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
@@ -927,7 +931,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
927931
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
928932
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
929933
Warnings:
930-
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
934+
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select sql_no_cache `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
931935
with recursive tree_of_a as
932936
(
933937
select *, cast(id as char(200)) as path from t2 where name="A"
@@ -938,7 +942,7 @@ union all
938942
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
939943
t2.id=tree_of_a.rightpar
940944
)
941-
select * from tree_of_a order by path;
945+
select sql_no_cache * from tree_of_a order by path;
942946
id name leftpar rightpar path
943947
1 A 2 3 1
944948
2 LA 4 5 1,2
@@ -965,7 +969,7 @@ union all
965969
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
966970
t2.id=tree_of_a.rightpar
967971
)
968-
select * from tree_of_a order by path;
972+
select sql_no_cache * from tree_of_a order by path;
969973
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
970974
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL # 100.00 Using filesort
971975
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
@@ -974,7 +978,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
974978
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
975979
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
976980
Warnings:
977-
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
981+
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select sql_no_cache `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
978982
with recursive tree_of_a as
979983
(
980984
select *, cast(id as char(200)) as path from t2 where name="A"
@@ -985,7 +989,7 @@ union all
985989
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
986990
t2.id=tree_of_a.rightpar
987991
)
988-
select * from tree_of_a order by path;
992+
select sql_no_cache * from tree_of_a order by path;
989993
id name leftpar rightpar path
990994
1 A 2 3 1
991995
2 LA 4 5 1,2
@@ -1013,7 +1017,7 @@ union all
10131017
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
10141018
t2.id=tree_of_a.rightpar
10151019
)
1016-
select * from tree_of_a;
1020+
select sql_no_cache * from tree_of_a;
10171021
id name leftpar rightpar path
10181022
1 A 2 3 1
10191023
2 LA 4 5 1,2
@@ -2156,6 +2160,10 @@ insert into t1 values
21562160
# Shuffle rows to make sure the algorithm works
21572161
# with any read order of rows above
21582162
create table t2 select * from t1 order by rand();
2163+
# Tree-walking query. We turn off the Query Cache: indeed
2164+
# sometimes pb2 enables Query Cache and as we run twice the
2165+
# same query the 2nd may not actually be executed so the value
2166+
# of Created_tmp_tables displayed at end becomes "one less").
21592167
# Note that without ORDER BY, order of rows would be random as BNL
21602168
# implies that the randomized t2 is the driving table in the
21612169
# joining of rows.
@@ -2169,7 +2177,7 @@ union all
21692177
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
21702178
t2.id=tree_of_a.rightpar
21712179
)
2172-
select * from tree_of_a order by path;
2180+
select sql_no_cache * from tree_of_a order by path;
21732181
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
21742182
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL # 100.00 Using filesort
21752183
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
@@ -2178,7 +2186,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
21782186
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
21792187
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
21802188
Warnings:
2181-
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
2189+
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select sql_no_cache `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
21822190
with recursive tree_of_a as
21832191
(
21842192
select *, cast(id as char(200)) as path from t2 where name="A"
@@ -2189,7 +2197,7 @@ union all
21892197
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
21902198
t2.id=tree_of_a.rightpar
21912199
)
2192-
select * from tree_of_a order by path;
2200+
select sql_no_cache * from tree_of_a order by path;
21932201
id name leftpar rightpar path
21942202
1 A 2 3 1
21952203
2 LA 4 5 1,2
@@ -2216,7 +2224,7 @@ union all
22162224
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
22172225
t2.id=tree_of_a.rightpar
22182226
)
2219-
select * from tree_of_a order by path;
2227+
select sql_no_cache * from tree_of_a order by path;
22202228
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
22212229
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL # 100.00 Using filesort
22222230
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
@@ -2225,7 +2233,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
22252233
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
22262234
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
22272235
Warnings:
2228-
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
2236+
Note 1003 with recursive `tree_of_a` as (/* select#2 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,cast(`test`.`t2`.`id` as char(200) charset latin1) AS `path` from `test`.`t2` where (`test`.`t2`.`name` = 'A') union all /* select#3 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`leftpar`) union all /* select#5 */ select `test`.`t2`.`id` AS `id`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`leftpar` AS `leftpar`,`test`.`t2`.`rightpar` AS `rightpar`,concat(`tree_of_a`.`path`,',',`test`.`t2`.`id`) AS `concat(tree_of_a.path,",",t2.id)` from `test`.`t2` join `tree_of_a` where (`test`.`t2`.`id` = `tree_of_a`.`rightpar`)) /* select#1 */ select sql_no_cache `tree_of_a`.`id` AS `id`,`tree_of_a`.`name` AS `name`,`tree_of_a`.`leftpar` AS `leftpar`,`tree_of_a`.`rightpar` AS `rightpar`,`tree_of_a`.`path` AS `path` from `tree_of_a` order by `tree_of_a`.`path`
22292237
with recursive tree_of_a as
22302238
(
22312239
select *, cast(id as char(200)) as path from t2 where name="A"
@@ -2236,7 +2244,7 @@ union all
22362244
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
22372245
t2.id=tree_of_a.rightpar
22382246
)
2239-
select * from tree_of_a order by path;
2247+
select sql_no_cache * from tree_of_a order by path;
22402248
id name leftpar rightpar path
22412249
1 A 2 3 1
22422250
2 LA 4 5 1,2
@@ -2264,7 +2272,7 @@ union all
22642272
select t2.*, concat(tree_of_a.path,",",t2.id) from t2 join tree_of_a on
22652273
t2.id=tree_of_a.rightpar
22662274
)
2267-
select * from tree_of_a;
2275+
select sql_no_cache * from tree_of_a;
22682276
id name leftpar rightpar path
22692277
1 A 2 3 1
22702278
2 LA 4 5 1,2

0 commit comments

Comments
 (0)