Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.8, 12.0.2, 12.1.1, 12.1.2
Description
An IN (subquery) expression returns an incorrect result if the column in the subquery is a CHAR or VARCHAR type with a UNIQUE index.The issue is also reproducible if the table is created with `CREATE TABLE t114 (c1 VARCHAR(10), UNIQUE (c1(1)));`. Removing the UNIQUE index produces the correct result.
drop TABLE IF EXISTS t114; |
CREATE TABLE t114 (c1 CHAR, UNIQUE (c1)); |
INSERT t114 () VALUES ('u'); |
select ('uH' IN (SELECT t114.c1 FROM t114)) from t114; |
-- 1
|
 |
drop TABLE IF EXISTS t114; |
CREATE TABLE t114 (c1 CHAR); |
INSERT t114 () VALUES ('u'); |
select ('uH' IN (SELECT t114.c1 FROM t114)) from t114; |
-- 0 |
Attachments
Issue Links
- relates to
-
MDEV-38199 Optimizer Error with = SOME on UNIQUE Column Using Decimal/Integer Types
-
- Confirmed
-