Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL)
-
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.