From 5d7b97b89ec2073bd8dffead6adb895cf1b15adc Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 16 Sep 2013 10:14:41 +0400 Subject: MDEV-4843 Wrong data type for TIMESTAMP('2001-01-01','10:10:10') --- sql/item_timefunc.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/item_timefunc.cc') diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 1f6bff6fa6c..37a9a42f392 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2435,7 +2435,8 @@ void Item_func_add_time::fix_length_and_dec() arg0_field_type= args[0]->field_type(); if (arg0_field_type == MYSQL_TYPE_DATE || arg0_field_type == MYSQL_TYPE_DATETIME || - arg0_field_type == MYSQL_TYPE_TIMESTAMP) + arg0_field_type == MYSQL_TYPE_TIMESTAMP || + is_date) { cached_field_type= MYSQL_TYPE_DATETIME; decimals= max(args[0]->temporal_precision(MYSQL_TYPE_DATETIME), -- cgit v1.2.1