Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
5.3.13, 5.5, 10.0, 10.1
-
None
-
Windows 7
-
10.0.26
Description
When using the LIKE operator on a varchar column an inproper result is returned if the data contains non standard ASCII chars (e.g. german umlauts).
Steps to reproduce
Create dummy table:
CREATE TABLE ESCAPE_TEST (
|
id int primary key AUTO_INCREMENT,
|
content varchar(500)
|
);
|
Insert dummy data:
INSERT INTO ESCAPE_TEST (CONTENT) VALUES ('Foo');
|
INSERT INTO ESCAPE_TEST (CONTENT) VALUES ('Lorem\\Ipsum');
|
INSERT INTO ESCAPE_TEST (CONTENT) VALUES ('Bar');
|
INSERT INTO ESCAPE_TEST (CONTENT) VALUES ('Fübär');
|
commit;
|
Perform query:
SELECT * FROM ESCAPE_TEST WHERE CONTENT LIKE '%\\\\%';
|
Actual Result
+----+-------------+
|
| id | content |
|
+----+-------------+
|
| 2 | Lorem\Ipsum |
|
| 4 | Fübär |
|
+----+-------------+
|
Expected Result
+----+-------------+
|
| id | content |
|
+----+-------------+
|
| 2 | Lorem\Ipsum |
|
+----+-------------+
|
Further Information / Hints
- Apparently lines containing some none ASCII chars are returned although they don't contain a backslash.
- Problem occures with both InnoDB and MyISAM engine.
- Current version of mysql returns expected result.