mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.6 into 10.10
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
--source include/innodb_encrypt_log.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
let $innodb_metrics_select=
|
||||
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
|
||||
@@ -440,6 +441,32 @@ connection con1;
|
||||
reap;
|
||||
DROP TABLE t1;
|
||||
connection default;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28122 Optimize table crash while applying online log
|
||||
--echo #
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
|
||||
f3 CHAR(200), f4 CHAR(200),
|
||||
f5 VARCHAR(87), PRIMARY KEY(f1))ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(6000, 6000, "InnoDB",
|
||||
"MariaDB", repeat('a', 87));
|
||||
|
||||
SET DEBUG_SYNC="inplace_after_index_build SIGNAL dml_start WAIT_FOR dml_commit";
|
||||
SEND ALTER TABLE t1 FORCE;
|
||||
|
||||
connection con1;
|
||||
SET DEBUG_SYNC="now WAIT_FOR dml_start";
|
||||
BEGIN;
|
||||
INSERT INTO t1 SELECT seq, seq, "IDB", "MDB", repeat('a', 87) FROM seq_1_to_127;
|
||||
INSERT INTO t1 VALUES(128, 128, "IDB", "MDB", repeat('a', 86));
|
||||
INSERT INTO t1 VALUES(129, 129, "idb", "mdb", repeat('a', 2));
|
||||
COMMIT;
|
||||
SET DEBUG_SYNC="now SIGNAL dml_commit";
|
||||
|
||||
connection default;
|
||||
reap;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC=RESET;
|
||||
disconnect con1;
|
||||
|
||||
|
@@ -13,19 +13,36 @@ INSERT INTO t VALUES(20);
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
XA START '1';
|
||||
SELECT * FROM t WHERE a > 20 FOR UPDATE;
|
||||
# The following INSERT is necessary because trx_prepare() resets locks
|
||||
# only if there were modifications in transaction.
|
||||
INSERT INTO t VALUES(40);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
|
||||
connect (con1,localhost,root);
|
||||
SET innodb_lock_wait_timeout=1;
|
||||
# This will be finished with lock wait timeout error if XA PREPARE did not
|
||||
# reset lock on supremum
|
||||
# The following INSERT must not be blocked if XA PREPARE released supremum lock
|
||||
INSERT INTO t VALUES(50);
|
||||
|
||||
--connection default
|
||||
XA COMMIT '1';
|
||||
|
||||
XA START '1';
|
||||
SELECT * FROM t WHERE a > 20 LOCK IN SHARE MODE;
|
||||
# The following INSERT is necessary because trx_prepare() resets locks
|
||||
# only if there were modifications in transaction.
|
||||
INSERT INTO t VALUES (5);
|
||||
XA END '1';
|
||||
XA PREPARE '1';
|
||||
|
||||
--connection con1
|
||||
# The following INSERT must not be blocked if XA PREPARE released supremum lock
|
||||
INSERT INTO t VALUES (60);
|
||||
# The following INSERT must not be blocked if XA PREPARE released shared lock
|
||||
INSERT INTO t VALUES (30);
|
||||
--disconnect con1
|
||||
|
||||
--connection default
|
||||
XA COMMIT '1';
|
||||
DROP TABLE t;
|
||||
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
@@ -0,0 +1,33 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
# Some memory is allocated in dict_stats_save() function for additional sync
|
||||
# point. The memory is allocated in current_thd->mem_root pool after
|
||||
# dict_stats_func() arranged new thd and freed after destroy_background_thd()
|
||||
# attached background thread thd to the current_thd. That's there are
|
||||
# different thread id's for memory allocation and deallocation, what causes
|
||||
# the following warnings. This is not an error because the memory is still
|
||||
# allocated and deallocated by the same thread in pool.
|
||||
call mtr.add_suppression("bytes freed by");
|
||||
|
||||
SET @old_innodb_stats_persistent = @@innodb_stats_persistent;
|
||||
SET GLOBAL innodb_stats_persistent=1;
|
||||
CREATE TABLE t ENGINE=InnoDB AS SELECT 1;
|
||||
|
||||
SET @old_debug_dbug = @@global.debug_dbug;
|
||||
|
||||
XA START 'a';
|
||||
INSERT INTO mysql.innodb_index_stats SELECT '','' AS table_name,index_name,LAST_UPDATE,stat_name,0 AS stat_value,sample_size,stat_description FROM mysql.innodb_index_stats WHERE table_name='dummy' FOR UPDATE; # Note the SELECT is empty
|
||||
SET GLOBAL debug_dbug = "+d,dict_stats_save_exit_notify";
|
||||
INSERT INTO t VALUES (1);
|
||||
XA END 'a';
|
||||
XA PREPARE 'a';
|
||||
|
||||
# Locking queue validation will crash the server if the bug is not fixed
|
||||
SET DEBUG_SYNC="now WAIT_FOR dict_stats_save_finished";
|
||||
SET @@global.debug_dbug = @old_debug_dbug;
|
||||
SET DEBUG_SYNC="RESET";
|
||||
SET GLOBAL innodb_stats_persistent = @old_innodb_stats_persistent;
|
||||
XA COMMIT 'a';
|
||||
DROP TABLE t;
|
Reference in New Issue
Block a user