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

EXPLAIN SELECT prints unexpected characters

    Details

    • Sprint:
      10.1.8-2, 10.1.8-3

      Description

      In this script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DECIMAL(10,1),b DECIMAL(10,1),c VARCHAR(10),d VARCHAR(10));
      INSERT INTO t1 VALUES (1.5,1.5,'1','1'),(3.5,3.5,'3','3');
      explain EXTENDED SELECT * FROM t1 WHERE
        COALESCE(c,0)='3 ' AND
        COALESCE(d,0)=COALESCE(c,0);
      SHOW WARNINGS;
      

      the condition gets rewritten by optimizer by replacing COALESCE(c,0) to '3'.
      It seems something goes wrong with the created replacement Item corresponding to '3', so the warnings generated by the EXPLAIN query return dirty characters:

      +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                                                                                                                                                     |
      +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Note  | 1003 | select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '¥¥'))   |
      +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      

      Notice the unexpected YEN signs in the above output.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bar Alexander Barkov added a comment -

            MySQL-5.7.8-rc-debug is not affected

            Show
            bar Alexander Barkov added a comment - MySQL-5.7.8-rc-debug is not affected

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Agile