Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 12.3.2
Description
Description
MariaDB Server 12.3.2 returns an extra row for `x > ALL` over a UNION of an integer column and an empty BLOB operand. With integer values 9 and 86 in the subquery, the WHERE form incorrectly accepts x=50. Projecting the identical predicate returns false for 50 and true for 90.
Casting the empty BLOB operand to a numeric type, or removing that operand, returns only the correct row. The observations suggest an interaction between set-operation output coercion and the WHERE evaluation path; no source debugging has established the internal cause.
How to repeat
CREATE TEMPORARY TABLE all_nums (v INT);
|
INSERT INTO all_nums VALUES (9),(86); |
CREATE TEMPORARY TABLE all_binary (b BLOB);
|
INSERT INTO all_binary VALUES ('0'); |
CREATE TEMPORARY TABLE all_outer (x INT);
|
INSERT INTO all_outer VALUES (50),(90); |
 |
SELECT x FROM all_outer WHERE x>ALL(
|
SELECT v FROM all_nums UNION SELECT b FROM all_binary WHERE FALSE
|
);
|
Expected result
Only x=90. The second UNION operand contributes no rows. 50 is not greater than 86, while 90 is greater than both 9 and 86.
Actual result
Two rows: x=50 and x=90.