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

Different warnings with and without index on WHERE varchar_column='bad_byte_sequence'

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1
    • 10.1
    • Character Sets
    • None

    Description

      If I run this script with a bad byte sequence (notice '��' is a valid 4-byte utf8mb4 character, but it's not a valid for 3-byte utf8):

      SET NAMES utf8;
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8, KEY(a)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
      SELECT * FROM t1 WHERE a='��';
      SHOW WARNINGS;

      it returns empty set with a warning:

      +---------+------+--------------------------------------------------------------------+
      | Level   | Code | Message                                                            |
      +---------+------+--------------------------------------------------------------------+
      | Warning | 1366 | Incorrect string value: '\xF0\x9F\x98\x8E' for column 'a' at row 1 |
      +---------+------+--------------------------------------------------------------------+

      Now if I drop the index and re-run the SELECT query:

      ALTER TABLE t1 DROP KEY a;
      SELECT * FROM t1 WHERE a='��';
      SHOW WARNINGS;

      it still returns empty set but without any warning.

      It should be fixed to produce the same warnings with and without indexes.
      Preferably, one warning in both cases.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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