1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge of fix for Bug#58207.

This commit is contained in:
Martin Hansson
2011-01-12 10:31:41 +01:00
3 changed files with 27 additions and 1 deletions

View File

@ -10042,7 +10042,12 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
convert_blob_length);
if (orig_type == Item::REF_ITEM && orig_modify)
((Item_ref*)orig_item)->set_result_field(result);
if (field->field->eq_def(result))
/*
Fields that are used as arguments to the DEFAULT() function already have
their data pointers set to the default value during name resulotion. See
Item_default_value::fix_fields.
*/
if (orig_type != Item::DEFAULT_VALUE_ITEM && field->field->eq_def(result))
*default_field= field->field;
return result;
}