diff options
author | Alexander Barkov <bar@mariadb.com> | 2023-04-05 15:42:27 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2023-04-05 16:16:19 +0400 |
commit | 62e137d4d739fcba6810a66242175230e8170727 (patch) | |
tree | 3d277e4400c735ff13f84870fd09d808b7311d8e /mysql-test/main | |
parent | afdf19cf3303bf3797fe47e5cef398227134cc32 (diff) | |
parent | 06393cd8f81e6c9a01e9ae1c8783a7f6dac21fbd (diff) | |
download | mariadb-git-62e137d4d739fcba6810a66242175230e8170727.tar.gz |
Merge remote-tracking branch 'origin/10.4' into 10.5
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/ctype_utf8_uca.result | 148 | ||||
-rw-r--r-- | mysql-test/main/ctype_utf8_uca.test | 18 |
2 files changed, 166 insertions, 0 deletions
diff --git a/mysql-test/main/ctype_utf8_uca.result b/mysql-test/main/ctype_utf8_uca.result index 7475eb5d8c9..dee65b04c1a 100644 --- a/mysql-test/main/ctype_utf8_uca.result +++ b/mysql-test/main/ctype_utf8_uca.result @@ -761,3 +761,151 @@ DROP TABLE case_folding; # # End of 10.3 tests # +# +# Start of 10.4 tests +# +SET DEFAULT_STORAGE_ENGINE=MyISAM; +SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci; +# +# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations +# +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a TEXT COLLATE <COLLATION>,' + 'UNIQUE(a(3)))', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a TEXT COLLATE <COLLATION>,' + 'UNIQUE(a(3)) USING HASH)', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE <COLLATION>,' + 'UNIQUE(a(3)))', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE <COLLATION>,' + 'UNIQUE(a(3)) USING HASH)', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE <COLLATION>,' + 'UNIQUE(a(3)) USING HASH)', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +SET DEFAULT_STORAGE_ENGINE=HEAP; +# +# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations +# +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE <COLLATION>,' + 'UNIQUE(a(3)))', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE <COLLATION>,' + 'UNIQUE(a(3)) USING HASH)', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE <COLLATION>,' + 'UNIQUE(a(3)))', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE <COLLATION>,' + 'UNIQUE(a(3)) USING HASH)', +'<COLLATION>', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +SET DEFAULT_STORAGE_ENGINE=DEFAULT; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/ctype_utf8_uca.test b/mysql-test/main/ctype_utf8_uca.test index 38bcce8f4ba..6361bd32a4a 100644 --- a/mysql-test/main/ctype_utf8_uca.test +++ b/mysql-test/main/ctype_utf8_uca.test @@ -50,3 +50,21 @@ SET NAMES utf8mb3 COLLATE utf8mb3_thai_520_w2; --echo # --echo # End of 10.3 tests --echo # + + +--echo # +--echo # Start of 10.4 tests +--echo # + +SET DEFAULT_STORAGE_ENGINE=MyISAM; +SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci; +--source include/ctype_nopad_prefix_unique.inc + +SET DEFAULT_STORAGE_ENGINE=HEAP; +--source include/ctype_nopad_prefix_unique.inc + +SET DEFAULT_STORAGE_ENGINE=DEFAULT; + +--echo # +--echo # End of 10.4 tests +--echo # |