Bug #29731 SHOW STATUS and SHOW VARIABLES accept a WHERE clause
Submitted: 11 Jul 2007 18:35 Modified: 24 Jul 2007 15:16
Reporter: Baron Schwartz (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.44, 5.0.38 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[11 Jul 2007 18:35] Baron Schwartz
Description:
SHOW STATUS and SHOW VARIABLES accept a WHERE clause, but the documentation doesn't mention it.

How to repeat:
mysql> show status where Value > 500;
+----------------------------------+----------+
| Variable_name                    | Value    |
+----------------------------------+----------+
| Bytes_sent                       | 7998     | 
| Handler_read_rnd_next            | 1175     | 
| Handler_write                    | 1300     | 
| Innodb_buffer_pool_pages_data    | 512      | 
| Innodb_buffer_pool_pages_total   | 512      | 
| Innodb_buffer_pool_read_requests | 105675   | 
| Innodb_data_read                 | 11259904 | 
| Innodb_data_written              | 35328    | 
| Innodb_os_log_written            | 1024     | 
| Innodb_page_size                 | 16384    | 
| Innodb_pages_read                | 554      | 
| Innodb_rows_read                 | 100142   | 
| Key_blocks_unused                | 14496    | 
| Questions                        | 646      | 
| Uptime                           | 24267    | 
+----------------------------------+----------+

mysql> show variables where value = 'latin1';
+--------------------------+--------+
| Variable_name            | Value  |
+--------------------------+--------+
| character_set_client     | latin1 | 
| character_set_connection | latin1 | 
| character_set_database   | latin1 | 
| character_set_results    | latin1 | 
| character_set_server     | latin1 | 
+--------------------------+--------+
[11 Jul 2007 18:40] Paul DuBois
http://dev.mysql.com/doc/refman/5.0/en/show.html
http://dev.mysql.com/doc/refman/5.0/en/extended-show.html
[11 Jul 2007 18:43] Valeriy Kravchuk
Som this is really documented already.
[11 Jul 2007 18:44] Baron Schwartz
Should the formal description at the top of the sections mention this?  It mentions the optional LIKE clause:

SHOW [GLOBAL | SESSION] STATUS [LIKE 'pattern']

Perhaps it should be something like

SHOW [GLOBAL | SESSION] STATUS [LIKE 'pattern'] [WHERE <where-clause>
[11 Jul 2007 18:46] Valeriy Kravchuk
Indeed, page http://dev.mysql.com/doc/refman/5.0/en/show-variables.html should be updated, I think.
[24 Jul 2007 15:16] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

All SHOW statements that take a LIKE clause also accept a WHERE clause. I have updated the syntax and descriptions for the relevant SHOW statements to indicate this.