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

Illegal mix of collations with DAYNAME(date_field)<>varchar_field

    XMLWordPrintable

Details

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
      INSERT INTO t1 VALUES ('test',now());
      SELECT * FROM t1 WHERE DAYNAME(d)<>c;
      

      returns an error:

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

      It should work without errors.

      The same problem is repeatable with MONTHNAME:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
      INSERT INTO t1 VALUES ('test',now());
      SELECT * FROM t1 WHERE MONTHNAME(d)<>c;
      

      Attachments

        Activity

          People

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