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

Wrong results with LOWER and UPPER and subquery

    XMLWordPrintable

Details

    Description

      This problem is similar to MDEV-10306

      This script:

      SET optimizer_switch=_utf8'derived_merge=on';
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (t VARCHAR(10) CHARSET latin1);
      INSERT INTO t1 VALUES('abcdefghi');
      SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
      

      returns a wrong result:

      +--------------------+
      | c2                 |
      +--------------------+
      | abcdefghiabcdefghi |
      +--------------------+
      

      Notice, there is no the expected dash character in the result.

      The same problem is repeatable with UPPER:

      SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
      

      +--------------------+
      | c2                 |
      +--------------------+
      | ABCDEFGHIABCDEFGHI |
      +--------------------+
      

      Attachments

        Issue Links

          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.