summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-04-17 20:21:11 +0400
committerAlexander Barkov <bar@mariadb.com>2019-04-17 20:21:11 +0400
commit0bb924e18c338fa2dc901041aad09998b399efc1 (patch)
tree1d085472927f26a89d656a87d0ff3982958fa2de /mysql-test
parent409dddf6958736d65ee77aa9b469f8b807da3bb1 (diff)
downloadmariadb-git-0bb924e18c338fa2dc901041aad09998b399efc1.tar.gz
MDEV-17830 Server crashes in Item_null_result::field_type upon SELECT with CHARSET(date) and ROLLUP
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/olap.result14
-rw-r--r--mysql-test/t/olap.test15
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 24140583d13..84c54c0c3c7 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -786,5 +786,19 @@ t COUNT(*)
12:12:13 1
DROP TABLE t1;
#
+# MDEV-17830 Server crashes in Item_null_result::field_type upon SELECT with CHARSET(date) and ROLLUP
+#
+# Note, returning "latin1" in the first row vs "binary" in the second row is wrong here.
+# Both lines should return equal values.
+# The point in this test is to make sure it does not crash.
+# Bad result will be fixed in a later version.
+CREATE TABLE t (d DATE) ENGINE=MyISAM;
+INSERT INTO t VALUES ('2018-12-12');
+SELECT CHARSET(d) AS f FROM t GROUP BY d WITH ROLLUP;
+f
+latin1
+binary
+DROP TABLE t;
+#
# End of 10.1 tests
#
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
index 4a61cebdc0d..bb7806969d3 100644
--- a/mysql-test/t/olap.test
+++ b/mysql-test/t/olap.test
@@ -425,5 +425,20 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-17830 Server crashes in Item_null_result::field_type upon SELECT with CHARSET(date) and ROLLUP
+--echo #
+
+--echo # Note, returning "latin1" in the first row vs "binary" in the second row is wrong here.
+--echo # Both lines should return equal values.
+--echo # The point in this test is to make sure it does not crash.
+--echo # Bad result will be fixed in a later version.
+
+CREATE TABLE t (d DATE) ENGINE=MyISAM;
+INSERT INTO t VALUES ('2018-12-12');
+SELECT CHARSET(d) AS f FROM t GROUP BY d WITH ROLLUP;
+DROP TABLE t;
+
+
+--echo #
--echo # End of 10.1 tests
--echo #