Bug #9637 mysql->charset doesn't change after SET NAMES
Submitted: 5 Apr 2005 9:04 Modified: 12 Jul 2005 18:43
Reporter: Georg Richter
Status: To be fixed later
Category:C API Severity:S3 (Non-critical)
Version:4.1 and abvoe OS:Any (all)
Assigned to: Alexander Barkov Target Version:
Tags: affects_connectors

[5 Apr 2005 9:04] Georg Richter
Description:
When sending "SET NAMES ... " command to the server, mysql->charset doesn't change.

mysql_real_escape_string (escape_string_for_mysql) uses mysql->charset to escape strings,
but uses always the default character set.

How to repeat:
SET NAMES GBR

now try to escape 0xbf27 via mysql_real_escape_string which is a valid gbr char (0x27 =
Backslash)
[5 Apr 2005 15:25] Sergei Golubchik
this is one part of the http://bugs.mysql.com/bug.php?id=8317
[6 Apr 2005 5:57] Jorge del Conde
Verified w/4.1 from bk
[15 Apr 2005 5:24] xuefer tinys
auto-reconnect have more problem. current implement seems lost charset state on
reconnection
[12 Jul 2005 18:43] Georg Richter
Currently the client protocol doesn't support this feature. After sending SET NAMES
statement to the server the server just sends an OK packet.

As a workaround you can use the api function mysql_set_charset_name (available since
MySQL 4.1.13 and MySQL 5.0.10).