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

wrong result when comparing utf8 column with an invalid literal

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 5.5(EOL), 10.0(EOL)
    • 5.5.43
    • Character Sets
    • None

    Description

      The test case shows that SELECT returns a row that doesn't match the WHERE condition. This only happens when the column is not indexed, if there's an index the result is correct (no rows found).

      DROP DATABASE IF EXISTS `strict_unicode_test`;
      SET NAMES 'utf8' COLLATE 'utf8_unicode_ci';
      SET SESSION sql_mode='STRICT_ALL_TABLES';
      CREATE DATABASE `strict_unicode_test` COLLATE utf8_unicode_ci;
      USE `strict_unicode_test`;
      SHOW VARIABLES LIKE 'coll%';
      SHOW VARIABLES LIKE 'character%';
      DROP TABLE IF EXISTS `users`;
      CREATE TABLE `users` (
        `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        `login` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
        PRIMARY KEY (`ID`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
      INSERT INTO users (login) VALUES ('admin');
      SELECT * FROM `users` WHERE `login` = 'admin��';
      SHOW WARNINGS;

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Alexander Barkov made transition -
            Open In Review
            36d 21h 51m 1
            Sergei Golubchik made transition -
            In Review Stalled
            15d 1h 45m 1
            Alexander Barkov made transition -
            Stalled Closed
            5d 19h 13m 1

            People

              bar Alexander Barkov
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.