Bug #8832 LIKE or '=' in select - statement is always case sensitive

Submitted: 27 Feb 2005 17:29 Modified: 28 Feb 2005 17:15
Reporter: Harald Gölles Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.3-alpha (bk 27.02.05) OS:Linux (linux)
Assigned to: CPU Architecture:Any

[27 Feb 2005 17:29] Harald Gölles
Description:
Comparison with LIKE or '=' is always case sensitive 

How to repeat:
mysql> SELECT 'a' LIKE 'A';
+--------------+
| 'a' LIKE 'A' |
+--------------+
|            0 |
+--------------+
1 row in set (0.00 sec)

mysql> SELECT 'a' LIKE BINARY 'A';
+---------------------+
| 'a' LIKE BINARY 'A' |
+---------------------+
|                   0 |
+---------------------+
1 row in set (0.00 sec)

mysql> SELECT 'a' LIKE 'a';
+--------------+
| 'a' LIKE 'a' |
+--------------+
|            1 |
+--------------+
1 row in set (0.00 sec)

mysql> SELECT 'a' LIKE BINARY 'a';
+---------------------+
| 'a' LIKE BINARY 'a' |
+---------------------+
|                   1 |
+---------------------+
1 row in set (0.00 sec)

mysql> SELECT 'a' = 'a';
+-----------+
| 'a' = 'a' |
+-----------+
|         1 |
+-----------+
1 row in set (0.00 sec)

mysql> SELECT 'a' = 'A';
+-----------+
| 'a' = 'A' |
+-----------+
|         0 |
+-----------+
1 row in set (0.00 sec)
[28 Feb 2005 0:02] Alexander Keremidarski
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php
[28 Feb 2005 17:15] Dean Ellis
Check your character set and collation variables:

SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';

You should see this behavior if you are using a case-sensitive collation.  If you are seeing this with a case-insensitive collation, please let us know.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.071 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.