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

Illegal mix of collation for a field and an ASCII string as a view field

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5, 10.0, 10.1, 10.2
    • 5.5.50
    • Character Sets
    • None
    • 5.5.50

    Description

      This problem was originally reported by email by David Hall.

      This script:

      SET NAMES utf8;
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
      DROP VIEW v1;
      CREATE VIEW v1 AS SELECT 'a';
      SELECT * FROM v1,t1 where t1.a=v1.a;
      

      returns an error:

      ERROR 1267 (HY000): Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
      

      This is wrong. The string constant in the view is pure ASCII so it can be safely converted to the character set of the field.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            1 Vote for this issue
            Watchers:
            3 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.