Bug #19688 SHOW PROCESSLIST with only SUPER privilege doesn't diplay all threads
Submitted: 10 May 2006 15:41 Modified: 12 Jun 2006 16:16
Reporter: Gleb Paharenko Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.21-log/4.0BK/4.1BK/5.0BK/5.1BK OS:FreeBSD (freebsd)
Assigned to: Assigned Account CPU Architecture:Any

[10 May 2006 15:41] Gleb Paharenko
Description:
According to:
  http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html

SHOW PROCESSLIST shows you which threads are running. You can also get this information using the mysqladmin processlist command. If you have the SUPER privilege, you can see all threads

However, the user with SUPER privilege sees only its threads.

How to repeat:
mysql> show grants for current_user\G;
*************************** 1. row ***************************
Grants for snmpd@localhost: GRANT SUPER ON *.* TO 'snmpd'@'localhost' IDENTIFIED BY PASSWORD '*48D1BFA7381625FECA561B5BC2CB3420C7A6FAB4'
1 row in set (0.00 sec)

mysql> show processlist;
+----+-------+-----------+------+---------+------+-------+------------------+
| Id | User  | Host      | db   | Command | Time | State | Info             |
+----+-------+-----------+------+---------+------+-------+------------------+
| 22 | snmpd | localhost |      | Query   | 0    |       | show processlist |

mysql> show status like '%threads_connected%';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| Threads_connected | 6     |
+-------------------+-------+

A privileged account in this time shows 6 processes.

Suggested fix:
Make more clear in manual what minimal set of privileges should be grant to an account to see all
processes;
[10 May 2006 16:43] MySQL Verification Team
Thank you for the bug report. I was able to repeat.

mysql> grant super on *.* to 'tester'@'192.168.0.33';
Query OK, 0 rows affected (0.00 sec)

mysql> show processlist;
+----+--------+-------------------+------+---------+------+-------+------------------+
| Id | User   | Host              | db   | Command | Time | State | Info             |
+----+--------+-------------------+------+---------+------+-------+------------------+
|  2 | root   | localhost         | db81 | Query   |    0 | NULL  | show processlist | 
|  3 | tester | 192.168.0.33:2076 | NULL | Sleep   |   24 | NULL  | NULL             | 
+----+--------+-------------------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

c:\mysql\bin>mysql -utester -hhegel
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.22-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show processlist;
+----+--------+-------------------+------+---------+------+-------+------------------+
| Id | User   | Host              | db   | Command | Time | State | Info             |
+----+--------+-------------------+------+---------+------+-------+------------------+
| 3  | tester | 192.168.0.33:2076 |      | Query   | 0    |       | show processlist |
+----+--------+-------------------+------+---------+------+-------+------------------+
1 row in set (0.02 sec)

mysql> exit
Bye
[12 Jun 2006 16:16] Sergei Golubchik
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

It was a bug in the manual, BUG#20009