Bug #13756 The server variable "Com_select" seems session local variable.
Submitted: 4 Oct 2005 22:48 Modified: 5 Oct 2005 5:01
Reporter: Tetsuro Ikeda Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.13 OS:Windows (Windows2000Pro)
Assigned to: CPU Architecture:Any

[4 Oct 2005 22:48] Tetsuro Ikeda
Description:
The server variable "Com_select" is not shared between sessions and cleared after the session ends.

In MySQL ver4.0 and ver4.1, "Com_select" was global and wasn't cleared after a certain session ended.

How to repeat:
Repeat the following with MySQL 5.0.13:

C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.13-rc-nt-log

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

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 0     |
+---------------+-------+
1 row in set (0.00 sec)

mysql> select version();
+------------------+
| version()        |
+------------------+
| 5.0.13-rc-nt-log |
+------------------+
1 row in set (0.00 sec)

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 1     |
+---------------+-------+
1 row in set (0.00 sec)

mysql> quit
Bye

C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.13-rc-nt-log

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

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 0     |
+---------------+-------+
1 row in set (0.00 sec)

mysql>

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

You can see another result if you try MySQL ver4.1.14 like following:

C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.14-nt-log

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

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 0     |
+---------------+-------+
1 row in set (0.00 sec)

mysql> select version();
+---------------+
| version()     |
+---------------+
| 4.1.14-nt-log |
+---------------+
1 row in set (0.00 sec)

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 1     |
+---------------+-------+
1 row in set (0.00 sec)

mysql> quit
Bye

C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.14-nt-log

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

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 1     |
+---------------+-------+
1 row in set (0.00 sec)

mysql>
[4 Oct 2005 23:23] Tetsuro Ikeda
I guess all other "Com_XXX" variables got same issue.

D:\share>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.13-rc-nt-log

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

mysql> show status like 'Com_show_status';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| Com_show_status | 1     |
+-----------------+-------+
1 row in set (0.00 sec)

mysql> show status like 'Com_show_status';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| Com_show_status | 2     |
+-----------------+-------+
1 row in set (0.00 sec)

mysql> quit
Bye

D:\share>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.13-rc-nt-log

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

mysql> show status like 'Com_show_status';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| Com_show_status | 1     |
+-----------------+-------+
1 row in set (0.00 sec)

mysql>
[5 Oct 2005 1:34] Masato Koga
I try to do another situation with some different MySQL Clients on MySQL Server 5.1.13.

Used clients...
mysql (ver 4.1.14)
mysql (ver 5.1.13)
Connector/ODBC (ver 3.51.10)
Connector/J (ver 3.1.10)

With mysql (ver 5.1.13), Connector/ODBC and Connector/J, the server variable "Com_select" is not shared between sessions and cleared
after the session ends.

But using mysql (ver 4.1.14), "Com_select" was global and wasn't cleared after a
certain session ended.
[5 Oct 2005 5:02] Jorge del Conde
Hi!

This behaviour changed in 5.0.

mysql> show status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 0     |
+---------------+-------+
1 row in set (0.00 sec)

mysql> show global status like 'Com_select';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_select    | 3     |
+---------------+-------+
1 row in set (0.00 sec)