From be22d1ff39e79a9dbd5360f2f11b57de291d5366 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 5 Jul 2019 12:06:34 +0400 Subject: Adding tests for MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY (they were forgotten in the previous commit) --- mysql-test/r/type_datetime.result | 10 ++++++++++ mysql-test/t/type_datetime.test | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index bf09ec8d0eb..292c92422de 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1146,5 +1146,15 @@ a 00:01:00 DROP TABLE t1; # +# MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY +# +CREATE TABLE t1 (i INT, d DATETIME); +INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04:47'); +SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i; +ExtractValue('foo','bar') i MIN(d) + NULL 1981-09-24 01:04:47 + 3 1976-12-14 13:21:07 +DROP TABLE t1; +# # End of 10.1 tests # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index f16613d18a1..726510b74e8 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -700,6 +700,16 @@ SELECT 1 FROM t1 WHERE 20160101 > SOME (SELECT CAST(a AS DATETIME) FROM t1); SELECT * FROM t1 WHERE 20160101 > CAST(a AS DATETIME); DROP TABLE t1; + +--echo # +--echo # MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY +--echo # + +CREATE TABLE t1 (i INT, d DATETIME); +INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04:47'); +SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # -- cgit v1.2.1