Description:
I use the mysql client and MySQL 6.0 source download.
I have SUSE 10.0, which supports UTF-8 by default.
I enter non-ASCII characters, for example
A WITH DIAERESIS ('Ä') on the mysql command line.
Then I try to edit the contents of the line.
I get results that I did not expect.
With MySQL 5.1, I see no similar problem.
I speculate that the difficulty is due to
the recent introduction of new character sets
(WL#1213).
How to repeat:
I use SUSE 10.0, default character set is utf8.
On my keyboard, the setting is 'Ins', that is,
when I type in new characters I don't overwrite
old characters.
I start a session with mysql client thus:
"
pgulutzan@linux:~> /usr/local/mysql/bin/mysql --user=root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.4-alpha-debug Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SET NAMES utf8; /* SET NAMES utf8mb3 makes no difference. */
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES like 'char%';
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------------+
8 rows in set (0.00 sec)
"
On the mysql command line, I enter these three characters:
ÄÄÄ
(I use cut-and-paste to enter.)
I don't type <enter> yet. My screen now looks like this
mysql> ÄÄÄ
And my cursor is just after the ÄÄÄ.
Now, either using the non-destructive cursor-back key,
I position the cursor between the first and second Ä.
I type the space key. My screen now looks like this:
mysql> Ä ÄÄ
Now, using the cursor-forward key,
I position the cursor between the second and third Ä.
I type the space key. My screen now looks like this:
mysql> Ä Ä
That doesn't look right. I expected it to look like this:
mysql> Ä Ä Ä
I can see other situations that don't look right, by using
other editing keys, and by pressing the 'up-cursor' to
copy the last statement. Things go wrong regularly when
there are non-ASCII characters.
This did not happen with version 5.1. I suspect that the
recent changes for 4-byte-UTF-8 characters have affected
the client.