mariadb/mysql-test/main/mdl.result
Thirunarayanan Balathandayuthapani e996f77cd8 MDEV-32897 main suite test case prints extra row for metadata_lock_info query
- Added the parameter stats_persistent=0 for InnoDB engine.
- Before printing metadata_lock_info query, make sure that
InnoDB does complete purging.

Reviewed by: Marko Mäkelä
2023-11-29 17:43:40 +05:30

140 lines
4.5 KiB
Text

#
# MDEV-12882 - Assertion `mdl_ticket->m_type == MDL_SHARED_UPGRADABLE ||
# mdl_ticket->m_type == MDL_SHARED_NO_WRITE ||
# mdl_ticket->m_type == MDL_SHARED_NO_READ_WRITE ||
# mdl_ticket->m_type == MDL_SHARED_READ'
# failed in MDL_context::upgrade_shared_lock
#
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1(a INT) ENGINE=InnoDB;
CREATE TABLE t3(a INT) ENGINE=myisam;
InnoDB 0 transactions not purged
LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_TRANS_DML Backup lock
MDL_SHARED_NO_READ_WRITE Table metadata lock test t1
UNLOCK TABLES;
LOCK TABLES t1 AS t2 READ, t1 WRITE CONCURRENT;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_TRANS_DML Backup lock
MDL_SHARED_WRITE Table metadata lock test t1
MDL_SHARED_READ_ONLY Table metadata lock test t1
UNLOCK TABLES;
LOCK TABLES t1 WRITE CONCURRENT, t3 WRITE;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_DDL Backup lock
MDL_BACKUP_DML Backup lock
MDL_SHARED_WRITE Table metadata lock test t1
MDL_SHARED_NO_READ_WRITE Table metadata lock test t3
MDL_INTENTION_EXCLUSIVE Schema metadata lock test
UNLOCK TABLES;
LOCK TABLES t3 WRITE, t1 WRITE CONCURRENT;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_DDL Backup lock
MDL_BACKUP_DML Backup lock
MDL_SHARED_WRITE Table metadata lock test t1
MDL_SHARED_NO_READ_WRITE Table metadata lock test t3
MDL_INTENTION_EXCLUSIVE Schema metadata lock test
UNLOCK TABLES;
LOCK TABLES t1 WRITE, mysql.user WRITE;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_DDL Backup lock
MDL_SHARED_NO_READ_WRITE Table metadata lock mysql user
MDL_SHARED_NO_READ_WRITE Table metadata lock test t1
MDL_INTENTION_EXCLUSIVE Schema metadata lock mysql
MDL_SHARED_NO_READ_WRITE Table metadata lock mysql global_priv
MDL_INTENTION_EXCLUSIVE Schema metadata lock test
UNLOCK TABLES;
LOCK TABLES mysql.general_log WRITE;
ERROR HY000: You can't use locks with log tables
LOCK TABLES t1 WRITE,information_schema.tables READ;
UNLOCK TABLES;
DROP TABLE t1,t3;
#
# Check MDL locks taken for different kind of tables by open
#
CREATE TABLE t1(a INT) stats_persistent=0, ENGINE=InnoDB;
CREATE TABLE t3(a INT) ENGINE=myisam;
connect locker,localhost,root,,;
connection default;
FLUSH TABLES WITH READ LOCK;
connection locker;
insert into t1 values (1);
connection default;
InnoDB 0 transactions not purged
connection default;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_FTWRL2 Backup lock
MDL_SHARED_WRITE Table metadata lock test t1
unlock tables;
connection locker;
unlock tables;
connection default;
FLUSH TABLES WITH READ LOCK;
connection locker;
insert into t3 values (2);
connection default;
InnoDB 0 transactions not purged
connection default;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_BACKUP_FTWRL2 Backup lock
MDL_SHARED_WRITE Table metadata lock test t3
unlock tables;
connection locker;
unlock tables;
connection default;
disconnect locker;
DROP TABLE t1,t3;
#
# MDEV-28820 MyISAM wrong server status flags
#
create table t1 (a int);
set autocommit=0;
select @@in_transaction;
@@in_transaction
0
select * from t1;
a
select @@in_transaction;
@@in_transaction
0
connect foo,localhost,root;
drop table t1;
connection default;
set autocommit=1;
create table t1 (a int);
create table t2 (b int) engine=innodb;
set autocommit=0;
select @@in_transaction;
@@in_transaction
0
select * from t2;
b
select @@in_transaction;
@@in_transaction
1
select * from t1;
a
connection foo;
drop table t1;
connection default;
select * from t1;
a
commit;
connection foo;
disconnect foo;
connection default;
set autocommit=default;
drop table t2;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
#
# End of 10.4 tests
#