Skip to content

Commit 6462af1

Browse files
committed
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
Additional 10.2 specific tests (with JSON)
1 parent bdab5b6 commit 6462af1

File tree

6 files changed

+189
-0
lines changed

6 files changed

+189
-0
lines changed

mysql-test/r/ctype_binary.result

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,3 +3267,52 @@ ERROR HY000: Incorrect information in file: 'DIR/t1.frm'
32673267
#
32683268
# End of 10.1 tests
32693269
#
3270+
#
3271+
# Start of 10.2 tests
3272+
#
3273+
#
3274+
# 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
3275+
# 10.2 tests
3276+
#
3277+
SET NAMES latin1;
3278+
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary', d JSON);
3279+
SHOW CREATE TABLE t1;
3280+
Table Create Table
3281+
t1 CREATE TABLE `t1` (
3282+
`c` enum('\0a') CHARACTER SET binary DEFAULT NULL,
3283+
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
3284+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3285+
INSERT INTO t1 (c) VALUES (1);
3286+
SELECT HEX(c) FROM t1;
3287+
HEX(c)
3288+
0061
3289+
DROP TABLE t1;
3290+
CREATE TABLE t1(
3291+
c ENUM(0x0061) CHARACTER SET 'Binary',
3292+
d INT DEFAULT NULL CHECK (d>0)
3293+
);
3294+
SHOW CREATE TABLE t1;
3295+
Table Create Table
3296+
t1 CREATE TABLE `t1` (
3297+
`c` enum('\0a') CHARACTER SET binary DEFAULT NULL,
3298+
`d` int(11) DEFAULT NULL CHECK (`d` > 0)
3299+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3300+
INSERT INTO t1 VALUES (1,1);
3301+
SELECT HEX(c), d FROM t1;
3302+
HEX(c) d
3303+
0061 1
3304+
DROP TABLE t1;
3305+
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary' CHECK (c>0));
3306+
SHOW CREATE TABLE t1;
3307+
Table Create Table
3308+
t1 CREATE TABLE `t1` (
3309+
`c` enum('\0a') CHARACTER SET binary DEFAULT NULL CHECK (`c` > 0)
3310+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
3311+
INSERT INTO t1 VALUES (1);
3312+
SELECT HEX(c) FROM t1;
3313+
HEX(c)
3314+
0061
3315+
DROP TABLE t1;
3316+
#
3317+
# End of 10.2 tests
3318+
#

mysql-test/r/ctype_utf16_uca.result

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7899,5 +7899,46 @@ a b
78997899
DROP TABLE t1;
79007900
SET NAMES utf8;
79017901
#
7902+
# 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
7903+
# 10.2 tests
7904+
#
7905+
SET NAMES utf8, COLLATION_CONNECTION=utf16_hungarian_ci;
7906+
CREATE TABLE t1(c ENUM('aaaaaaaa') CHARACTER SET 'Binary',d JSON);
7907+
SHOW CREATE TABLE t1;
7908+
Table Create Table
7909+
t1 CREATE TABLE `t1` (
7910+
`c` enum('\0a\0a\0a\0a\0a\0a\0a\0a') CHARACTER SET binary DEFAULT NULL,
7911+
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
7912+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
7913+
INSERT INTO t1 (c) VALUES (1);
7914+
SELECT HEX(c) FROM t1;
7915+
HEX(c)
7916+
00610061006100610061006100610061
7917+
DROP TABLE t1;
7918+
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaa') CHARACTER SET 'Binary',d JSON);
7919+
SHOW CREATE TABLE t1;
7920+
Table Create Table
7921+
t1 CREATE TABLE `t1` (
7922+
`c` enum('\0a\0a\0a\0a\0a\0a\0a\0a\0a') CHARACTER SET binary DEFAULT NULL,
7923+
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
7924+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
7925+
INSERT INTO t1 (c) VALUES (1);
7926+
SELECT HEX(c) FROM t1;
7927+
HEX(c)
7928+
006100610061006100610061006100610061
7929+
DROP TABLE t1;
7930+
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaaa') CHARACTER SET 'Binary',d JSON);
7931+
SHOW CREATE TABLE t1;
7932+
Table Create Table
7933+
t1 CREATE TABLE `t1` (
7934+
`c` enum('\0a\0a\0a\0a\0a\0a\0a\0a\0a\0a') CHARACTER SET binary DEFAULT NULL,
7935+
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
7936+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
7937+
INSERT INTO t1 (c) VALUES (1);
7938+
SELECT HEX(c) FROM t1;
7939+
HEX(c)
7940+
0061006100610061006100610061006100610061
7941+
DROP TABLE t1;
7942+
#
79027943
# End of 10.2 tests
79037944
#

mysql-test/r/ctype_utf32.result

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,5 +2868,25 @@ DROP TABLE t1;
28682868
#
28692869
SET STORAGE_ENGINE=Default;
28702870
#
2871+
# 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
2872+
# 10.2 tests
2873+
#
2874+
SET NAMES utf8, COLLATION_CONNECTION=utf32_bin;
2875+
CREATE TABLE t1(c1 ENUM('a','b','ac') CHARACTER SET 'Binary',c2 JSON,c3 INT);
2876+
SHOW CREATE TABLE t1;
2877+
Table Create Table
2878+
t1 CREATE TABLE `t1` (
2879+
`c1` enum('\0\0\0a','\0\0\0b','\0\0\0a\0\0\0c') CHARACTER SET binary DEFAULT NULL,
2880+
`c2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
2881+
`c3` int(11) DEFAULT NULL
2882+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2883+
INSERT INTO t1 (c1) VALUES (1),(2),(3);
2884+
SELECT HEX(c1) FROM t1 ORDER BY c1;
2885+
HEX(c1)
2886+
00000061
2887+
00000062
2888+
0000006100000063
2889+
DROP TABLE t1;
2890+
#
28712891
# End of 10.2 tests
28722892
#

mysql-test/t/ctype_binary.test

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,44 @@ CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
137137
--echo #
138138
--echo # End of 10.1 tests
139139
--echo #
140+
141+
--echo #
142+
--echo # Start of 10.2 tests
143+
--echo #
144+
145+
--echo #
146+
--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
147+
--echo # 10.2 tests
148+
--echo #
149+
150+
SET NAMES latin1;
151+
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary', d JSON);
152+
SHOW CREATE TABLE t1;
153+
INSERT INTO t1 (c) VALUES (1);
154+
SELECT HEX(c) FROM t1;
155+
DROP TABLE t1;
156+
157+
CREATE TABLE t1(
158+
c ENUM(0x0061) CHARACTER SET 'Binary',
159+
d INT DEFAULT NULL CHECK (d>0)
160+
);
161+
SHOW CREATE TABLE t1;
162+
INSERT INTO t1 VALUES (1,1);
163+
SELECT HEX(c), d FROM t1;
164+
DROP TABLE t1;
165+
166+
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary' CHECK (c>0));
167+
SHOW CREATE TABLE t1;
168+
INSERT INTO t1 VALUES (1);
169+
SELECT HEX(c) FROM t1;
170+
DROP TABLE t1;
171+
172+
173+
174+
175+
176+
177+
178+
--echo #
179+
--echo # End of 10.2 tests
180+
--echo #

mysql-test/t/ctype_utf16_uca.test

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,31 @@ SET NAMES utf8, collation_connection=utf16_unicode_520_nopad_ci;
243243
SET NAMES utf8;
244244

245245

246+
--echo #
247+
--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
248+
--echo # 10.2 tests
249+
--echo #
250+
251+
SET NAMES utf8, COLLATION_CONNECTION=utf16_hungarian_ci;
252+
CREATE TABLE t1(c ENUM('aaaaaaaa') CHARACTER SET 'Binary',d JSON); # ERROR 1064 (42000): You have an error in your SQL syntax
253+
SHOW CREATE TABLE t1;
254+
INSERT INTO t1 (c) VALUES (1);
255+
SELECT HEX(c) FROM t1;
256+
DROP TABLE t1;
257+
258+
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaa') CHARACTER SET 'Binary',d JSON); # ERROR 1033 (HY000): Incorrect information in file: './test/t.frm'
259+
SHOW CREATE TABLE t1;
260+
INSERT INTO t1 (c) VALUES (1);
261+
SELECT HEX(c) FROM t1;
262+
DROP TABLE t1;
263+
264+
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaaa') CHARACTER SET 'Binary',d JSON); # Sig 11
265+
SHOW CREATE TABLE t1;
266+
INSERT INTO t1 (c) VALUES (1);
267+
SELECT HEX(c) FROM t1;
268+
DROP TABLE t1;
269+
270+
246271
--echo #
247272
--echo # End of 10.2 tests
248273
--echo #

mysql-test/t/ctype_utf32.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,19 @@ let $coll='utf32_nopad_bin';
10351035
let $coll_pad='utf32_bin';
10361036
--source include/ctype_pad_all_engines.inc
10371037

1038+
1039+
--echo #
1040+
--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
1041+
--echo # 10.2 tests
1042+
--echo #
1043+
1044+
SET NAMES utf8, COLLATION_CONNECTION=utf32_bin;
1045+
CREATE TABLE t1(c1 ENUM('a','b','ac') CHARACTER SET 'Binary',c2 JSON,c3 INT);
1046+
SHOW CREATE TABLE t1;
1047+
INSERT INTO t1 (c1) VALUES (1),(2),(3);
1048+
SELECT HEX(c1) FROM t1 ORDER BY c1;
1049+
DROP TABLE t1;
1050+
10381051
--echo #
10391052
--echo # End of 10.2 tests
10401053
--echo #

0 commit comments

Comments
 (0)