Description:
If I have the new statement "show mutex status;" in a stored procedure, two
anomalies occur. First, even if the show statement is in a loop, the show only
occurs once. Second, if I call the procedure twice, I get "Packets out of order ...".
How to repeat:
mysql> create procedure p () begin declare v int; set v = 0; while v < 100 do show mutex
status; set v = v + 1; end while; end;@
Query OK, 0 rows affected (0.00 sec)
mysql> call p()@
+---------------------------+-------------+-------+------------+-------------+----------+-----------+---------------+
| Mutex | Module | Count | Spin_waits | Spin_rounds | OS_waits | OS_yields |
OS_waits_time |
+---------------------------+-------------+-------+------------+-------------+----------+-----------+---------------+
| &(purge_sys->mutex) | trx0purge.c | 2 | 0 | 0 | 0 | 0 | 0 |
| &(rseg->mutex) | trx0rseg.c | 3 | 0 | 0 | 0 | 0 | 0 |
| &ibuf_mutex | ibuf0ibuf.c | 104 | 0 | 0 | 0 | 0 | 0 |
| &dict_foreign_err_mutex | dict0dict.c | 100 | 0 | 0 | 0 | 0 | 0 |
| &(dict_sys->mutex) | dict0dict.c | 3 | 0 | 0 | 0 | 0 | 0 |
| &(trx_doublewrite->mutex) | trx0sys.c | 1 | 0 | 0 | 0 | 0 | 0 |
| &(recv_sys->mutex) | log0recv.c | 22 | 0 | 0 | 0 | 0 | 0 |
| &ios_mutex | srv0start.c | 9 | 0 | 0 | 0 | 0 | 0 |
| &(log_sys->mutex) | log0log.c | 3284 | 0 | 0 | 0 | 0 | 0 |
| &(buf_pool->mutex) | buf0buf.c | 885 | 0 | 0 | 0 | 0 | 0 |
| &(system->mutex) | fil0fil.c | 276 | 0 | 0 | 0 | 0 | 0 |
| &srv_monitor_file_mutex | srv0start.c | 100 | 0 | 0 | 0 | 0 | 0 |
| &srv_innodb_monitor_mutex | srv0srv.c | 706 | 0 | 0 | 0 | 0 | 0 |
| &(*kernel_mutex_temp) | srv0srv.c | 6415 | 0 | 0 | 0 | 0 | 0 |
| &thr_local_mutex | thr0loc.c | 10 | 0 | 0 | 0 | 0 | 0 |
| &(pool->mutex) | mem0pool.c | 316 | 0 | 0 | 0 | 0 | 0 |
| &rw_lock_list_mutex | sync0sync.c | 528 | 0 | 0 | 0 | 0 | 0 |
| rw_lock_mutexes | | 215 | 0 | 0 | 0 | 0 | 0 |
+---------------------------+-------------+-------+------------+-------------+----------+-----------+---------------+
18 rows in set (0.00 sec)
mysql> call p()@
Packets out of order (Found: 30, expected 1)
ERROR 2013 (HY000): Lost connection to MySQL server during query