Commit 7a9fee98 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-13568 gcol.innodb_virtual_debug_purge failed in buildbot with wrong result

The InnoDB background tasks can modify tables while LOCK TABLES...WRITE
is in effect. The purge of InnoDB history always worked like this in
MariaDB, but in MySQL 5.7 it sometimes yields to LOCK TABLES.

Also, make gcol.innodb_virtual_index run the purge for an UPDATE
before DROP TABLE is executed.
parent 6f28f784
innodb_virtual_debug_purge : MDEV-13568 should purge yield to LOCK TABLES?
......@@ -143,20 +143,15 @@ connect prevent_purge, localhost, root;
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
connect con1, localhost, root;
connect lock_table, localhost, root;
lock table t write;
disconnect prevent_purge;
connection default;
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
variable_value>1
1
disconnect con1;
InnoDB 0 transactions not purged
disconnect lock_table;
start transaction with consistent snapshot;
commit;
InnoDB 0 transactions not purged
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
variable_value>1
0
set global debug_dbug=@old_dbug;
drop table t;
set debug_sync=reset;
......
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
#
# Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING
# THE NUMBER OF VIRTUAL COLUMNS
......@@ -86,6 +88,7 @@ DISTINCT I1.c14 AS y
FROM t1 AS I1
ORDER BY I1.c14);
SET @@SESSION.sql_mode=default;
InnoDB 0 transactions not purged
DROP TABLE t1, t2, t3;
#
# Bug 22650296 - ASSERTION IN INNOBASE_BUILD_COL_MAP, ALTER
......@@ -194,3 +197,4 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2)
VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
......@@ -182,16 +182,15 @@ connect(prevent_purge, localhost, root);
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
connect(con1, localhost, root);
connect(lock_table, localhost, root);
lock table t write;
disconnect prevent_purge;
connection default;
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
disconnect con1;
--source ../../innodb/include/wait_all_purged.inc
disconnect lock_table;
start transaction with consistent snapshot;
commit;
--source ../../innodb/include/wait_all_purged.inc
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
set global debug_dbug=@old_dbug;
drop table t;
......
--source include/have_innodb.inc
# Ensure that the history list length will actually be decremented by purge.
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
--echo #
--echo # Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING
--echo # THE NUMBER OF VIRTUAL COLUMNS
......@@ -96,6 +100,7 @@ FROM t1 AS I1
ORDER BY I1.c14);
SET @@SESSION.sql_mode=default;
--source ../../innodb/include/wait_all_purged.inc
DROP TABLE t1, t2, t3;
......@@ -218,3 +223,4 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2)
VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace;
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
......@@ -168,7 +168,8 @@ galera_3nodes.* : Suite is not stable yet
gcol.innodb_virtual_basic : Modified in 10.2.11
gcol.innodb_virtual_debug : Modified in 10.2.11
gcol.innodb_virtual_debug_purge : MDEV-13568 - Wrong result
gcol.innodb_virtual_debug_purge : Modified in 10.2.12
gcol.innodb_virtual_index : Modified in 10.2.12
gcol.innodb_virtual_rebuild : Added in 10.2.11
gcol.innodb_virtual_stats : Added in 10.2.12
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment