Skip to content

Commit

Permalink
Bug #30473261: CONVERT THE INDEX SUBQUERY ENGINES INTO USING THE ITER…
Browse files Browse the repository at this point in the history
…ATOR EXECUTOR [patch 10/10, reenable BNL]

Disable the NO_HASH_JOIN hint, since now everything is the iterator executor.
Reenable BNL/BKA when we have recursive CTEs.

Make with_recursive_solver independent of join order; remove the user variable
version, and add an ORDER BY to the remaining one to make sure we always select
the same pivot.

Change-Id: Ic3160fede591e7ff488d6372b4f1d93541e6c775
  • Loading branch information
Steinar H. Gunderson committed Dec 20, 2019
1 parent 5a41fba commit 629b549
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 562 deletions.
18 changes: 0 additions & 18 deletions mysql-test/r/explain_tree.result
Original file line number Diff line number Diff line change
Expand Up @@ -747,24 +747,6 @@ EXPLAIN
-> Index scan on t1 using PRIMARY (cost=0.55 rows=3)

DROP TABLE t1;
CREATE TABLE t1 (
c1 INTEGER,
c2 INTEGER
);
CREATE TABLE t2 (
c1 INTEGER,
c2 INTEGER
);
CREATE TABLE t3 (
c1 INTEGER,
c2 INTEGER
);
set optimizer_switch='block_nested_loop=on';
EXPLAIN ANALYZE SELECT /*+ NO_HASH_JOIN(t2) */ * FROM t1
JOIN t2 ON t1.c1 = t2.c2 JOIN t3 ON t2.c2 > t3.c2;
ERROR 42000: This version of MySQL doesn't yet support 'EXPLAIN ANALYZE on this query'
set optimizer_switch='block_nested_loop=off';
DROP TABLE t1, t2, t3;
#
# Bug #30444266: EXPLAIN ANALYZE DOES NOT EXECUTE THE SUBQUERIES IN THE SELECT LIST
#
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/r/with_explain.result
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ EXPLAIN
"rows_examined_per_scan": 2,
"rows_produced_per_join": 4,
"filtered": "100.00",
"using_join_buffer": "Block Nested Loop",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.40",
Expand Down Expand Up @@ -347,7 +348,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL 5 100.00 NULL
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 UNION qn NULL ALL NULL NULL NULL NULL 2 100.00 Recursive; Using where
3 UNION t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL
3 UNION t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (Block Nested Loop)
Warnings:
Note 1003 with recursive `qn` as (/* select#2 */ select cast('x' as char(100) charset utf8mb4) AS `a` union all /* select#3 */ select concat('x',`qn`.`a`) AS `concat("x",qn.a)` from `qn` join `test`.`t1` where (length(`qn`.`a`) < 10)) /* select#1 */ select `qn`.`a` AS `a` from `qn`
drop table t1;
16 changes: 8 additions & 8 deletions mysql-test/r/with_recursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,9 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL # 100.00 Using filesort
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
Warnings:
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 utf8mb4) 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`
with recursive tree_of_a as
Expand Down Expand Up @@ -1169,9 +1169,9 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
1 PRIMARY <derived2> NULL ref <auto_key0> <auto_key0> 5 const # 100.00 NULL
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
Warnings:
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 utf8mb4) 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` where (`tree_of_a`.`id` = 2)
with recursive tree_of_a as
Expand Down Expand Up @@ -2343,9 +2343,9 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL # 100.00 Using filesort
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
Warnings:
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 utf8mb4) 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`
with recursive tree_of_a as
Expand Down Expand Up @@ -2519,9 +2519,9 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
1 PRIMARY <derived2> NULL ref <auto_key0> <auto_key0> 5 const # 100.00 NULL
2 DERIVED t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
3 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
5 UNION tree_of_a NULL ALL NULL NULL NULL NULL # 100.00 Recursive
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where
5 UNION t2 NULL ALL NULL NULL NULL NULL # 10.00 Using where; Using join buffer (Block Nested Loop)
Warnings:
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 utf8mb4) 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` where (`tree_of_a`.`id` = 2)
with recursive tree_of_a as
Expand Down
207 changes: 1 addition & 206 deletions mysql-test/r/with_recursive_solver.result
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ set sql_mode = pipes_as_concat$
# A procedure is used to wrap WITH RECURSIVE, because we want to
# call the query for different input set of equations.
# Parameters: left and right member of equations, as in example above.
# This is version 1, which uses user variables in the big query
create procedure solver(initial_leftm varchar(200), initial_rightm varchar(200))
begin
declare initial_leftm_j json;
Expand Down Expand Up @@ -50,193 +49,6 @@ select n+1 from line_numbers, number_of_columns where n<(value-1)
# pivot_columns: similar.
# We must locate, in the current set of
# equations, a line/column which can be used as pivot; that is done by
# a first scalar subquery which fills user variables (named
# @cur_pivot*). If no pivot is found, the scalar subquery contains no
# rows so returns NULL which triggers the end of the algorithm.
# The second and third scalar subqueries use the @cur_pivot* set by the
# first scalar subquery block, to eliminate the unknown everywhere.
# Note that we're relying on the fact that the SELECT list items are
# evaluated left to right.

