From 496bc77694abe410bed1968fc34cf685d765131f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Oct 2003 17:54:32 -0400 Subject: [PATCH] Fixed bug #1323 (varchar fields becoming char fields adter create ... select) --- mysql-test/r/create.result | 2 +- sql/sql_select.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index e6192eb6ccb..7b784e3c3ee 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -78,7 +78,7 @@ Field Type Null Key Default Extra x varchar(50) YES NULL describe t2; Field Type Null Key Default Extra -x char(50) YES NULL +x varchar(50) YES NULL drop table t2; create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f; describe t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 53c41482a36..bffe3cd7968 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3706,6 +3706,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, new_field->field_name=item->name; if (org_field->maybe_null()) new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join + if (org_field->type()==FIELD_TYPE_VAR_STRING) + table->db_create_options|= HA_OPTION_PACK_RECORD; } return new_field; }