Commit 4155d140 authored by aelkin@mysql.com's avatar aelkin@mysql.com

BUG#17265 Assertion failure in rpl_row_view01.

To quote Timour review lines:

The actual cause of the bug is that sql_base.cc:setup_wild()
sets "select_lex->with_wild = 0" (in the end of the function) once
it expands all wild-cards, and wild-card expansion is done during
the prepare phase. During this phase we replace all "*" with the
corresponding items, which for views happen to be references to
references. When we do execute, select_lex->with_wild = 0, and
all "*" are already replaced by the corresponding items, which
in the case of views need to be dereferenced first.

Fixed by refining the assert. Regression test for the bug is rpl_row_view01,
as was reported.
parent 7182785f
......@@ -5116,9 +5116,9 @@ bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
if (item_ref->ref_type() == VIEW_REF)
{
Item *item_ref_ref= *(item_ref->ref);
DBUG_ASSERT((*ref)->type() == FIELD_ITEM &&
(item_ref_ref->type() == FIELD_ITEM));
return (*ref == item_ref_ref);
DBUG_ASSERT((*ref)->real_item()->type() == FIELD_ITEM &&
(item_ref_ref->real_item()->type() == FIELD_ITEM));
return ((*ref)->real_item() == item_ref_ref->real_item());
}
}
return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment