diff options
-rw-r--r-- | mysql-test/r/func_time.result | 4 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index f398e2b4962..56ea72a8ee3 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1242,3 +1242,7 @@ t1 t2 SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ) QUARTER(d) 11:00:00 11:15:00 00:15:00 1 10:00:00 NULL NULL NULL DROP TABLE t1; +SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SELECT 3020398 ) x GROUP BY 1; +TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") +838:59:58 +838:59:59 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index e08a7edb2bf..da909dc578f 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -745,3 +745,10 @@ SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) FROM t1 ORDER BY a DESC; DROP TABLE t1; + +# +# Bug #20293: group by cuts off value from time_format +# +# Check if using GROUP BY with TIME_FORMAT() produces correct results + +SELECT TIME_FORMAT(SEC_TO_TIME(a),"%H:%i:%s") FROM (SELECT 3020399 AS a UNION SELECT 3020398 ) x GROUP BY 1; |