On Tue, 4 Mar 2003, Fabian Schmidt wrote:

> >Description:
>       A select returns uncomplete results, when querying an indexed
> varchar row with latin1_de character set and strings containing umlauts
> or 'ß'.
>
> >How-To-Repeat:
>
> start MySQL 4.0 with character set latin1_de.
>
> create table test (word varchar(255) not null default '', index(word));
> insert into test values ('ss'),('ß'),('ä'),('ae');
> select * from test where word='ss';
> +------+
> | ss   |
> | ß    |
> +------+
> -> looks fine.
>
> select * from test where word='ß';
> +------+
> | ss   |
> +------+

I would expect that it returns 'ß' as a result as well.

> select * from test where word='ä';
> +------+
> | ae   |
> +------+
> -> is what you least expect.

I can reproduce this on 4.0.10-gamma-debug-log

> To get even more confused, the result is changing:
>
> select * from test where word like 'ae';
> -- ae
> select * from test where word='ä';
> -- ae, ä
> select * from test where word='ae';
> -- ae, ä
> select * from test where word='ä';
> -- ae

I could not reproduce this behaviour on 4.0.10; got both results;

however, when ä and ae are equivalent, is this really a problem? Some
texts do substitute ae for ä and I want to have a hit searching for 'ä'.

but look at this:

mysql> select * from test where word like 'ae';
Empty set (0.00 sec)

Some words like "Tetraeder" have the combination 'ae' and should be found
looking for LIKE '%ae%'; surprisingly this works:

mysql> insert into test values ('Tetraeder');
Query OK, 1 row affected (0.00 sec)

mysql> select * from test where word like '%ae%';
*************************** 1. row ***************************
word: ae
*************************** 2. row ***************************
word: Tetraeder
2 rows in set (0.00 sec)

Whenever there is a joker it works:

mysql> select * from test where word like '%ae';
*************************** 1. row ***************************
word: ae
1 row in set (0.00 sec)

mysql> select * from test where word like 'ae%';
*************************** 1. row ***************************
word: ae
1 row in set (0.00 sec)

but this does not:

mysql> select * from test where word like 'ae';
Empty set (0.00 sec)

Regards,
Thomas Spahni


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to