equations (null_if_done, leftm, rightm, pivot_lines, pivot_columns) as
(
select 0, initial_leftm_j, initial_rightm_j,
cast("" as char(200)), cast("" as char(200))

union all

select

(
# Locate new pivot
select
(@cur_pivot_line:=ln.n)+
(@cur_pivot_column:=cn.n)+
(@cur_pivot_value:=
# Extract the ln.n-th line of the left member, and from it, extract the
# cn.n-th column, getting a number
json_extract(json_extract(eq.leftm, "$[" || ln.n || "]"),
"$[" || cn.n || "]")
)
from line_numbers ln join column_numbers cn
where
# We're looking for lines which haven't been used as pivot yet:
find_in_set(ln.n,eq.pivot_lines)=0 and
# and in those lines, for a non-zero number which can serve as pivot:
json_extract(json_extract(eq.leftm, "$[" || ln.n || "]"),
"$[" || cn.n || "]") <> 0
# and we want the first found pivot:
limit 1
),

(
# Transform the left member

select
"[" ||

group_concat(

(
select
"[" ||

group_concat(

# numbers in the left member are changed: we substract to

json_extract(json_extract(eq.leftm, "$[" || ln.n || "]"),
"$[" || cn.n || "]")
-

# a certain number of times the number at the pivot line and at the
# same column; but only if our line isn't already a pivot line:
(case when find_in_set(ln.n,eq.pivot_lines)=0 and ln.n<>@cur_pivot_line
then json_extract(json_extract(eq.leftm, "$[" || ln.n || "]"),
"$[" || @cur_pivot_column || "]") *
json_extract(json_extract(eq.leftm, "$[" || @cur_pivot_line || "]"),
"$[" || cn.n || "]") /
@cur_pivot_value
else 0 end)
# To scan each number as we do here, we have joined with
# "column_numbers", to do the splitting; then to produce the new
# equation we have to re-concatenate, hence group_concat.
order by cn.n separator ',')
|| "]"

from column_numbers cn
)
# We have split the set first in lines, then each line in numbers;
# re-concatenate:
order by ln.n separator ',')
|| "]"

from line_numbers ln
),
(
# Transform the right member (simpler job)
select
"[" ||
group_concat(
json_extract(eq.rightm, "$[" || ln.n || "]")
-
(case when find_in_set(ln.n,eq.pivot_lines)=0 and ln.n<>@cur_pivot_line
then json_extract(json_extract(eq.leftm, "$[" || ln.n || "]"),
"$[" || @cur_pivot_column || "]") *
json_extract(eq.rightm, "$[" || @cur_pivot_line || "]") /
@cur_pivot_value
else 0 end)
order by ln.n separator ',')
|| "]"

from line_numbers
ln
),
# Remember the pivot line to make sure we don't change it again later:

@cur_pivot_line || "," || eq.pivot_lines,

@cur_pivot_column || "," || eq.pivot_columns

from equations eq

where null_if_done is not null
),

# Resolution is finished: grab the last set of equations:

final_equations as
(
select * from equations where null_if_done is null
)

# And present it to the user; it's "triangular", i.e. one unknown can
# easily be calculated, then others can be calculated by moving down
# in the equations. If the values of some unknowns can be freely
# chosen, these unknowns are shown in the 3rd column.
select
json_extract(eq.leftm, "$[" || ln.n || "]") as left_member,
json_extract(eq.rightm, "$[" || ln.n || "]") as right_member,
free.value as list_of_free_unknowns
from final_equations eq, line_numbers ln,
(
#+1 because user naturally counts from 1, not 0
select group_concat(cn.n+1) as value
from final_equations eq, column_numbers cn
where find_in_set(cn.n,eq.pivot_columns)=0
) as free
# Equations which the user should look at first are the last ones
# used as pivot as they have the least number of unknowns;
# ln.n is used to break the tie between equations which were not used
# as pivot, which gives deterministic output.
order by find_in_set(ln.n,eq.pivot_lines), ln.n;
end
$
Warnings:
Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
# Version 2: variant which uses LATERAL instead of user variables
create procedure solver2(initial_leftm varchar(200), initial_rightm varchar(200))
begin
declare initial_leftm_j json;
declare initial_rightm_j json;
set initial_leftm_j = cast(initial_leftm as json),
initial_rightm_j = cast(initial_rightm as json);
with recursive
# Number of equations
number_of_lines (value) as
(select json_length(initial_rightm_j)),
# Number of unknowns
number_of_columns (value) as
(select json_length(json_extract(initial_leftm_j,"$[0]"))),
# Sequence tables
line_numbers (n) as
(
select 0
union all
select n+1 from line_numbers, number_of_lines where n<(value-1)
),
column_numbers (n) as
(
select 0
union all
select n+1 from line_numbers, number_of_columns where n<(value-1)
),
# The recursive CTE: one row per step, a row contains the complete set of
# equations. Rows get transformed iteratively. Columns of the CTE:
# null_if_done: gets NULL when process is finished,
# leftm: left member,
# rightm: right member,
# pivot_lines: comma-separated list of number of lines which have been used as
# "pivot" (i.e. substracted to other lines to zero their numbers and
# make some unknowns disappear).
# pivot_columns: similar.
# We must locate, in the current set of
# equations, a line/column which can be used as pivot; that is done by
# a LATERAL derived table with columns named cur_pivot.*.
# If no pivot is found, the derived table is empty, and as we use a
# left join, it is NULL-complemented
Expand Down Expand Up @@ -343,6 +155,7 @@ find_in_set(ln.n,eq.pivot_lines)=0 and
json_extract(json_extract(eq.leftm, "$[" || ln.n || "]"),
"$[" || cn.n || "]") <> 0
# and we want the first found pivot:
order by cur_pivot_line,cur_pivot_column
limit 1
) as cur_pivot

