summaryrefslogtreecommitdiff
path: root/mysql-test/main/ctype_binary.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-25 19:41:58 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-25 19:41:58 +0300
commitecc7f305dde85d704a37e584c29df0ed3f97f7be (patch)
tree31810998f5f198e105c0f1f8e5acd6c9e7a581c3 /mysql-test/main/ctype_binary.test
parent736ca14323fa16e409378f0da8005bce4be6dcf8 (diff)
parent5530a93f47324b847c799d00a2756729a2869d13 (diff)
downloadmariadb-git-ecc7f305dde85d704a37e584c29df0ed3f97f7be.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/ctype_binary.test')
-rw-r--r--mysql-test/main/ctype_binary.test101
1 files changed, 101 insertions, 0 deletions
diff --git a/mysql-test/main/ctype_binary.test b/mysql-test/main/ctype_binary.test
index 155d8548f77..b871a41309b 100644
--- a/mysql-test/main/ctype_binary.test
+++ b/mysql-test/main/ctype_binary.test
@@ -74,6 +74,107 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
+--echo #
+
+CREATE TABLE t1(a ENUM(0x6100,0x6200,0x6300) CHARACTER SET 'Binary');
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT HEX(a) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+--echo 0x00 in the middle or in the end of a value
+
+CREATE TABLE t1 (a ENUM(0x6100));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM(0x610062));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+--echo 0x00 in the beginning of the first value:
+
+CREATE TABLE t1 (a ENUM(0x0061));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES(1);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM(0x0061), b ENUM('b'));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1,1);
+SELECT HEX(a), HEX(b) FROM t1;
+DROP TABLE t1;
+
+--echo # 0x00 in the beginning of the second (and following) value of the *last* ENUM/SET in the table:
+
+CREATE TABLE t1 (a ENUM('a',0x0061));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1),(2);
+SELECT HEX(a) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('a'), b ENUM('b',0x0061));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (1,2);
+SELECT HEX(a), HEX(b) FROM t1 ORDER BY a, b;
+DROP TABLE t1;
+
+--echo 0x00 in the beginning of a value of a non-last ENUM/SET causes an error:
+--replace_regex /'.*t1.frm'/'DIR\/t1.frm'/
+--error ER_NOT_FORM_FILE
+CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
+
+
--echo #
--echo # End of 10.1 tests
--echo #
+
+--echo #
+--echo # Start of 10.2 tests
+--echo #
+
+--echo #
+--echo # MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
+--echo # 10.2 tests
+--echo #
+
+SET NAMES latin1;
+CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary', d JSON);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c) VALUES (1);
+SELECT HEX(c) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(
+ c ENUM(0x0061) CHARACTER SET 'Binary',
+ d INT DEFAULT NULL CHECK (d>0)
+);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1,1);
+SELECT HEX(c), d FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary' CHECK (c>0));
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1);
+SELECT HEX(c) FROM t1;
+DROP TABLE t1;
+
+
+
+
+
+
+
+--echo #
+--echo # End of 10.2 tests
+--echo #