@@ -3172,5 +3172,98 @@ Warnings:
3172
3172
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'
3173
3173
DROP TABLE t1;
3174
3174
#
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
+ #
3175
3268
# End of 10.1 tests
3176
3269
#
0 commit comments