Commit 3ceb45f1 authored by unknown's avatar unknown

Final patch to the bug #11314 (HAVING DEFAULT hangs)


sql/item.cc:
  it's safer not to reassign arg member
parent d3c3d64a
......@@ -4443,6 +4443,7 @@ bool Item_default_value::fix_fields(THD *thd,
struct st_table_list *table_list,
Item **items)
{
Item *real_arg;
Item_field *field_arg;
Field *def_field;
DBUG_ASSERT(fixed == 0);
......@@ -4455,14 +4456,14 @@ bool Item_default_value::fix_fields(THD *thd,
if (!arg->fixed && arg->fix_fields(thd, table_list, &arg))
return TRUE;
arg= arg->real_item();
if (arg->type() != FIELD_ITEM)
real_arg= arg->real_item();
if (real_arg->type() != FIELD_ITEM)
{
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), arg->name);
return TRUE;
}
field_arg= (Item_field *)arg;
field_arg= (Item_field *)real_arg;
if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG)
{
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), field_arg->field->field_name);
......
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