summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-09-06 12:37:11 +0400
committerAlexander Barkov <bar@mariadb.org>2016-09-06 12:37:11 +0400
commite4f6fd5e1252f8c68f449fe820bae88c18bca8f5 (patch)
tree18830c670cfe3020e72565220096cdf4290d8858 /mysql-test/t
parent8ae65920fabddb9157cddb547cf914b4a63539bf (diff)
downloadmariadb-git-e4f6fd5e1252f8c68f449fe820bae88c18bca8f5.tar.gz
MDEV-10743 LDML: a new syntax to reuse sort order from another 8bit simple collation
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/ctype_ldml.test36
1 files changed, 34 insertions, 2 deletions
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
index 37efc775b27..401b21fe55a 100644
--- a/mysql-test/t/ctype_ldml.test
+++ b/mysql-test/t/ctype_ldml.test
@@ -413,16 +413,48 @@ DROP TABLE t1;
--echo #
--echo # Testing that the MY_CS_PUREASCII flag is set properly
+--echo # Comparison between ascii2 and latin1 should not give "illegal collation error"
--echo #
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ascii2, b VARCHAR(10) CHARACTER SET latin1);
INSERT INTO t1 VALUES ('a','a'),('b','b');
-# should not give "illegal collation" error
+SELECT * FROM t1 WHERE a=b;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_bin2;
SELECT * FROM t1 WHERE a=b;
ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_bin;
-# should not give "illegal collation" error
+SELECT * FROM t1 WHERE a=b;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_general_inherited_ci;
+SELECT * FROM t1 WHERE a=b;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_general_inherited2_ci;
+SELECT * FROM t1 WHERE a=b;
+DROP TABLE t1;
+
+--echo #
+--echo # Testing that in case of two binary collations
+--echo # "BINARY" in a column definition uses the collation with the least id
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ascii2 BINARY);
+INSERT INTO t1 VALUES ('test');
+SELECT COLLATION(a) FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Testing mixing of two binary collations of the same character set
+--echo #
+CREATE TABLE t1 (
+ a VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_bin,
+ b VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_bin2
+);
+INSERT INTO t1 VALUES ('a','a');
+--error ER_CANT_AGGREGATE_2COLLATIONS
SELECT * FROM t1 WHERE a=b;
DROP TABLE t1;
+--echo #
+--echo # Testing bad collation inheritance
+--echo #
+--error ER_UNKNOWN_COLLATION
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ascii2 COLLATE ascii2_badly_inherited_ci);
--echo #
--echo # Testing that the MY_CS_CSSORT flag is set properly