Skip to content

Commit 4ec032b

Browse files
committed
Merge 10.4 into 10.5
2 parents c893668 + b1538f4 commit 4ec032b

24 files changed

+647
-182
lines changed

mysql-test/suite/innodb/r/instant_alter_charset.result

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,3 +1929,66 @@ KEY a_idx(a(1))
19291929
INSERT INTO t VALUES (1, 'something in the air');
19301930
ALTER TABLE t MODIFY a text CHARSET utf8mb4;
19311931
DROP TABLE t;
1932+
#
1933+
# MDEV-22899: Assertion `field->col->is_binary() || field->prefix_len % field->col->mbmaxlen == 0' failed in dict_index_add_to_cache
1934+
#
1935+
CREATE TABLE t1 (
1936+
a text CHARACTER SET utf8 DEFAULT NULL,
1937+
KEY a_key (a(1))
1938+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1939+
INSERT INTO t1 VALUES ();
1940+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1941+
DROP TABLE t1;
1942+
CREATE TABLE t1 (
1943+
a text CHARACTER SET utf8 DEFAULT NULL,
1944+
b int,
1945+
KEY a_key (b, a(1))
1946+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1947+
INSERT INTO t1 VALUES ();
1948+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1949+
DROP TABLE t1;
1950+
CREATE TABLE t1 (
1951+
a char(200) CHARACTER SET utf8 DEFAULT NULL,
1952+
KEY a_key (a(1))
1953+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1954+
INSERT INTO t1 VALUES ();
1955+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1956+
DROP TABLE t1;
1957+
CREATE TABLE t1 (
1958+
a char(200) CHARACTER SET utf8 DEFAULT NULL,
1959+
b int,
1960+
KEY a_key (b, a(1))
1961+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1962+
INSERT INTO t1 VALUES ();
1963+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1964+
DROP TABLE t1;
1965+
CREATE TABLE t1 (
1966+
a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
1967+
KEY a_key (a(1))
1968+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1969+
INSERT INTO t1 VALUES ();
1970+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1971+
DROP TABLE t1;
1972+
CREATE TABLE t1 (
1973+
a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
1974+
b int,
1975+
KEY a_key (b, a(1))
1976+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1977+
INSERT INTO t1 VALUES ();
1978+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1979+
DROP TABLE t1;
1980+
CREATE TABLE t1 (
1981+
a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
1982+
KEY a_key (a(1))
1983+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1984+
INSERT INTO t1 VALUES ();
1985+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1986+
DROP TABLE t1;
1987+
CREATE TABLE t1 (
1988+
a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
1989+
b int,
1990+
KEY a_key (b, a(1))
1991+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1992+
INSERT INTO t1 VALUES ();
1993+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
1994+
DROP TABLE t1;

mysql-test/suite/innodb/t/instant_alter_charset.test

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,3 +730,76 @@ INSERT INTO t VALUES (1, 'something in the air');
730730
ALTER TABLE t MODIFY a text CHARSET utf8mb4;
731731

732732
DROP TABLE t;
733+
734+
735+
--echo #
736+
--echo # MDEV-22899: Assertion `field->col->is_binary() || field->prefix_len % field->col->mbmaxlen == 0' failed in dict_index_add_to_cache
737+
--echo #
738+
739+
CREATE TABLE t1 (
740+
a text CHARACTER SET utf8 DEFAULT NULL,
741+
KEY a_key (a(1))
742+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
743+
INSERT INTO t1 VALUES ();
744+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
745+
DROP TABLE t1;
746+
747+
CREATE TABLE t1 (
748+
a text CHARACTER SET utf8 DEFAULT NULL,
749+
b int,
750+
KEY a_key (b, a(1))
751+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
752+
INSERT INTO t1 VALUES ();
753+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
754+
DROP TABLE t1;
755+
756+
CREATE TABLE t1 (
757+
a char(200) CHARACTER SET utf8 DEFAULT NULL,
758+
KEY a_key (a(1))
759+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
760+
INSERT INTO t1 VALUES ();
761+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
762+
DROP TABLE t1;
763+
764+
CREATE TABLE t1 (
765+
a char(200) CHARACTER SET utf8 DEFAULT NULL,
766+
b int,
767+
KEY a_key (b, a(1))
768+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
769+
INSERT INTO t1 VALUES ();
770+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
771+
DROP TABLE t1;
772+
773+
CREATE TABLE t1 (
774+
a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
775+
KEY a_key (a(1))
776+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
777+
INSERT INTO t1 VALUES ();
778+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
779+
DROP TABLE t1;
780+
781+
CREATE TABLE t1 (
782+
a varchar(200) CHARACTER SET utf8 DEFAULT NULL,
783+
b int,
784+
KEY a_key (b, a(1))
785+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
786+
INSERT INTO t1 VALUES ();
787+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
788+
DROP TABLE t1;
789+
790+
CREATE TABLE t1 (
791+
a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
792+
KEY a_key (a(1))
793+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
794+
INSERT INTO t1 VALUES ();
795+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
796+
DROP TABLE t1;
797+
798+
CREATE TABLE t1 (
799+
a varchar(2000) CHARACTER SET utf8 DEFAULT NULL,
800+
b int,
801+
KEY a_key (b, a(1))
802+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
803+
INSERT INTO t1 VALUES ();
804+
ALTER TABLE t1 MODIFY a text DEFAULT NULL;
805+
DROP TABLE t1;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
include/master-slave.inc
2+
[connection master]
3+
#
4+
# MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
5+
# replication
6+
#
7+
connection master;
8+
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
9+
connection slave;
10+
include/stop_slave.inc
11+
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
12+
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
13+
SET @@global.slave_parallel_threads= 2;
14+
SET @@global.slave_parallel_mode = 'optimistic';
15+
connection master;
16+
INSERT INTO t1 VALUES (1);
17+
INSERT INTO t1 VALUES (2);
18+
connect aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
19+
BEGIN;
20+
INSERT INTO t1 VALUES (1);
21+
connection slave;
22+
include/start_slave.inc
23+
connection aux_slave;
24+
connect backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
25+
BACKUP STAGE START;
26+
BACKUP STAGE BLOCK_COMMIT;
27+
connection aux_slave;
28+
ROLLBACK;
29+
connection backup_slave;
30+
BACKUP STAGE END;
31+
connection slave;
32+
include/diff_tables.inc [master:t1,slave:t1]
33+
connection slave;
34+
include/stop_slave.inc
35+
SET @@global.slave_parallel_threads= @old_parallel_threads;
36+
SET @@global.slave_parallel_mode = @old_parallel_mode;
37+
include/start_slave.inc
38+
connection server_1;
39+
DROP TABLE t1;
40+
include/rpl_end.inc
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
--source include/have_innodb.inc
2+
# The test is not format specific, MIXED is required to optimize testing time
3+
--source include/have_binlog_format_mixed.inc
4+
--source include/master-slave.inc
5+
6+
--echo #
7+
--echo # MDEV-21953: deadlock between BACKUP STAGE BLOCK_COMMIT and parallel
8+
--echo # replication
9+
--echo #
10+
11+
--connection master
12+
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = innodb;
13+
14+
--sync_slave_with_master
15+
--source include/stop_slave.inc
16+
SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads;
17+
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode;
18+
SET @@global.slave_parallel_threads= 2;
19+
SET @@global.slave_parallel_mode = 'optimistic';
20+
21+
--connection master
22+
INSERT INTO t1 VALUES (1);
23+
INSERT INTO t1 VALUES (2);
24+
--save_master_pos
25+
26+
# The plot:
27+
# Block the 1st of two workers and, at waiting-for-prior-commit by the 2nd,
28+
# issue BACKUP commands.
29+
# BLOCK_COMMIT may hang so it is --send.
30+
# Release the 1st worker to observe a deadlock unless its fixed.
31+
32+
--connect (aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,)
33+
BEGIN;
34+
# block the 1st worker and wait for the 2nd ready to commit
35+
INSERT INTO t1 VALUES (1);
36+
37+
--connection slave
38+
--source include/start_slave.inc
39+
40+
--connection aux_slave
41+
--let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
42+
--source include/wait_condition.inc
43+
44+
# While the 1st worker is locked out run backup
45+
--connect (backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,)
46+
BACKUP STAGE START;
47+
--send BACKUP STAGE BLOCK_COMMIT
48+
49+
# release the 1st work
50+
--connection aux_slave
51+
--sleep 1
52+
ROLLBACK;
53+
54+
--connection backup_slave
55+
--reap
56+
BACKUP STAGE END;
57+
58+
--connection slave
59+
--sync_with_master
60+
61+
--let $diff_tables= master:t1,slave:t1
62+
--source include/diff_tables.inc
63+
64+
65+
# Clean up.
66+
--connection slave
67+
--source include/stop_slave.inc
68+
SET @@global.slave_parallel_threads= @old_parallel_threads;
69+
SET @@global.slave_parallel_mode = @old_parallel_mode;
70+
--source include/start_slave.inc
71+
72+
--connection server_1
73+
DROP TABLE t1;
74+
75+
--source include/rpl_end.inc
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# MDEV-16929 Assertion ... in close_thread_tables upon killing connection
3+
# running SHOW on sequence
4+
#
5+
CREATE SEQUENCE s ENGINE=InnoDB;
6+
RENAME TABLE s TO s1;
7+
connect con1,localhost,root,,test;
8+
SHOW CREATE SEQUENCE s1;
9+
connection default;
10+
KILL thread_id;
11+
connection default;
12+
drop sequence s1;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--source include/have_innodb.inc
2+
3+
--echo #
4+
--echo # MDEV-16929 Assertion ... in close_thread_tables upon killing connection
5+
--echo # running SHOW on sequence
6+
--echo #
7+
8+
CREATE SEQUENCE s ENGINE=InnoDB;
9+
RENAME TABLE s TO s1;
10+
--connect (con1,localhost,root,,test)
11+
--let $conid= `SELECT CONNECTION_ID()`
12+
--send
13+
SHOW CREATE SEQUENCE s1;
14+
--connection default
15+
--replace_result $conid thread_id
16+
--eval KILL $conid
17+
18+
# Cleanup
19+
--connection default
20+
drop sequence s1;

mysql-test/suite/versioning/r/update.result

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,34 @@ create or replace table t1 (f point, key(f)) with system versioning engine=myisa
319319
update t1 set f = null where f = 'foo';
320320
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
321321
drop table t1;
322+
#
323+
# MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon REPLACE on a system-versioned table
324+
#
325+
create or replace table t1 (
326+
a int,
327+
b int,
328+
row_start bigint(20) unsigned generated always as row start,
329+
row_end bigint(20) unsigned generated always as row end,
330+
unique key (b,row_end),
331+
key (row_start),
332+
period for system_time (row_start,row_end)
333+
) engine=innodb with system versioning;
334+
insert into t1 (a, b) values (1, 2);
335+
replace into t1 (a, b) values (3, 2);
336+
replace into t1 (a, b) values (4, 2);
337+
drop table t1;
338+
#
339+
# MDEV-20661 Virtual fields are not recalculated on system fields value assignment
340+
#
341+
create table t1 (
342+
a int,
343+
row_start SYS_DATATYPE as row start invisible,
344+
row_end SYS_DATATYPE as row end invisible,
345+
period for system_time (row_start, row_end),
346+
v1 bigint unsigned as (a ^ row_start) unique,
347+
v2 bigint unsigned as (a ^ row_end) unique
348+
) engine=innodb with system versioning;
349+
insert into t1 (a) values (1), (2);
350+
update ignore t1 set a= 3;
351+
delete history from t1;
352+
drop table t1;

mysql-test/suite/versioning/t/update.test

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,45 @@ update t1 set f = null where f = 'foo';
245245
# cleanup
246246
drop table t1;
247247

248+
--echo #
249+
--echo # MDEV-22061 InnoDB: Assertion of missing row in sec index row_start upon REPLACE on a system-versioned table
250+
--echo #
251+
create or replace table t1 (
252+
a int,
253+
b int,
254+
row_start bigint(20) unsigned generated always as row start,
255+
row_end bigint(20) unsigned generated always as row end,
256+
unique key (b,row_end),
257+
key (row_start),
258+
period for system_time (row_start,row_end)
259+
) engine=innodb with system versioning;
260+
261+
insert into t1 (a, b) values (1, 2);
262+
replace into t1 (a, b) values (3, 2);
263+
replace into t1 (a, b) values (4, 2);
264+
265+
# cleanup
266+
drop table t1;
267+
268+
--echo #
269+
--echo # MDEV-20661 Virtual fields are not recalculated on system fields value assignment
270+
--echo #
271+
272+
replace_result $sys_datatype_expl SYS_DATATYPE;
273+
eval create table t1 (
274+
a int,
275+
row_start $sys_datatype_expl as row start invisible,
276+
row_end $sys_datatype_expl as row end invisible,
277+
period for system_time (row_start, row_end),
278+
v1 bigint unsigned as (a ^ row_start) unique,
279+
v2 bigint unsigned as (a ^ row_end) unique
280+
) engine=innodb with system versioning;
281+
282+
insert into t1 (a) values (1), (2);
283+
update ignore t1 set a= 3;
284+
delete history from t1;
285+
286+
# cleanup
287+
drop table t1;
288+
248289
source suite/versioning/common_finish.inc;

0 commit comments

Comments
 (0)