Reproducer
Tested on Presto 0.297 (Docker image prestodb/presto:latest, digest sha256:7da6d257a4c879f61b5010feca9d73ff70b069935505edb2ecff435cbe486bf9).
CREATE TABLE t0(c0 DOUBLE);
INSERT INTO t0 VALUES (1.0), (2.0), (3.0);
SELECT CASE ((c0 + (-(-(CASE (-1755118259) WHEN c0 THEN c0 WHEN 0.524 THEN c0 ELSE 0.265 END)))) = SOME (VALUES 1658.0000, 5775.0000))
WHEN true THEN (TIMESTAMP '1988-10-10 12:33:56' IN (TIMESTAMP '2008-08-17 04:57:25'))
WHEN true THEN (NOT false)
ELSE (('test') LIKE (''))
END
FROM t0;
Error
Query failed: Compiler failed
The issue appears to be in Presto's bytecode generation when compiling a CASE expression whose operand involves a SOME quantified comparison with mixed numeric types in the inner CASE.
Found by SQLancer.
Reproducer
Tested on Presto 0.297 (Docker image
prestodb/presto:latest, digestsha256:7da6d257a4c879f61b5010feca9d73ff70b069935505edb2ecff435cbe486bf9).Error
The issue appears to be in Presto's bytecode generation when compiling a
CASEexpression whose operand involves aSOMEquantified comparison with mixed numeric types in the innerCASE.Found by SQLancer.