From 8b7fd8f577fe3edc84eea54288c7d30775a1559b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 8 Mar 2011 19:41:58 +0100 Subject: lp:731124 Loss of precision on DISTINCT many changes: * NOT_FIXED_DEC now create hires fields, not old ones. As a result, temp tables preserve microseconds (on DISTINCT, GROUP BY) * I_S tables force decimals=0 on temporal types (backward compatibility) * Item_func_coalesce calculates decimals for temporal types * no precision for TIME/DATETIME in CAST means 0, not NOT_FIXED_DEC * addtime/timediff calculate decimals from arguments (not NOT_FIXED_DEC) sql/field.h: NOT_FIXED_DEC now create hires fields, not old ones sql/item.h: force decimals=0 for I_S tables sql/item_cmpfunc.cc: Item_func_coalesce calculates decimals for temporal types sql/item_create.cc: no precision for TIME/DATETIME in CAST means 0, not NOT_FIXED_DEC sql/item_timefunc.cc: addtime calculates decimals from arguments (not NOT_FIXED_DEC) sql/item_timefunc.h: timediff calculates decimals from arguments (not NOT_FIXED_DEC) --- sql/item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/item.h') diff --git a/sql/item.h b/sql/item.h index 0be8312750d..af0f3d1c024 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2075,7 +2075,7 @@ public: enum_field_types field_type_arg) :Item_partition_func_safe_string(name_arg, length_arg, &my_charset_bin), date_time_field_type(field_type_arg) - { } + { decimals= 0; } enum_field_types field_type() const { return date_time_field_type; } }; -- cgit v1.2.1