From d3d3a4b834db8efc558b71066870b07efe1f2976 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 24 Apr 2014 16:59:01 +0400 Subject: MDEV-4511 Assertion `scale <= precision' fails on GROUP BY TIMEDIFF with incorrect types --- sql/item_timefunc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/item_timefunc.h') diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 8f881487e21..29badddad8e 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -809,7 +809,7 @@ public: bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); void fix_length_and_dec() { - decimals= args[0]->decimals; + decimals= MY_MIN(args[0]->decimals, TIME_SECOND_PART_DIGITS); Item_timefunc::fix_length_and_dec(); } const char *func_name() const { return "sec_to_time"; } -- cgit v1.2.1