Bug #72218 Bogus connections in P_S.users?
Submitted: 3 Apr 2014 11:37 Modified: 4 Apr 2014 19:06
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:5.6.17 OS:Any
Assigned to: CPU Architecture:Any

[3 Apr 2014 11:37] Peter Laursen
Description:
In P_S.users table a row with user recorded as NULL appear.

How to repeat:
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT * FROM `performance_schema`.`users`;
+------+---------------------+-------------------+
| USER | CURRENT_CONNECTIONS | TOTAL_CONNECTIONS |
+------+---------------------+-------------------+
| NULL |                  19 |                21 |
| root |                   1 |                 1 |
+------+---------------------+-------------------+
2 rows in set (0.00 sec)

mysql>

This is the first client connection to this server and the first query executed after a server restart. It is alos a server that wasn't upgraded from a previous version (so no mysql_upgrade issue).

Suggested fix:
I cannot figure out where the numbers "19" and "21" come from. Docs at http://dev.mysql.com/doc/refman/5.6/en/users-table.html does not explain.  And if it is something internal I think it should no appear at all. 

BTW: why don't we have a `HOST` column in the table as well? The user part alone is not very helpful on systems getting accessed from multiple hosts.
[3 Apr 2014 12:16] Peter Laursen
I posted a separate report for the feature reqeust:
http://bugs.mysql.com/bug.php?id=72219
[3 Apr 2014 13:12] Valeriy Kravchuk
Manual (http://dev.mysql.com/doc/refman/5.6/en/users-table.html) clearly explains what NULL is USER columns means:

" USER

The client user name for the connection, or NULL for an internal thread or user session that failed to authenticate."
[3 Apr 2014 13:19] Peter Laursen
Not sure how I could overlook that!

Anyway are those numbers correct? Numbers look high to me. What are those 'internal threads' appearing at the very moment of server startup (as there definitly have not been any failed authentication attempts since restart)?
[3 Apr 2014 14:20] Valeriy Kravchuk
Yes, numbers look correct. You may want to check P_S.THREADS table for the details about background threads (mostly InnoDB ones).

I honestly see no bug here.
[3 Apr 2014 19:58] Peter Laursen
OK .. so I posted this as well:
http://bugs.mysql.com/bug.php?id=72229

:-)
[4 Apr 2014 19:06] Sveta Smirnova
Thank you for the report.

Closed as "Not a Bug", because documentation, explaining what NULL means found.