Commit d5600efd 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 38cf7770
...@@ -4443,6 +4443,7 @@ bool Item_default_value::fix_fields(THD *thd, ...@@ -4443,6 +4443,7 @@ bool Item_default_value::fix_fields(THD *thd,
struct st_table_list *table_list, struct st_table_list *table_list,
Item **items) Item **items)
{ {
Item *real_arg;
Item_field *field_arg; Item_field *field_arg;
Field *def_field; Field *def_field;
DBUG_ASSERT(fixed == 0); DBUG_ASSERT(fixed == 0);
...@@ -4455,14 +4456,14 @@ bool Item_default_value::fix_fields(THD *thd, ...@@ -4455,14 +4456,14 @@ bool Item_default_value::fix_fields(THD *thd,
if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) if (!arg->fixed && arg->fix_fields(thd, table_list, &arg))
return TRUE; return TRUE;
arg= arg->real_item(); real_arg= arg->real_item();
if (arg->type() != FIELD_ITEM) if (real_arg->type() != FIELD_ITEM)
{ {
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), arg->name); my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), arg->name);
return TRUE; return TRUE;
} }
field_arg= (Item_field *)arg; field_arg= (Item_field *)real_arg;
if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG) if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG)
{ {
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), field_arg->field->field_name); 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