Skip to content

Commit bb074b2

Browse files
MDEV-37905: UNCACHEABLE_RAND inconsistently set on unions
We need to ensure that all the unions are marked as UNCACHEABLE_RAND in cases like: select * from t1 where 1 in (select 1 union select 2 union select RAND());
1 parent 49c3c2a commit bb074b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sql/sql_lex.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11351,6 +11351,7 @@ SELECT_LEX_UNIT *LEX::parsed_select_expr_cont(SELECT_LEX_UNIT *unit,
1135111351
}
1135211352
last->link_neighbour(sel1);
1135311353
sel1->set_master_unit(unit);
11354+
unit->uncacheable |= sel1->uncacheable;
1135411355
sel1->set_linkage_and_distinct(unit_type, distinct);
1135511356
unit->pre_last_parse= last;
1135611357
return unit;

0 commit comments

Comments
 (0)