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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5, 10.1, 10.2, 10.0
    • Fix Version/s: 5.5.50
    • Component/s: Character Sets
    • Labels:
      None
    • Sprint:
      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

            Assignee:
            bar Alexander Barkov
            Reporter:
            bar Alexander Barkov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: