summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_math.test
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.test
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.test')
-rw-r--r--mysql-test/main/func_math.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/main/func_math.test b/mysql-test/main/func_math.test
index 6d28d99006a..4d65f5e00b0 100644
--- a/mysql-test/main/func_math.test
+++ b/mysql-test/main/func_math.test
@@ -589,6 +589,44 @@ INSERT INTO t1 VALUES (1),(2);
SELECT STDDEV_SAMP(ROUND('0', 309)) FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal
+--echo #
+
+--echo # Testing that dyadic arithmetic operations are symmetric
+--echo # for (+1) and (-1) and produce the same length in CONCAT(),
+--echo # 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;
+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;
+DROP TABLE t1;
+
+
--echo #
--echo # End of 5.5 tests
--echo #