Bug #18830 incompatibility new libraries with old server
Submitted: 6 Apr 2006 6:39 Modified: 11 Apr 2006 13:36
Reporter: Oleksandr Byelkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0 OS:
Assigned to: Alexander Barkov CPU Architecture:Any

[6 Apr 2006 6:39] Oleksandr Byelkin
Description:
my_bool mysql_reconnect(MYSQL *mysql) send on server 'SET NAMES' command without server version check (via mysql_set_character_set() call). Naturally it lead to error which will be connected with any command (ping for example).

How to repeat:
it is difficult to repeat because reconnect need, but looking on sql-common/client.c text is enougch:

my_bool mysql_reconnect(MYSQL *mysql)
{
...
  if (mysql_set_character_set(&tmp_mysql, mysql->charset->csname))
  {
 ...
[6 Apr 2006 6:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4537
[6 Apr 2006 7:17] Oleksandr Byelkin
But please run whole test suite before push.
[6 Apr 2006 7:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4540
[6 Apr 2006 11:43] Alexander Barkov
Fixed in 4.1.19, 5.0.21, 5.1.9
[11 Apr 2006 13:36] Paul DuBois
Noted in 4.1.19, 5.0.21, 5.1.9 changelogs.

          <literal>mysql_reconnect()</literal> sent a <literal>SET
          NAMES</literal> statement to the server, even for pre-4.1
          servers that do not understand the statement. (Bug #18830)