Bug #74176 Duplicate connections in "Client Connections"
Submitted: 1 Oct 2014 11:53 Modified: 1 Oct 2014 17:02
Reporter: Shahriyar Rzayev Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:6.2.3 OS:Linux (Ubuntu 14.04.1 LTS)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[1 Oct 2014 11:53] Shahriyar Rzayev
Description:
Dear experts, 
After installing latest Workbench for testing new "Client Connection" and it shows doubled connections. As a quick check you can select a "default schema" and navigate to "Client Connection" to see doubles connection to this schema.
Here is sample output:

-- Connection Id: 11
-- User: root
-- Host: localhost
-- DB: sys
-- Command: Sleep
-- Time: 160
-- State: None

-- Connection Id: 12
-- User: root
-- Host: localhost
-- DB: sys
-- Command: Sleep
-- Time: 165
-- State: None

-- Connection Id: 13
-- User: root
-- Host: localhost
-- DB: None
-- Command: Query
-- Time: 0
-- State: Sending data

As you see there is doubled connection to sys - DB.
Here is printscreen:

http://s017.radikal.ru/i430/1410/1f/6824383ec244.png

As a consequence check i notice that MySQL Client versions from Local Terminal and from Workbench differ:
For a connection from Workbench (to sys DB) the _client_version is 5.6.19.
(Print Screen: http://s61.radikal.ru/i171/1410/15/567accdb7aa8.png)

But for a connection from Local Linux Terminal _client_version is the latest one: 5.6.21
(Print Screen http://s019.radikal.ru/i609/1410/ec/fc2e95ebdf5d.png).

Important NOTE:  connections from terminal are not duplicated.
As a result showed "duplicated connections" maybe because of outdated _client_version of Workbench.

How to repeat:
Environment related information:
Ubuntu 14.04 LTS with official MySQL APT repo installed.
Client and Server version: 5.6.21.
Workbench version latest GA: 6.2.3

Just install Workbench and test it's "Client Connection".

Suggested fix:
If it is a client library issue maybe an update to version of client which Workbench uses will fix it.
[1 Oct 2014 13:21] MySQL Verification Team
Please check simultaneously the below output with mysql command client:

mysql> show processlist;
+----+------+-----------------+------+---------+------+-------+------------------+
| Id | User | Host            | db   | Command | Time | State | Info             |
+----+------+-----------------+------+---------+------+-------+------------------+
|  2 | root | localhost:55268 | test | Sleep   |  291 |       | NULL             |
|  3 | root | localhost:55269 | test | Sleep   |  303 |       | NULL             |
|  4 | root | localhost:55279 | NULL | Sleep   |   76 |       | NULL             |
|  5 | root | localhost:55281 | NULL | Sleep   |    2 |       | NULL             |
|  6 | root | localhost:55376 | NULL | Query   |    0 | init  | show processlist |
+----+------+-----------------+------+---------+------+-------+------------------+
5 rows in set (0.00 sec)
[1 Oct 2014 13:23] MySQL Verification Team
Connections

Attachment: connections.png (image/png, text), 131.96 KiB.

[1 Oct 2014 13:47] Shahriyar Rzayev
Opening connection to localhost from Workbench and defining polls database as default:

mysql> show processlist;
+----+------+-----------------+-------+---------+------+-------+------------------+
| Id | User | Host            | db    | Command | Time | State | Info             |
+----+------+-----------------+-------+---------+------+-------+------------------+
| 19 | root | localhost:50228 | polls | Sleep   |    6 |       | NULL             |
| 20 | root | localhost:50229 | polls | Sleep   |   17 |       | NULL             |
| 21 | root | localhost:50230 | NULL  | Sleep   |   15 |       | NULL             |
| 22 | root | localhost:50231 | NULL  | Sleep   |    3 |       | NULL             |
| 23 | root | localhost       | NULL  | Query   |    0 | init  | show processlist |
+----+------+-----------------+-------+---------+------+-------+------------------+
5 rows in set (0,00 sec)

Print screen:

http://s012.radikal.ru/i320/1410/17/1e228f6d7b3c.png
[1 Oct 2014 17:02] MySQL Verification Team
Thank you for the feedback. There are connection done by tool itself and becomes in sleep status you can however use the option hidden sleeping connections checking it in the screen bottom. Thanks.