Skip to content

Commit bdab5b6

Browse files
committed
Merge remote-tracking branch 'origin/10.1' into 10.2
2 parents 450a5b3 + cb9c49a commit bdab5b6

File tree

4 files changed

+284
-59
lines changed

4 files changed

+284
-59
lines changed

mysql-test/r/ctype_binary.result

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,5 +3172,98 @@ Warnings:
31723172
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and weight_string(`test`.`t1`.`a`,0,0,1) = 'a'
31733173
DROP TABLE t1;
31743174
#
3175+
# 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
3176+
#
3177+
CREATE TABLE t1(a ENUM(0x6100,0x6200,0x6300) CHARACTER SET 'Binary');
3178+
SHOW CREATE TABLE t1;
3179+
Table Create Table
3180+
t1 CREATE TABLE `t1` (
3181+
`a` enum('a\0','b\0','c\0') CHARACTER SET binary DEFAULT NULL
3182+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3183+
INSERT INTO t1 VALUES (1),(2),(3);
3184+
SELECT HEX(a) FROM t1 ORDER BY a;
3185+
HEX(a)
3186+
6100
3187+
6200
3188+
6300
3189+
DROP TABLE t1;
3190+
0x00 in the middle or in the end of a value
3191+
CREATE TABLE t1 (a ENUM(0x6100));
3192+
SHOW CREATE TABLE t1;
3193+
Table Create Table
3194+
t1 CREATE TABLE `t1` (
3195+
`a` enum('a\0') DEFAULT NULL
3196+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3197+
INSERT INTO t1 VALUES (1);
3198+
SELECT HEX(a) FROM t1;
3199+
HEX(a)
3200+
6100
3201+
DROP TABLE t1;
3202+
CREATE TABLE t1 (a ENUM(0x610062));
3203+
SHOW CREATE TABLE t1;
3204+
Table Create Table
3205+
t1 CREATE TABLE `t1` (
3206+
`a` enum('a\0b') DEFAULT NULL
3207+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3208+
INSERT INTO t1 VALUES (1);
3209+
SELECT HEX(a) FROM t1;
3210+
HEX(a)
3211+
610062
3212+
DROP TABLE t1;
3213+
0x00 in the beginning of the first value:
3214+
CREATE TABLE t1 (a ENUM(0x0061));
3215+
SHOW CREATE TABLE t1;
3216+
Table Create Table
3217+
t1 CREATE TABLE `t1` (
3218+
`a` enum('\0a') DEFAULT NULL
3219+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3220+
INSERT INTO t1 VALUES(1);
3221+
SELECT HEX(a) FROM t1;
3222+
HEX(a)
3223+
0061
3224+
DROP TABLE t1;
3225+
CREATE TABLE t1 (a ENUM(0x0061), b ENUM('b'));
3226+
SHOW CREATE TABLE t1;
3227+
Table Create Table
3228+
t1 CREATE TABLE `t1` (
3229+
`a` enum('\0a') DEFAULT NULL,
3230+
`b` enum('b') DEFAULT NULL
3231+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3232+
INSERT INTO t1 VALUES (1,1);
3233+
SELECT HEX(a), HEX(b) FROM t1;
3234+
HEX(a) HEX(b)
3235+
0061 62
3236+
DROP TABLE t1;
3237+
# 0x00 in the beginning of the second (and following) value of the *last* ENUM/SET in the table:
3238+
CREATE TABLE t1 (a ENUM('a',0x0061));
3239+
SHOW CREATE TABLE t1;
3240+
Table Create Table
3241+
t1 CREATE TABLE `t1` (
3242+
`a` enum('a','\0a') DEFAULT NULL
3243+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3244+
INSERT INTO t1 VALUES (1),(2);
3245+
SELECT HEX(a) FROM t1 ORDER BY a;
3246+
HEX(a)
3247+
61
3248+
0061
3249+
DROP TABLE t1;
3250+
CREATE TABLE t1 (a ENUM('a'), b ENUM('b',0x0061));
3251+
SHOW CREATE TABLE t1;
3252+
Table Create Table
3253+
t1 CREATE TABLE `t1` (
3254+
`a` enum('a') DEFAULT NULL,
3255+
`b` enum('b','\0a') DEFAULT NULL
3256+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3257+
INSERT INTO t1 VALUES (1,1);
3258+
INSERT INTO t1 VALUES (1,2);
3259+
SELECT HEX(a), HEX(b) FROM t1 ORDER BY a, b;
3260+
HEX(a) HEX(b)
3261+
61 62
3262+
61 0061
3263+
DROP TABLE t1;
3264+
0x00 in the beginning of a value of a non-last ENUM/SET causes an error:
3265+
CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
3266+
ERROR HY000: Incorrect information in file: 'DIR/t1.frm'
3267+
#
31753268
# End of 10.1 tests
31763269
#

mysql-test/t/ctype_binary.test

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,66 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
7474
EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
7575
DROP TABLE t1;
7676

77+
78+
--echo #
79+
--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
80+
--echo #
81+
82+
CREATE TABLE t1(a ENUM(0x6100,0x6200,0x6300) CHARACTER SET 'Binary');
83+
SHOW CREATE TABLE t1;
84+
INSERT INTO t1 VALUES (1),(2),(3);
85+
SELECT HEX(a) FROM t1 ORDER BY a;
86+
DROP TABLE t1;
87+
88+
--echo 0x00 in the middle or in the end of a value
89+
90+
CREATE TABLE t1 (a ENUM(0x6100));
91+
SHOW CREATE TABLE t1;
92+
INSERT INTO t1 VALUES (1);
93+
SELECT HEX(a) FROM t1;
94+
DROP TABLE t1;
95+
96+
CREATE TABLE t1 (a ENUM(0x610062));
97+
SHOW CREATE TABLE t1;
98+
INSERT INTO t1 VALUES (1);
99+
SELECT HEX(a) FROM t1;
100+
DROP TABLE t1;
101+
102+
--echo 0x00 in the beginning of the first value:
103+
104+
CREATE TABLE t1 (a ENUM(0x0061));
105+
SHOW CREATE TABLE t1;
106+
INSERT INTO t1 VALUES(1);
107+
SELECT HEX(a) FROM t1;
108+
DROP TABLE t1;
109+
110+
CREATE TABLE t1 (a ENUM(0x0061), b ENUM('b'));
111+
SHOW CREATE TABLE t1;
112+
INSERT INTO t1 VALUES (1,1);
113+
SELECT HEX(a), HEX(b) FROM t1;
114+
DROP TABLE t1;
115+
116+
--echo # 0x00 in the beginning of the second (and following) value of the *last* ENUM/SET in the table:
117+
118+
CREATE TABLE t1 (a ENUM('a',0x0061));
119+
SHOW CREATE TABLE t1;
120+
INSERT INTO t1 VALUES (1),(2);
121+
SELECT HEX(a) FROM t1 ORDER BY a;
122+
DROP TABLE t1;
123+
124+
CREATE TABLE t1 (a ENUM('a'), b ENUM('b',0x0061));
125+
SHOW CREATE TABLE t1;
126+
INSERT INTO t1 VALUES (1,1);
127+
INSERT INTO t1 VALUES (1,2);
128+
SELECT HEX(a), HEX(b) FROM t1 ORDER BY a, b;
129+
DROP TABLE t1;
130+
131+
--echo 0x00 in the beginning of a value of a non-last ENUM/SET causes an error:
132+
--replace_regex /'.*t1.frm'/'DIR\/t1.frm'/
133+
--error ER_NOT_FORM_FILE
134+
CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
135+
136+
77137
--echo #
78138
--echo # End of 10.1 tests
79139
--echo #

0 commit comments

Comments
 (0)