diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-08-08 17:08:56 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-08-08 17:08:56 +0400 |
commit | c3d67c17c150b06f79f2d4935933ebb6ecc4f644 (patch) | |
tree | 8bb49a4ce4bb3ae2f1c787fcd4b46bdcb41e7784 /mysql-test | |
parent | e555df648c5c81f51be2e574627f6327099516ba (diff) | |
download | mariadb-git-c3d67c17c150b06f79f2d4935933ebb6ecc4f644.tar.gz |
MDEV-20292 REPEAT(x,-1) returns a wrong data type
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/func_str.result | 16 | ||||
-rw-r--r-- | mysql-test/main/func_str.test | 13 |
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result index 22cf0a5cc56..eb00837eaaf 100644 --- a/mysql-test/main/func_str.result +++ b/mysql-test/main/func_str.result @@ -5068,5 +5068,21 @@ NULL DROP TABLE t1; # +# MDEV-20292 REPEAT(x,-1) returns a wrong data type +# +CREATE OR REPLACE TABLE t1 (i BIGINT); +INSERT INTO t1 VALUES (42); +CREATE OR REPLACE TABLE t2 AS SELECT +REPEAT(i,0) AS c0, +REPEAT(i,-1) AS c1 +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c0` char(0) CHARACTER SET utf8 DEFAULT NULL, + `c1` char(0) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +# # End of 10.3 tests # diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test index c122516d756..135d00bcd8c 100644 --- a/mysql-test/main/func_str.test +++ b/mysql-test/main/func_str.test @@ -2028,6 +2028,19 @@ SELECT LPAD( c, 0, '?' ) FROM t1; SELECT RPAD( c, 0, '?' ) FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-20292 REPEAT(x,-1) returns a wrong data type +--echo # + +CREATE OR REPLACE TABLE t1 (i BIGINT); +INSERT INTO t1 VALUES (42); +CREATE OR REPLACE TABLE t2 AS SELECT + REPEAT(i,0) AS c0, + REPEAT(i,-1) AS c1 +FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; + --echo # --echo # End of 10.3 tests |