Bug #26264 Upgrade to 5.0.33 client hangs when connecting to 3.23.46 server
Submitted: 11 Feb 2007 4:38 Modified: 20 Feb 2007 15:48
Reporter: Peter Fales Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.33 OS:Linux (RedHat 7.3)
Assigned to: CPU Architecture:Any

[11 Feb 2007 4:38] Peter Fales
Description:
After upgrading from 5.0.27 to 5.0.33, users are no longer able to connect to a 3.23.46 server.   strace shows that a request has been sent including "select @@version_comment limit 1" but the client then hangs, waiting unsucessfully for a response.

Comparing the source code, I see that 5.0.33 adds a new function in mysql.cc called server_version_string() which includes the code:

    if (!mysql_query(mysql, "select @@version_comment limit 1") &&

I've been searching the documentation trying to find out if there is an official policy on whether this (using a 5.0 client with a 3.23 server) is supposed to work.   I can understand if the response is "don't do that."  But it has worked for us all the way up to 5.0.27 and it's convenient to have one client that can talk to lots of different servers, rather than having to carefully select a different client for each application.

How to repeat:
Use the 5.0.33 client to connect to a server running 3.23.46.   After the user provides a password in response to the prompt, the client prints "Welcome to the MySQL monitor.  Commands end with ; or \g" and then hangs.
[11 Feb 2007 16:12] MySQL Verification Team
Thank you for the bug report. I was not able to repeat connecting with
latest source client 5.0 (Windows and Linux) against the latest server
3.23:

miguel@light:~/dbs/5.0$ bin/mysql -umiguel -p -h192.168.0.119
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 3.23.59-debug-log

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

mysql>

C:\build\5.0>bin\mysql -umiguel -p -h192.168.0.119
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 3.23.59-debug-log

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

mysql>
[12 Feb 2007 4:34] Peter Fales
Thanks for trying.  Can you confirm which version of the client you are using?  (I've just verified that I'm seeing the problem with the 5.0.33 client and a 3.23.49 server, as well as a 3.23.46 server) 

Also, can you confirm whether a 5.0.x client should be able to work with a 3.23.x  server?  (If it's not expected to work, I'll stop worrying about it.  However, if it is supposed to work, then I'd like to better understand what's happening here)
[12 Feb 2007 14:54] Peter Fales
Another clue??

When I connect to the 3.23.46 or 3.23.49 server (from any client version, including the 3.23.49 client!), and type "select @@version", the client hangs.

If I do the same command with a more up-to-date server, I get:

mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 5.0.26    | 
+-----------+
1 row in set (0.09 sec)
[14 Feb 2007 11:29] Sveta Smirnova
Please connect to the 3.x server with 3.x client and issue select @@version; and say us result. I want to check if problem is client, not 3.x server.
[14 Feb 2007 14:29] Peter Fales
The hang problem occurs when I run "select @@version;" using the 3.23.46 client with the 3.23.46 server AND when I use the 3.23.49 client with the 3.23.49 server AND when I use the 4.1 or 5.0.27 and earlier clients with those servers.  (With 5.0.33, the client hangs before it's possible to type any queries)

For the record, the 3.23.49 client/server that I tested with is the stock rpm installation on a RedHat 7.3 system.
[15 Feb 2007 14:22] Valeriy Kravchuk
Sorry, but if speak about 5.0.33 you had to compile it from sources. So, please, send the exact ./configure command line use and exact OS version (I assume RH 7.3?)
[15 Feb 2007 15:03] Peter Fales
Sorry, I still don't think I'm making myself clear.     There are two problems being discussed (though I think they are related)

Problem 1.  Connect to a 3.23.49 server and type "select @@version" at the mysql prompt.  The client hangs.

I'm able to reproduce the problem on RedHat 7.3 using vendor provided version of mysql (3.23.49) - for both the client and the server.   That makes me think that the problem is inherent to 3.23.x. 

My other comments were just to provide additional information.   While ontinuing to use the vendor-supplied 3.23.49 server, I *also* see the client hang when I use  the 5.0.27 client supplied by Fedora Core 6, *and* a privately compiled version of 5.0.27.  

Problem 2:

Using a privately compiled version of 5.0.33, attempting to connect to a 3.23.49 server hangs before giving the "mysql>" prompt.  The configure command I am using is: 
./configure --prefix=/opt/exp/lib/mysql/5.0 --without-libedit --with-readline --enable-thread-safe-client
[20 Feb 2007 10:08] Valeriy Kravchuk
I think this is a problem of your ages old RH 7.3 (old and buggy NPTL library, likely) and MySQL server. Look:

openxs@suse:~/dbs/3.23> bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.59-debug

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

mysql> select @@version;
+---------------+
| @@VERSION     |
+---------------+
| 3.23.59-debug |
+---------------+
1 row in set (0.01 sec)

mysql> exit
Bye
openxs@suse:~/dbs/3.23> cd ../5.0
openxs@suse:~/dbs/5.0> bin/mysql --version
bin/mysql  Ver 14.12 Distrib 5.0.36, for suse-linux (i686) using readline 5.0
openxs@suse:~/dbs/5.0> bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 3.23.59-debug

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

mysql> select version();
+---------------+
| version()     |
+---------------+
| 3.23.59-debug |
+---------------+
1 row in set (0.00 sec)

mysql> select @@version;
+---------------+
| @@VERSION     |
+---------------+
| 3.23.59-debug |
+---------------+
1 row in set (0.00 sec)

So, with latest 3.23.x server on my SuSE, @@version works, and I see no hangs with 3.2.3.x and latest 5.0.36 mysql command line clients. Upgrade your server to 3.23.58 (that exists for ages).
[20 Feb 2007 15:48] Peter Fales
You're right.  It looks to me like a bug that was fixed between 3.23.49 and 3.23.58.   I no longer see the problem after upgrading the server to 3.23.58.  (I suspect it's a server bug - as opposed to glibc or NPTL - because we're seeing the same thing on solaris.  But it's hard to say) In any case, we have a workaround, so this bug can be closed.  Thanks for the help.
[13 Jul 2007 8:21] Frank Maas
Peter,

In your last comment you state "we have a workaround anyway". Can you shed some light into the workaround? I am experiencing the same problem and am not able to upgrade my mysql installation just yet.

Regards,
Frank