From 2ae4b047a3d9c4236ebd157ef8ee4bf084d4629b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Dec 2007 12:44:24 +0200 Subject: Bug #33256: CREATE ... SELECT creates obsolete table w/ Field_date instead of Field_newdate Field_date was still used in temp table creation. Fixed by using Field_newdate consistently throughout the server except when reading tables defined with older MySQL version. No test suite is possible because both Field_date and Field_newdate return the same values in all the metadata calls. mysql-test/r/type_decimal.result: Bug #33256: removed redundant warnings sql/field.h: Bug #33256: Add a constructor similar to Field_date::Field_date() sql/item.cc: Bug #33256: Use Field_newdate instead of Field_date for all temp tables and CREATE .. SELECT sql/item_sum.cc: Bug #33256: Use Field_newdate instead of Field_date for all temp tables and CREATE .. SELECT sql/item_timefunc.cc: Bug #33256: Use Field_newdate instead of Field_date for all temp tables and CREATE .. SELECT sql/item_timefunc.h: Bug #33256: Use Field_newdate instead of Field_date for all temp tables and CREATE .. SELECT --- sql/item_timefunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/item_timefunc.cc') diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 04060d190a0..0cb3c963dad 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -3303,7 +3303,7 @@ Field *Item_func_str_to_date::tmp_table_field(TABLE *t_arg) if (cached_field_type == MYSQL_TYPE_TIME) return (new Field_time(maybe_null, name, t_arg, &my_charset_bin)); if (cached_field_type == MYSQL_TYPE_DATE) - return (new Field_date(maybe_null, name, t_arg, &my_charset_bin)); + return (new Field_newdate(maybe_null, name, t_arg, &my_charset_bin)); if (cached_field_type == MYSQL_TYPE_DATETIME) return (new Field_datetime(maybe_null, name, t_arg, &my_charset_bin)); return (new Field_string(max_length, maybe_null, name, t_arg, &my_charset_bin)); -- cgit v1.2.1