summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@oracle.com>2011-01-12 10:31:41 +0100
committerMartin Hansson <martin.hansson@oracle.com>2011-01-12 10:31:41 +0100
commit2fbee31f12c1788de03495c1e35544ec4383df8a (patch)
tree55390cccdb62f3abb6c8a86a5825669b8a93ca4c /sql/sql_select.cc
parent4e41f5352f880daa93199b240c89331faf3205b9 (diff)
parent3c5662c1951f59295a41b05274ed0be793b01843 (diff)
downloadmariadb-git-2fbee31f12c1788de03495c1e35544ec4383df8a.tar.gz
Merge of fix for Bug#58207.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc7
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;
}