diff options
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6ded046ccbf..523358b780e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -704,8 +704,11 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, my_error(ER_WRONG_COLUMN_NAME,MYF(0),item->name); DBUG_RETURN(0); } - - Field *field=create_tmp_field(thd, &tmp_table, item, item->type(), + Field *field; + if (item->type() == Item::FUNC_ITEM) + field=item->tmp_table_field(&tmp_table); + else + field=create_tmp_field(thd, &tmp_table, item, item->type(), (Item_result_field***) 0, &tmp_field,0,0); if (!field || !(cr_field=new create_field(field,(item->type() == Item::FIELD_ITEM ? |