Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Not a Bug
-
10.1.7
-
None
-
CentOS 6.7
Description
Hi,
table_lock_waited is not increased if an INSERT has to wait for a lock table. Reproduce:
1. LOCK TABLE a WRITE;
2. other thread: insert into table a
3. First thread: unlock tables;
4. Observe: SHOW GLOBAL status LIKE 'table_locks_waited';
Command output:
|
|
MariaDB [hello]> show create table a;
|
+-------+----------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+----------------------------------------------------------------------------------------------------------------------------------------+
|
| a | CREATE TABLE `a` (
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
UNIQUE KEY `id` (`id`)
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
+-------+----------------------------------------------------------------------------------------------------------------------------------------+
|
1 row in set (0.00 sec)
|
|
|
MariaDB [hello]> lock table a write;
|
Query OK, 0 rows affected (0.00 sec)
|
|
|
MariaDB [hello]>
|
[2]+ Stopped mysql
|
[root@galera1 my.cnf.d]# fg 1
|
mysql
|
|
|
MariaDB [hello]> insert into a values(null);
|
|
|
|
|
|
|
|
|
^Z
|
[1]+ Stopped mysql
|
[root@galera1 my.cnf.d]# fg 2
|
mysql
|
|
|
MariaDB [hello]> unlock tables;
|
Query OK, 0 rows affected (0.00 sec)
|
|
|
MariaDB [hello]> show global status like 'table_lock%';
|
+-----------------------+-------+
|
| Variable_name | Value |
|
+-----------------------+-------+
|
| Table_locks_immediate | 26 |
|
| Table_locks_waited | 0 |
|
+-----------------------+-------+
|
2 rows in set (0.00 sec)
|
|
|
MariaDB [hello]>
|
|
|
mysql Ver 15.1 Distrib 10.1.7-MariaDB, for Linux (x86_64) using readline 5.1
|