mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.10 into 10.11
This commit is contained in:
@@ -27,6 +27,10 @@ SET DEBUG_SYNC = 'ib_after_row_insert SIGNAL first_ins_row_inserted WAIT_FOR fir
|
||||
--send INSERT INTO t VALUES(10, 20)
|
||||
|
||||
--connect(con_del_2,localhost,root,,)
|
||||
# After MDEV-30225 is fixed, the following DELETE creates next-key lock for
|
||||
# unqique search for RR, and the above INSERT kills it as deadlock victim.
|
||||
# But it still requests not-gap lock for RC.
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR first_ins_locked';
|
||||
SET DEBUG_SYNC = 'lock_wait_start SIGNAL second_del_locked';
|
||||
###############################################################################
|
||||
|
@@ -270,6 +270,8 @@ select count(*) > -1 from i_trx;
|
||||
select count(*) > -1 from d_trx;
|
||||
|
||||
connection default;
|
||||
# Starting with MariaDB 10.6, ensure that DDL recovery will have completed.
|
||||
SET GLOBAL innodb_max_purge_lag_wait=0;
|
||||
drop database test;
|
||||
create database test;
|
||||
drop user select_only@localhost;
|
||||
|
@@ -31,6 +31,8 @@ RENAME TABLE t1 TO `t2_new..............................................end`;
|
||||
show warnings;
|
||||
drop table t1;
|
||||
|
||||
# Starting with MariaDB 10.6, ensure that DDL recovery will have completed.
|
||||
SET GLOBAL innodb_max_purge_lag_wait=0;
|
||||
drop database test;
|
||||
create database test;
|
||||
use test;
|
||||
|
72
mysql-test/suite/innodb/t/insert-before-delete.test
Normal file
72
mysql-test/suite/innodb/t/insert-before-delete.test
Normal file
@@ -0,0 +1,72 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--connect (pause_purge,localhost,root)
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
|
||||
--connection default
|
||||
CREATE TABLE t (pk int PRIMARY KEY, sk INT UNIQUE) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (10, 100);
|
||||
|
||||
--connect (con1,localhost,root)
|
||||
BEGIN; # trx 0
|
||||
SELECT * FROM t WHERE sk = 100 FOR UPDATE;
|
||||
|
||||
--connect (con2,localhost,root)
|
||||
SET DEBUG_SYNC="lock_wait_start SIGNAL insert_wait_started";
|
||||
# trx 1 is locked on try to read the record in secondary index during duplicates
|
||||
# check. It's the first in waiting queue, that's why it will be woken up firstly
|
||||
# when trx 0 commits.
|
||||
--send INSERT INTO t VALUES (5, 100) # trx 1
|
||||
|
||||
--connect (con3,localhost,root)
|
||||
# MDEV-30225 is fixed only for RR
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
SET DEBUG_SYNC="now WAIT_FOR insert_wait_started";
|
||||
SET DEBUG_SYNC="lock_wait_start SIGNAL delete_started_waiting";
|
||||
# trx 2 can delete (5, 100) on master, but not on slave, as on slave trx 1
|
||||
# can insert (5, 100) after trx 2 positioned it's cursor. Trx 2 lock is placed
|
||||
# in waiting queue after trx 1 lock, but its persistent cursor position was
|
||||
# stored on (100, 10) record in secondary index before suspending. After trx 1
|
||||
# is committed, trx 2 will restore persistent cursor position on (100, 10). As
|
||||
# (100, 5) secondary index record was inserted before (100, 10) in logical
|
||||
# order, and (100, 10) record is delete-marked, trx 2 just continues scanning.
|
||||
#
|
||||
# Note. There can be several records with the same key in unique secondary
|
||||
# index, but only one of them must be non-delete-marked. That's why when we do
|
||||
# point query, cursor position is set in the first record in logical order, and
|
||||
# then records are iterated until either non-delete-marked record is found or
|
||||
# all records with the same unique fields are iterated.
|
||||
--send DELETE FROM t WHERE sk = 100 # trx 2
|
||||
|
||||
--connection con1
|
||||
SET DEBUG_SYNC="now WAIT_FOR delete_started_waiting";
|
||||
DELETE FROM t WHERE sk=100; # trx 0
|
||||
COMMIT;
|
||||
--disconnect con1
|
||||
|
||||
--connection con2
|
||||
--reap
|
||||
--disconnect con2
|
||||
|
||||
--connection con3
|
||||
# If the bug is fixed, deadlock error will be there, as trx 2 owns
|
||||
# next-key lock waiting for trx 1, and trx 1 requests
|
||||
# insert-intention lock, conflicting with trx 2 next-key lock.
|
||||
--error ER_LOCK_DEADLOCK
|
||||
--reap
|
||||
--disconnect con3
|
||||
|
||||
--connection default
|
||||
# If the bug is not fixed, we will see the row inserted by trx 1 here. This can
|
||||
# cause duplicate key error on slave, when some other trx tries in insert row
|
||||
# with the same secondary key, as was inserted by trx 1, and not deleted by trx
|
||||
# 2.
|
||||
SELECT * FROM t;
|
||||
|
||||
--disconnect pause_purge
|
||||
SET DEBUG_SYNC="RESET";
|
||||
DROP TABLE t;
|
||||
--source include/wait_until_count_sessions.inc
|
@@ -216,8 +216,6 @@ DROP TABLE t1;
|
||||
--echo # MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ...
|
||||
--echo #
|
||||
|
||||
SET UNIQUE_CHECKS=0;
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(11) NOT NULL,
|
||||
`a` int(11) DEFAULT NULL,
|
||||
@@ -233,7 +231,6 @@ SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
--echo #
|
||||
@@ -405,4 +402,21 @@ CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-30321 blob data corrupted by row_merge_write_blob_to_tmp_file()
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (
|
||||
`id` int(11) NOT NULL,
|
||||
`data` LONGBLOB NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(1, REPEAT('X', @@innodb_sort_buffer_size)),
|
||||
(2, REPEAT('X', @@innodb_sort_buffer_size));
|
||||
|
||||
SELECT COUNT(*) AS nb_corrupted_rows FROM t1 WHERE data != REPEAT('X', @@innodb_sort_buffer_size);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.7 tests
|
||||
|
@@ -381,6 +381,9 @@ INSERT INTO t1 VALUES(1,1,'a'),(2,9999,'b'),(3,10000,'c'),(4,4,'d');
|
||||
DELETE FROM t1 WHERE a = 9999 AND b='b';
|
||||
COMMIT;
|
||||
|
||||
# After MDEV-30225 is fixed, the above DELETE creates next-key lock during
|
||||
# secondary index unique search. That's why the result of the following must
|
||||
# be 1.
|
||||
SET @end = (SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
|
||||
= 'lock_rec_lock_created');
|
||||
SELECT @end - @start;
|
||||
|
Reference in New Issue
Block a user