summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_math.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-09-24 23:05:09 +0400
committerAlexander Barkov <bar@mariadb.com>2019-09-24 23:05:09 +0400
commitb6bb64e54a3e34a20cda34e25b6ec62a097955ef (patch)
tree70fc710317991ae4892c57f179759ed3147d3d47 /mysql-test/main/func_math.result
parent0e50ee6f28ca709c3ab8d143360faca182e74db4 (diff)
parent102bc7beb080e936ba70c0524a8759799f42458e (diff)
downloadmariadb-git-b6bb64e54a3e34a20cda34e25b6ec62a097955ef.tar.gz
Merge remote-tracking branch 'origin/10.2' into 10.3
Diffstat (limited to 'mysql-test/main/func_math.result')
-rw-r--r--mysql-test/main/func_math.result58
1 files changed, 58 insertions, 0 deletions
diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result
index 44c8622b522..968d394117a 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -817,6 +817,64 @@ STDDEV_SAMP(ROUND('0', 309))
0
DROP TABLE t1;
#
+# MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal
+#
+# Testing that dyadic arithmetic operations are symmetric
+# for (+1) and (-1) and produce the same length in CONCAT(),
+# because (+1) and (-1) have the same data type: signed int.
+CREATE TABLE t1 AS SELECT
+CONCAT(+1%2.0),
+CONCAT(-1%2.0),
+CONCAT(+1/2.0),
+CONCAT(-1/2.0),
+CONCAT(+1*2.0),
+CONCAT(-1*2.0),
+CONCAT(+1+2.0),
+CONCAT(-1+2.0),
+CONCAT(+1-2.0),
+CONCAT(-1-2.0);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONCAT(+1%2.0)` varchar(4) DEFAULT NULL,
+ `CONCAT(-1%2.0)` varchar(4) DEFAULT NULL,
+ `CONCAT(+1/2.0)` varchar(8) DEFAULT NULL,
+ `CONCAT(-1/2.0)` varchar(8) DEFAULT NULL,
+ `CONCAT(+1*2.0)` varchar(5) DEFAULT NULL,
+ `CONCAT(-1*2.0)` varchar(5) DEFAULT NULL,
+ `CONCAT(+1+2.0)` varchar(5) DEFAULT NULL,
+ `CONCAT(-1+2.0)` varchar(5) DEFAULT NULL,
+ `CONCAT(+1-2.0)` varchar(5) DEFAULT NULL,
+ `CONCAT(-1-2.0)` varchar(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+CONCAT(+1%2),
+CONCAT(-1%2),
+CONCAT(+1/2),
+CONCAT(-1/2),
+CONCAT(+1*2),
+CONCAT(-1*2),
+CONCAT(+1+2),
+CONCAT(-1+2),
+CONCAT(+1-2),
+CONCAT(-1-2);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONCAT(+1%2)` varchar(2) DEFAULT NULL,
+ `CONCAT(-1%2)` varchar(2) DEFAULT NULL,
+ `CONCAT(+1/2)` varchar(7) DEFAULT NULL,
+ `CONCAT(-1/2)` varchar(7) DEFAULT NULL,
+ `CONCAT(+1*2)` varchar(3) DEFAULT NULL,
+ `CONCAT(-1*2)` varchar(3) DEFAULT NULL,
+ `CONCAT(+1+2)` varchar(3) DEFAULT NULL,
+ `CONCAT(-1+2)` varchar(3) DEFAULT NULL,
+ `CONCAT(+1-2)` varchar(3) DEFAULT NULL,
+ `CONCAT(-1-2)` varchar(3) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
# End of 5.5 tests
#
#