Bug #69988 Connections status variable does not always increment for each new connection
Submitted: 12 Aug 2013 6:14 Modified: 12 Aug 2013 6:39
Reporter: Jesper wisborg Krogh Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Options Severity:S2 (Serious)
Version:5.6.14 OS:Linux (Oracle Linux 6)
Assigned to: CPU Architecture:Any
Tags: STATUS

[12 Aug 2013 6:14] Jesper wisborg Krogh
Description:
At least when new connections are created rapidly, the Connections status variable does not always increment with each new connection.

This happens both with and without the thread pool plugin enabled.

How to repeat:
1) Ensure MySQL is otherwise idle.
2) Check the current counters:

mysql> SELECT * FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME IN ('Questions', 'Connections', 'Aborted_connects');
+------------------+----------------+
| VARIABLE_NAME    | VARIABLE_VALUE |
+------------------+----------------+
| ABORTED_CONNECTS | 0              |
| CONNECTIONS      | 3              |
| QUESTIONS        | 55             |
+------------------+----------------+
3 rows in set (0.07 sec)

3) In the shell:

while (( 1 )); do mysql -e "SELECT 1"; done

4) After a while, kill the while loop from 3)

5) Check the current counters:

mysql> SELECT * FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME IN ('Questions', 'Connections', 'Aborted_connects');
+------------------+----------------+
| VARIABLE_NAME    | VARIABLE_VALUE |
+------------------+----------------+
| ABORTED_CONNECTS | 0              |
| CONNECTIONS      | 287            |
| QUESTIONS        | 908            |
+------------------+----------------+
3 rows in set (0.00 sec)

Suggested fix:
N/A
[12 Aug 2013 6:38] Jesper wisborg Krogh
Posted by developer:
 
The general query log for one of the connections:

130812 16:30:07   423 Connect   root@localhost on
                  423 Query     select @@version_comment limit 1
                  423 Query     SELECT 1
                  423 Quit

So it's just the "select @@version_comment limit 1" and the Quit that appears to count towards the Connection status variable.

Closing as not a bug.