Description:
Very similar to Bug #10210, I started to check SHOW VARIABLES, but it seems SHOW STATUS is still touching global counters.
This makes statistics a bit unreliable, especially if you have GUI tools
or programs like mysqltop running that run lots of meta-data queries, since you can't trust results from this.
How to repeat:
mysql> show global status like 'cr%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 21 |
+-------------------------+-------+
3 rows in set (0.00 sec)
mysql> show global status like 'cr%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 22 |
+-------------------------+-------+
3 rows in set (0.00 sec)
And also:
mysql> show global status like 'cr%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 28 |
+-------------------------+-------+
3 rows in set (0.01 sec)
mysql> show variables like 'cr%';
Empty set (0.00 sec)
mysql> show global status like 'cr%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 30 |
+-------------------------+-------+
3 rows in set (0.00 sec)
Also, please check SHOW GLOBAL VARIABLES. It seems Bug #10210 was fixed for SESSION only, as GLOBAL STATUS is still affected by ifself.
Suggested fix:
SHOW commands should not increment the status counters, since it can skew the results of profiling.