mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.6' into 10.7
This commit is contained in:
36
mysql-test/suite/innodb/t/alter_table_upgrade.test
Normal file
36
mysql-test/suite/innodb/t/alter_table_upgrade.test
Normal file
@@ -0,0 +1,36 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
let $datadir=`select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29481 mariadb-upgrade prints confusing statement
|
||||
--echo #
|
||||
|
||||
CREATE TABLE pet4 (
|
||||
build_time double(18,7) DEFAULT NULL,
|
||||
KEY idx1 (build_time)) ENGINE=InnoDB;
|
||||
FLUSH TABLES;
|
||||
remove_file $datadir/test/pet4.frm;
|
||||
copy_file std_data/mysql_upgrade/mdev29481_100104_innodb.frm $datadir/test/pet4.frm;
|
||||
SHOW CREATE TABLE pet4;
|
||||
CHECK TABLE pet4 FOR UPGRADE;
|
||||
ALTER TABLE pet4 ADD i1 INTEGER, ALGORITHM=INSTANT;
|
||||
DROP TABLE pet4;
|
||||
|
||||
CREATE TABLE pet4 (
|
||||
build_time double(18,7) DEFAULT NULL,
|
||||
KEY idx1 (build_time)) ENGINE=InnoDB;
|
||||
FLUSH TABLES;
|
||||
remove_file $datadir/test/pet4.frm;
|
||||
copy_file std_data/mysql_upgrade/mdev29481_100104_innodb.frm $datadir/test/pet4.frm;
|
||||
SHOW CREATE TABLE pet4;
|
||||
ALTER TABLE pet4 ADD i1 INTEGER, ALGORITHM=NOCOPY;
|
||||
DROP TABLE pet4;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
1
mysql-test/suite/innodb/t/deadlock_wait_lock_race.opt
Normal file
1
mysql-test/suite/innodb/t/deadlock_wait_lock_race.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb-force-recovery=2
|
@@ -2,17 +2,23 @@
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--connect(suspend_purge,localhost,root,,)
|
||||
# Purge can cause deadlock in the test, requesting page's RW_X_LATCH for trx
|
||||
# ids reseting, after trx 2 acqured RW_S_LATCH and suspended in debug sync point
|
||||
# lock_trx_handle_wait_enter, waiting for upd_cont signal, which must be
|
||||
# emitted after the last SELECT in this test. The last SELECT will hang waiting
|
||||
# for purge RW_X_LATCH releasing, and trx 2 will be rolled back by timeout.
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
|
||||
--connection default
|
||||
CREATE TABLE t (a int PRIMARY KEY, b int) engine = InnoDB;
|
||||
CREATE TABLE t2 (a int PRIMARY KEY) engine = InnoDB;
|
||||
# There is deadlock_report_before_lock_releasing sync point in
|
||||
# Deadlock::report(), which is waiting for sel_cont signal under
|
||||
# lock_sys_t lock. The signal must be issued after "UPDATE t SET b = 100"
|
||||
# rollback, and that rollback is executing undo record, which is blocked on
|
||||
# dict_sys latch request. dict_sys is locked by the thread of statistics
|
||||
# update(dict_stats_save()), and during that update lock_sys lock is requested,
|
||||
# and can't be acquired as Deadlock::report() holds it. We have to disable
|
||||
# statistics update to make the test stable.
|
||||
|
||||
CREATE TABLE t (a int PRIMARY KEY, b int) engine = InnoDB STATS_PERSISTENT=0;
|
||||
CREATE TABLE t2 (a int PRIMARY KEY) engine = InnoDB STATS_PERSISTENT=0;
|
||||
|
||||
INSERT INTO t VALUES (10, 10), (20, 20), (30, 30);
|
||||
INSERT INTO t2 VALUES (10), (20), (30);
|
||||
@@ -58,5 +64,4 @@ SET DEBUG_SYNC="lock_wait_before_suspend SIGNAL upd_cont";
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t;
|
||||
DROP TABLE t2;
|
||||
--disconnect suspend_purge
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
1
mysql-test/suite/innodb/t/deadlock_wait_thr_race.opt
Normal file
1
mysql-test/suite/innodb/t/deadlock_wait_thr_race.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb-force-recovery=2
|
@@ -2,17 +2,23 @@
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--connect(suspend_purge,localhost,root,,)
|
||||
# Purge can cause deadlock in the test, requesting page's RW_X_LATCH for trx
|
||||
# ids reseting, after trx 2 acqured RW_S_LATCH and suspended in debug sync point
|
||||
# lock_trx_handle_wait_enter, waiting for upd_cont signal, which must be
|
||||
# emitted after the last SELECT in this test. The last SELECT will hang waiting
|
||||
# for purge RW_X_LATCH releasing, and trx 2 will be rolled back by timeout.
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
|
||||
--connection default
|
||||
CREATE TABLE t (a int PRIMARY KEY, b int) engine = InnoDB;
|
||||
CREATE TABLE t2 (a int PRIMARY KEY) engine = InnoDB;
|
||||
# There is deadlock_report_before_lock_releasing sync point in
|
||||
# Deadlock::report(), which is waiting for sel_cont signal under
|
||||
# lock_sys_t lock. The signal must be issued after "UPDATE t SET b = 100"
|
||||
# rollback, and that rollback is executing undo record, which is blocked on
|
||||
# dict_sys latch request. dict_sys is locked by the thread of statistics
|
||||
# update(dict_stats_save()), and during that update lock_sys lock is requested,
|
||||
# and can't be acquired as Deadlock::report() holds it. We have to disable
|
||||
# statistics update to make the test stable.
|
||||
|
||||
CREATE TABLE t (a int PRIMARY KEY, b int) engine = InnoDB STATS_PERSISTENT=0;
|
||||
CREATE TABLE t2 (a int PRIMARY KEY) engine = InnoDB STATS_PERSISTENT=0;
|
||||
|
||||
INSERT INTO t VALUES (10, 10), (20, 20), (30, 30);
|
||||
INSERT INTO t2 VALUES (10), (20), (30);
|
||||
@@ -62,5 +68,4 @@ SET DEBUG_SYNC="now SIGNAL upd_cont_2";
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t;
|
||||
DROP TABLE t2;
|
||||
--disconnect suspend_purge
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
@@ -195,6 +195,19 @@ INSERT INTO t VALUES (0);
|
||||
INSERT INTO t VALUES (1),(0),(1);
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28327 InnoDB persistent statistics fail to update
|
||||
--echo # after bulk insert
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB;
|
||||
INSERT INTO t1 SELECT * FROM seq_1_to_4096;
|
||||
--echo # Wait till statistics update after bulk insert operation
|
||||
let $wait_condition= select n_rows > 100 from mysql.innodb_table_stats
|
||||
where table_name="t1";
|
||||
source include/wait_condition.inc;
|
||||
SELECT n_rows FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1";
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26947 UNIQUE column checks fail in InnoDB resulting
|
||||
--echo # in table corruption
|
||||
|
76
mysql-test/suite/innodb/t/lock_update_split_rc.test
Normal file
76
mysql-test/suite/innodb/t/lock_update_split_rc.test
Normal file
@@ -0,0 +1,76 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
CREATE TABLE t (
|
||||
`a` INT NOT NULL,
|
||||
`b` INT NOT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
SET @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug;
|
||||
--enable_query_log
|
||||
|
||||
SET GLOBAL innodb_limit_optimistic_insert_debug = 3;
|
||||
|
||||
INSERT INTO t VALUES(10, 0);
|
||||
INSERT INTO t VALUES(20, 0);
|
||||
INSERT INTO t VALUES(30, 0);
|
||||
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
XA START '1';
|
||||
REPLACE INTO t VALUES(10, 1);
|
||||
REPLACE INTO t VALUES(20, 1);
|
||||
|
||||
# We need the following sync point because mysql_insert() resets
|
||||
# trx->duplicates with the following condition:
|
||||
#
|
||||
# if (duplic == DUP_REPLACE &&
|
||||
# (!table->triggers || !table->triggers->has_delete_triggers()))
|
||||
# table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
|
||||
#
|
||||
# and ha_innobase::extra() resets trx_t::duplicates, but we need
|
||||
# lock_update_split_right() to be invoked when trx->duplicates is set to
|
||||
# repeat the bug. So the transaction will hang just after
|
||||
# row_insert_for_mysql() call until another transaction inserts new row and
|
||||
# splits the page.
|
||||
SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL inserted WAIT_FOR cont';
|
||||
--send REPLACE INTO t VALUES(30, 1)
|
||||
|
||||
connect (con1,localhost,root);
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
XA START '2';
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR inserted';
|
||||
# The following statement will cause page split and (20, ...) will be split
|
||||
# record. As the previous REPLACE set non-gap X-lock on it,
|
||||
# lock_update_split_right() and lock_rec_inherit_to_gap() will 'inherit' the
|
||||
# lock from the very first (20, ...) new right page record to the supremum of
|
||||
# the old left page, what should not be for READ COMMITTED isolation level
|
||||
INSERT INTO t VALUES(40, 2);
|
||||
SET DEBUG_SYNC= 'now SIGNAL cont';
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
XA END '1';
|
||||
# This will cause the assertion failure, because the supremum of the left page
|
||||
# has X-lock.
|
||||
XA PREPARE '1';
|
||||
--connection default
|
||||
XA COMMIT '1';
|
||||
|
||||
--connection con1
|
||||
XA END '2';
|
||||
XA PREPARE '2';
|
||||
XA COMMIT '2';
|
||||
--disconnect con1
|
||||
|
||||
--connection default
|
||||
SET DEBUG_SYNC= "RESET";
|
||||
DROP TABLE t;
|
||||
|
||||
--disable_query_log
|
||||
SET GLOBAL innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug;
|
||||
--enable_query_log
|
||||
|
||||
--source include/wait_until_count_sessions.inc
|
@@ -613,3 +613,15 @@ INSERT INTO t VALUES (1);
|
||||
START TRANSACTION READ ONLY;
|
||||
UPDATE t SET a = NULL;
|
||||
ROLLBACK;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29886 Assertion !index->table->is_temporary() failed
|
||||
--echo # in trx_undo_prev_version_build upon CHECK
|
||||
--echo #
|
||||
CREATE TEMPORARY TABLE t (a INT, KEY(a)) ENGINE=InnoDB SELECT 1;
|
||||
UPDATE t SET a=2;
|
||||
CHECK TABLE t;
|
||||
CHECK TABLE t EXTENDED;
|
||||
DROP TEMPORARY TABLE t;
|
||||
--echo # End of 10.6 tests
|
||||
|
Reference in New Issue
Block a user