Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-9368

Improper result returned when using escaped backslash in query using like

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 5.3.13, 5.5, 10.0, 10.1
    • N/A
    • Character Sets
    • 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.

      Attachments

        Activity

          People

            bar Alexander Barkov
            Christian.Schmid Christian Schmid
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.