-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/10.4' into 10.5
- Loading branch information
Showing
35 changed files
with
918 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--echo # | ||
--echo # MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations | ||
--echo # | ||
|
||
# TEXT | ||
|
||
if (`SELECT UPPER(@@storage_engine) != 'MEMORY'`) | ||
{ | ||
EXECUTE IMMEDIATE REPLACE( | ||
'CREATE TABLE t1 ( ' | ||
' a TEXT COLLATE <COLLATION>,' | ||
'UNIQUE(a(3)))', | ||
'<COLLATION>', @@collation_connection); | ||
SHOW CREATE TABLE t1; | ||
INSERT INTO t1 VALUES ('ss '); | ||
--error ER_DUP_ENTRY | ||
INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; | ||
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; | ||
INSERT INTO t1 VALUES ('ss '); | ||
--error ER_DUP_ENTRY | ||
INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; | ||
DROP TABLE t1; | ||
} | ||
|
||
|
||
# VARCHAR | ||
|
||
EXECUTE IMMEDIATE REPLACE( | ||
'CREATE TABLE t1 ( ' | ||
' a VARCHAR(2000) COLLATE <COLLATION>,' | ||
'UNIQUE(a(3)))', | ||
'<COLLATION>', @@collation_connection); | ||
SHOW CREATE TABLE t1; | ||
INSERT INTO t1 VALUES ('ss '); | ||
--error ER_DUP_ENTRY | ||
INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; | ||
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; | ||
INSERT INTO t1 VALUES ('ss '); | ||
--error ER_DUP_ENTRY | ||
INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; | ||
DROP TABLE t1; | ||
|
||
# CHAR | ||
|
||
# MyISAM is buggy on CHAR+BTREE+UNIQUE+PREFIX (see MDEV-30048), disable for now | ||
# Other engines work fine | ||
|
||
if (`SELECT UPPER(@@storage_engine) != 'MYISAM'`) | ||
{ | ||
EXECUTE IMMEDIATE REPLACE( | ||
'CREATE TABLE t1 ( ' | ||
' a CHAR(20) COLLATE <COLLATION>,' | ||
'UNIQUE(a(3)))', | ||
'<COLLATION>', @@collation_connection); | ||
SHOW CREATE TABLE t1; | ||
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; | ||
INSERT INTO t1 VALUES ('ss '); | ||
INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.