Bug #81348 table_locks_waited not updated in MySQL 5.7

Submitted: 8 May 2016 16:52 Modified: 10 May 2016 15:41
Reporter: Peter Zaitsev Email Updates:
Status: In progress Impact on me:
None 
Category:MySQL Server: Locking Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[8 May 2016 16:52] Peter Zaitsev
Description:
It does not look like table_locks_waited is properly updated in MySQL 5.7

Running sysbench on MyISAM  I see

|  464 | sbtest | localhost | myisam | Query   |    5 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE                                                                            |         0 |             0 |
|  465 | sbtest | localhost | myisam | Query   |    4 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE                                                                            |         0 |             0 |
|  466 | sbtest | localhost | myisam | Query   |    5 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE                                                                            |         0 |             0 |
|  467 | sbtest | localhost | myisam | Query   |    4 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE                                                                            |         0 |             0 |
|  468 | sbtest | localhost | myisam | Query   |    4 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE                                                                            |         0 |             0 |
|  469 | sbtest | localhost | myisam | Query   |    4 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE                                                                            |         0 |             0 |
|  470 | sbtest | localhost | myisam | Query   |    4 | Waiting for table metadata lock | LOCK TABLES sbtest1 WRITE 

Yet:

mysql> show global status like "%table_lock%";
+-----------------------------------------+--------+
| Variable_name                           | Value  |
+-----------------------------------------+--------+
| Performance_schema_table_lock_stat_lost | 0      |
| Table_locks_immediate                   | 207780 |
| Table_locks_waited                      | 0      |
+-----------------------------------------+--------+
3 rows in set (0.00 sec)

Looks like this status  is no longer updated at least with lock tables caused locks.

How to repeat:
See Above
[10 May 2016 15:41] MySQL Verification Team
Pjotr,

I have tested it and it proves that you are right. 

It is low priority verified bug.
[28 May 1:13] MySQL Admin
Posted by developer: Bug status updated to 'In progress'

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.