summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_math.result13
-rw-r--r--mysql-test/t/func_math.test9
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index ac9a22a0b82..31648aae7b0 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -501,6 +501,19 @@ SHOW WARNINGS;
Level Code Message
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
+#
+# Bug#57810 case/when/then : Assertion failed: length || !scale
+#
+SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
+CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END
+NULL
+CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `C` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
End of 5.1 tests
#
# Bug #8433: Overflow must be an error
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 7f9ed6d8a93..b089d10a33b 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -336,6 +336,15 @@ select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
SHOW WARNINGS;
+--echo #
+--echo # Bug#57810 case/when/then : Assertion failed: length || !scale
+--echo #
+
+SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
+CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
--echo #