Commit f183b1be authored by hf@deer.(none)'s avatar hf@deer.(none)

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

parent 8cc5f88b
...@@ -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