Bug #2869 Execute SET NAMES automatically for command line clients
Submitted: 18 Feb 2004 7:49 Modified: 19 Feb 2004 6:37
Reporter: Michael G. Zinner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:4.1 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[18 Feb 2004 7:49] Michael G. Zinner
Description:
Execute a SET NAMES directly after connecting to the server using the current charset.

Otherwise there will be a messup when using e.g. umlauts in table names.

How to repeat:
Launch MySQL Monitor.
execute 

show variables like 'character_set%';
+--------------------------+-------------------------------------+
| Variable_name            | Value                               |
+--------------------------+-------------------------------------+
| character_set_server     | latin1                              |
| character_set_system     | utf8                                |
| character_set_database   | latin1                              |
| character_set_client     | latin1                              |
| character_set_connection | latin1                              |
| character-sets-dir       | c:\programme\mysql5\share\charsets/ |
| character_set_results    | latin1                              |
+--------------------------+-------------------------------------+

which is not good.

Suggested fix:
Use the current charset and execute:

set names cp1250;

Then the values will be correct.

mysql> show variables like 'character_set%';
+--------------------------+-------------------------------------+
| Variable_name            | Value                               |
+--------------------------+-------------------------------------+
| character_set_server     | latin1                              |
| character_set_system     | utf8                                |
| character_set_database   | latin1                              |
| character_set_client     | cp1250                              |
| character_set_connection | cp1250                              |
| character-sets-dir       | c:\programme\mysql5\share\charsets/ |
| character_set_results    | cp1250                              |
+--------------------------+-------------------------------------+
[19 Feb 2004 6:37] Sergei Golubchik
already in todo: WL#1349