Bug #1572 MySQL 4.1.0 does binary comparision on text columns when using IN
| Submitted: | 16 Oct 2003 8:16 | Modified: | 22 Oct 2003 13:41 |
|---|---|---|---|
| Reporter: | [ name withheld ] | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 4.1.0 | OS: | Linux (Linux) |
| Assigned to: | CPU Architecture: | Any |
[22 Oct 2003 13:41]
Dean Ellis
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.
If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information
about accessing the source trees is available at
http://www.mysql.com/doc/en/Installing_source_tree.html
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: MySQL 4.1.0 seems to be doing a binary comparison when comparing a text column using IN (.. WHERE colname IN ('foo', 'bar')). MySQL reverts to non-binary comparision if column name is preceded with BINARY keyword (.. WHERE BINARY colname IN ('foo', 'bar')) How to repeat: mysql> select count(id) from screenshots where user = 'batmanppc'; +-----------+ | count(id) | +-----------+ | 77 | +-----------+ 1 row in set (0.00 sec) mysql> select count(id) from screenshots where user in ('batmanppc'); +-----------+ | count(id) | +-----------+ | 0 | +-----------+ 1 row in set (0.00 sec) mysql> select count(id) from screenshots where lower(user) in ('batmanppc'); +-----------+ | count(id) | +-----------+ | 77 | +-----------+ 1 row in set (0.02 sec) mysql> select count(id) from screenshots where binary user = 'batmanppc'; +-----------+ | count(id) | +-----------+ | 0 | +-----------+ 1 row in set (0.36 sec) mysql> select count(id) from screenshots where binary user in ('batmanppc'); +-----------+ | count(id) | +-----------+ | 77 | +-----------+ 1 row in set (0.02 sec)