Bug #13233 | select distinct char(column) fails with utf8 | ||
---|---|---|---|
Submitted: | 15 Sep 2005 16:51 | Modified: | 23 Oct 2005 0:46 |
Reporter: | Richard Wesley | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.14-nt, 4.1.10-standard | OS: | Windows (Windows/Linux) |
Assigned to: | Alexander Barkov | CPU Architecture: | Any |
[15 Sep 2005 16:51]
Richard Wesley
[15 Sep 2005 17:02]
Richard Wesley
The problem does not occur with constants: mysql> select distinct char(10.85*7) from Calcs; Produces 'L', as expected. The same problem also happens with a Linux 4.1.10-standard server.
[16 Sep 2005 8:21]
Vasily Kishkin
Thanks for bug report. I was able to reproduce the bug. On 4.1.14 I found the follow strange results: mysql> select distinct char(75.95) from Calcs; +-------------+ | char(75.95) | +-------------+ | L | +-------------+ 1 row in set (0.00 sec) mysql> select distinct char(10.85*7) from Calcs; +---------------+ | char(10.85*7) | +---------------+ | K | +---------------+ 1 row in set (0.00 sec) I checked on Windows 2003
[23 Sep 2005 7:56]
Vasily Kishkin
I've checked on Linux SUSE 9.3. There is same result.
[10 Oct 2005 8:48]
Alexander Barkov
An easier test demonstrating the same problem: mysql> create table t1 (a int); mysql> insert into t1 values (48),(49),(50); mysql> set names utf8; mysql> select distinct char(a) from t1; +---------+ | char(a) | +---------+ | | +---------+ 1 row in set (0.00 sec) The same work fine with latin1: mysql> create table t1 (a int); mysql> insert into t1 values (48),(49),(50); mysql> set names latin1; mysql> select distinct char(a) from t1; +---------+ | char(a) | +---------+ | 0 | | 1 | | 2 | +---------+ 3 rows in set (0.01 sec)
[10 Oct 2005 8:54]
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/internals/30852
[21 Oct 2005 12:10]
Alexander Barkov
Fixed in 4.1.16 and 5.0.16
[23 Oct 2005 0:46]
Paul DuBois
Noted in 4.1.16, 5.0.16 changelogs.