summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_math.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/func_math.test')
-rw-r--r--mysql-test/t/func_math.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index e67f5f29e3a..91fdce8addb 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -269,6 +269,15 @@ SELECT a, ROUND(a) FROM t1;
DROP TABLE t1;
+#
+# Bug#45152 crash with round() function on longtext column in a derived table
+#
+CREATE TABLE t1(f1 LONGTEXT) engine=myisam;
+INSERT INTO t1 VALUES ('a');
+SELECT 1 FROM (SELECT ROUND(f1) AS a FROM t1) AS s WHERE a LIKE 'a';
+SELECT 1 FROM (SELECT ROUND(f1, f1) AS a FROM t1) AS s WHERE a LIKE 'a';
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
@@ -282,4 +291,22 @@ SELECT 1e300 / 1e-300;
SELECT EXP(750);
SELECT POW(10, 309);
+--echo #
+--echo # Bug #44768: SIGFPE crash when selecting rand from a view
+--echo # containing null
+--echo #
+
+CREATE OR REPLACE VIEW v1 AS SELECT NULL AS a;
+SELECT RAND(a) FROM v1;
+DROP VIEW v1;
+
+SELECT RAND(a) FROM (SELECT NULL AS a) b;
+
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (NULL);
+SELECT RAND(i) FROM t1;
+DROP TABLE t1;
+
+--echo #
+
--echo End of 5.1 tests