Expand Down Expand Up @@ -385,39 +198,21 @@ SET @@sql_mode=@save_sql_mode$
# Unique solution
call solver("[[2,3,1], [5,-3,10], [6,0,12]]", "[7,21,28]");
left_member right_member list_of_free_unknowns
[0, -10.5, 7.5] 3.5 NULL
[0, 0, 2.571428571428571] 4 NULL
[2, 3, 1] 7 NULL
call solver2("[[2,3,1], [5,-3,10], [6,0,12]]", "[7,21,28]");
left_member right_member list_of_free_unknowns
[0, 0, 2.571428571428571] 4 NULL
[0, -10.5, 7.5] 3.5 NULL
[2, 3, 1] 7 NULL
# No solution (see "0=4" in the result)
call solver("[[1,2,1,3], [1,0,1,1], [0,1,0,1], [1,3,1,4]]", "[1,3,-1,4]");
left_member right_member list_of_free_unknowns
[0, -2, 0, -2] 2 3,4
[0, 0, 0, 0] 0 3,4
[0, 0, 0, 0] 4 3,4
[1, 2, 1, 3] 1 3,4
call solver2("[[1,2,1,3], [1,0,1,1], [0,1,0,1], [1,3,1,4]]", "[1,3,-1,4]");
left_member right_member list_of_free_unknowns
[0, 0, 0, 0] 0 3,4
[0, 0, 0, 0] 4 3,4
[0, -2, 0, -2] 2 3,4
[1, 2, 1, 3] 1 3,4
# One free unknown
call solver("[[1,2,1,3], [1,0,1,1], [0,1,0,1], [1,3,1,3]]", "[1,3,-1,4]");
left_member right_member list_of_free_unknowns
[0, -2, 0, -2] 2 3
[0, 0, 0, -1] 4 3
[0, 0, 0, 0] 0 3
[1, 2, 1, 3] 1 3
call solver2("[[1,2,1,3], [1,0,1,1], [0,1,0,1], [1,3,1,3]]", "[1,3,-1,4]");
left_member right_member list_of_free_unknowns
[0, 0, 0, 0] 0 3
[0, 0, 0, -1] 4 3
[0, -2, 0, -2] 2 3
[1, 2, 1, 3] 1 3
drop procedure solver;
drop procedure solver2;
20 changes: 0 additions & 20 deletions mysql-test/t/explain_tree.test
Original file line number Diff line number Diff line change
Expand Up @@ -428,26 +428,6 @@ EXPLAIN FORMAT=tree SELECT * FROM t1, ( SELECT f1 FROM t1 UNION ALL SELECT f1 +

DROP TABLE t1;

# EXPLAIN ANALYZE on a query the iterator executor doesn't support should give an error.
CREATE TABLE t1 (
c1 INTEGER,
c2 INTEGER
);
CREATE TABLE t2 (
c1 INTEGER,
c2 INTEGER
);
CREATE TABLE t3 (
c1 INTEGER,
c2 INTEGER
);
set optimizer_switch='block_nested_loop=on';
--error ER_NOT_SUPPORTED_YET
EXPLAIN ANALYZE SELECT /*+ NO_HASH_JOIN(t2) */ * FROM t1
JOIN t2 ON t1.c1 = t2.c2 JOIN t3 ON t2.c2 > t3.c2;
set optimizer_switch='block_nested_loop=off';
DROP TABLE t1, t2, t3;

--echo #
--echo # Bug #30444266: EXPLAIN ANALYZE DOES NOT EXECUTE THE SUBQUERIES IN THE SELECT LIST
--echo #
Expand Down
Loading

0 comments on commit 629b549

Please sign in to comment.