summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2001-12-29 15:15:51 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2001-12-29 15:15:51 +0200
commit6ffd555155360ad13ab9bf1f8b050f3d46edb17d (patch)
treee570d4c59b3a7727411fc9c0a6fe51a149353d6f /sql/sql_table.cc
parentc865e96362b75d1d59ac31c9a2fd34ee1ccdf058 (diff)
downloadmariadb-git-6ffd555155360ad13ab9bf1f8b050f3d46edb17d.tar.gz
Code that had to be changed so that CREATE ... SELECT ... always
creates proper column types, out of any function, expression or from other tables. mysql-test/r/create.result: This is a result for the test which creates all proper column types out of CREATE ... SELECT ...
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc7
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 ?