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
Bug#35738548: SEGV (Item_ref::real_item() at sql/item.h:5825)
found by fuzzing tool
Bug#35779012: SEGV (Item_subselect::print() at
sql/item_subselect.cc:835) found by fuzzing tool
Bug#35733778: SEGV (Item_subselect::exec() at
sql/item_subselect.cc:660) found by fuzzing tool
Bug#35738531: Another SEGV (Item_subselect::exec() at
sql/item_subselect.cc:660) found by fuzzing tool
If an Item_ref object is referenced from multiple
places in a query block, and if the item that it
refers to is also referenced from multiple places,
there is a chance that while removing redundant
expressions, we could end up removing the
referenced item even though it is still being
referred to.
E.g. while resolving ORDER BY clause, if the
expression is found in the select list, expression
used in order by is removed and it starts
using the one in select list. When this happens,
while removing the redundant expressions from the
query block, if the select expression is an
Item_ref object, on the first visit to this
expression, we mark the object as unlinked. On
the second visit, this time because of the
order by, as the object is marked as unlinked,
it exits the traversal without doing anything. However,
when the item it refers to is visited, it does not
know that the item is still being referred to. So
it ends up deleting the referenced item.
Solution is to decrement the ref_count of
an item without initiating the clean up
of the underlying item unless its the last
reference (This necessitated changes to
all implementations of clean_up_after_removal).
Along with this we also remove m_unlinked member
because it's no more needed. If the underlying
item of an Item_ref object is not abandoned, we
decrement the ref count and stop looking further.
Change-Id: I4ef3aaf92a8c0961a541dae09c766929d93bb64e
0 commit comments