diff options
-rw-r--r-- | mysql-test/r/type_decimal.result | 4 | ||||
-rw-r--r-- | sql/field.h | 4 | ||||
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/item_sum.cc | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index e37a398d22e..a25ffc4c6fc 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -786,10 +786,6 @@ from (select 1 as s,'t' as t union select null, null ) as sub1; select group_concat(t) from t1 group by week(date)/10; group_concat(t) t -Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00' -Warning 1292 Incorrect datetime value: '0000-00-00' -Warning 1292 Incorrect datetime value: '0000-00-00' drop table t1; CREATE TABLE t1 ( qty decimal(16,6) default NULL, diff --git a/sql/field.h b/sql/field.h index dc4f1b13cb5..365072a4eec 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1269,6 +1269,10 @@ public: :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, cs) {} + Field_newdate(bool maybe_null_arg, const char *field_name_arg, + struct st_table *table_arg, CHARSET_INFO *cs) + :Field_str((char*) 0,10, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg, table_arg, cs) {} enum_field_types type() const { return MYSQL_TYPE_DATE;} enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; } diff --git a/sql/item.cc b/sql/item.cc index a8b17a5ca12..922c3b7a976 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4467,7 +4467,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length) break; case MYSQL_TYPE_NEWDATE: case MYSQL_TYPE_DATE: - field= new Field_date(maybe_null, name, &my_charset_bin); + field= new Field_newdate(maybe_null, name, &my_charset_bin); break; case MYSQL_TYPE_TIME: field= new Field_time(maybe_null, name, &my_charset_bin); diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 733b6e1e460..881f472d766 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -633,7 +633,7 @@ Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table, */ switch (args[0]->field_type()) { case MYSQL_TYPE_DATE: - field= new Field_date(maybe_null, name, collation.collation); + field= new Field_newdate(maybe_null, name, collation.collation); break; case MYSQL_TYPE_TIME: field= new Field_time(maybe_null, name, collation.collation); |