diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:39:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:39:13 +0000 |
commit | 86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch) | |
tree | 28c9e526ea739c6f9b89e36115e1e2698bddf981 /mysql-test/main/func_replace.result | |
parent | Releasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff) | |
download | mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip |
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/func_replace.result')
-rw-r--r-- | mysql-test/main/func_replace.result | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/mysql-test/main/func_replace.result b/mysql-test/main/func_replace.result new file mode 100644 index 00000000..7f354d52 --- /dev/null +++ b/mysql-test/main/func_replace.result @@ -0,0 +1,124 @@ +# +# Start of 10.5 tests +# +# +# MDEV-17226 Column Data in Truncated on UNION to the length of the first value if using REPLACE +# +CREATE TABLE t1 ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT, +col1 VARCHAR (2), +col2 VARCHAR (2), +PRIMARY KEY (id) +); +CREATE TABLE t2 ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT, +col1 VARCHAR (1), +col2 VARCHAR (2), +PRIMARY KEY (id) +); +INSERT INTO t1 (col1, col2) VALUES ("a", "ba"); +INSERT INTO t2 (col1, col2) VALUES ("a", "ba"); +SELECT 'a' UNION ALL SELECT REPLACE('a', col1, col2) FROM t1; +a +a +ba +SELECT 'a' UNION ALL SELECT REPLACE('a', col1, col2) FROM t2; +a +a +ba +SELECT REPLACE('z', col1, col2) FROM t1 UNION ALL SELECT REPLACE('a', col1, col2) FROM t1; +REPLACE('z', col1, col2) +z +ba +SELECT REPLACE('z', col1, col2) FROM t2 UNION ALL SELECT REPLACE('a', col1, col2) FROM t2; +REPLACE('z', col1, col2) +z +ba +DROP TABLE t1, t2; +CREATE TABLE t1 ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT, +col1 VARCHAR (2), +col2 VARCHAR (2), +PRIMARY KEY (id) +); +INSERT INTO t1 (col1, col2) VALUES ('a', 'ba'); +SELECT REPLACE('a', col1, col2) FROM t1; +REPLACE('a', col1, col2) +ba +CREATE TABLE t2 AS SELECT 'a' UNION ALL SELECT REPLACE('a', col1, col2) FROM t1; +SELECT * FROM t2; +a +a +ba +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t1, t2; +CREATE TABLE t1 ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT, +col1 VARCHAR (1), +col2 VARCHAR (10), +PRIMARY KEY (id) +); +INSERT INTO t1 (col1, col2) VALUES ('a', '0123456789'); +SELECT REPLACE('aa', col1, col2) FROM t1; +REPLACE('aa', col1, col2) +01234567890123456789 +CREATE TABLE t2 AS SELECT 'a' UNION ALL SELECT REPLACE('aa', col1, col2) FROM t1; +SELECT * FROM t2; +a +a +01234567890123456789 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t1, t2; +CREATE TABLE t1 ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT, +col1 VARCHAR (1), +col2 VARCHAR (20), +PRIMARY KEY (id) +); +INSERT INTO t1 (col1, col2) VALUES ('a', 'aaaaaaaaaabbbbbbbbbb'); +SELECT REPLACE('aa', col1, col2) FROM t1; +REPLACE('aa', col1, col2) +aaaaaaaaaabbbbbbbbbbaaaaaaaaaabbbbbbbbbb +CREATE TABLE t2 AS SELECT 'a' UNION ALL SELECT REPLACE('aa', col1, col2) FROM t1; +SELECT * FROM t2; +a +a +aaaaaaaaaabbbbbbbbbbaaaaaaaaaabbbbbbbbbb +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(40) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t1, t2; +CREATE TABLE t1 ( +id INT UNSIGNED NOT NULL AUTO_INCREMENT, +col1 VARCHAR (1), +col2 VARCHAR (30), +PRIMARY KEY (id) +); +INSERT INTO t1 (col1, col2) VALUES ('a', 'aaaaaaaaaabbbbbbbbbbcccccccccc'); +SELECT REPLACE('aaa', col1, col2) FROM t1; +REPLACE('aaa', col1, col2) +aaaaaaaaaabbbbbbbbbbccccccccccaaaaaaaaaabbbbbbbbbbccccccccccaaaaaaaaaabbbbbbbbbbcccccccccc +CREATE TABLE t2 AS SELECT 'a' UNION ALL SELECT REPLACE('aaa', col1, col2) FROM t1; +SELECT * FROM t2; +a +a +aaaaaaaaaabbbbbbbbbbccccccccccaaaaaaaaaabbbbbbbbbbccccccccccaaaaaaaaaabbbbbbbbbbcccccccccc +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(90) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t1, t2; +# +# End of 10.5 tests +# |