You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an invariant in Item_in_optimizer which is violated by the
tree rewriting done for ROLLUP. Quote from Item_in_optimizer's class
Doxygen:
args[0] is a copy of Item_in_subselect's left expression and should be
kept equal also after resolving.
ROLLUP replaces arg[0] with an Item_ref in SELECT_LEX::change_group_ref:
"Replace occurrences of group by fields in an expression by ref items.
The function replaces occurrences of group by fields in expr
by ref objects for these fields unless they are under aggregate
functions."
This replacement fails to update Item_in_subselect's left
expression. This lack of synchronization leads to an error by going
down the wrong code path based on the incorrect state in left.
The fix is to make sure Item_in_subselect's arg[0] stays in synch with
the Item_in_subselect's left expression. It also makes sure the cache
of the old item now uses the new.
Regression test added.
0 commit comments