diff options
author | Martin Hansson <martin.hansson@oracle.com> | 2011-01-12 10:31:41 +0100 |
---|---|---|
committer | Martin Hansson <martin.hansson@oracle.com> | 2011-01-12 10:31:41 +0100 |
commit | 2fbee31f12c1788de03495c1e35544ec4383df8a (patch) | |
tree | 55390cccdb62f3abb6c8a86a5825669b8a93ca4c /sql/sql_select.cc | |
parent | 4e41f5352f880daa93199b240c89331faf3205b9 (diff) | |
parent | 3c5662c1951f59295a41b05274ed0be793b01843 (diff) | |
download | mariadb-git-2fbee31f12c1788de03495c1e35544ec4383df8a.tar.gz |
Merge of fix for Bug#58207.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index be23443bcc0..91ce31636b4 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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; } |