What happened
For a legal partitioned aggregate window, Dolt evaluates the disposable REGEXP_LIKE child correctly in the first partition but returns 0 for the same true predicate in the next partition.
Environment
Dolt main (commit c3b5ce3c67f8677ca08a0a58d8c03cdc95bff8b7). MySQL version 8.0.43.
How to reproduce
Run the corresponding SQL in a fresh Dolt repository.
CREATE TABLE t(
g INT PRIMARY KEY,
v INT NOT NULL,
s VARCHAR(8) NOT NULL
);
INSERT INTO t VALUES (0,10,'a'),(1,50,'a');
SELECT g,
SUM(CASE WHEN REGEXP_LIKE(s,'a') THEN v ELSE 0 END)
OVER (PARTITION BY g) AS total
FROM t
ORDER BY g;
Expected Result
MySQL 8.0.43's REGEXP_LIKE(expr, pat) returns 1 when expr matches pat,
and a window result is computed independently for the partition containing
each row. The independent exact-INT expected result is:
This uses no ORDER BY, so the legal default frame is the full partition.
The same expectation follows directly from the two one-row partitions and REGEXP_LIKE('a','a') = 1.
Dolt actual
Dolt returned:
What happened
For a legal partitioned aggregate window, Dolt evaluates the disposable
REGEXP_LIKEchild correctly in the first partition but returns0for the same true predicate in the next partition.Environment
Dolt main (commit
c3b5ce3c67f8677ca08a0a58d8c03cdc95bff8b7). MySQL version 8.0.43.How to reproduce
Run the corresponding SQL in a fresh Dolt repository.
Expected Result
MySQL 8.0.43's
REGEXP_LIKE(expr, pat)returns1whenexprmatchespat,and a window result is computed independently for the partition containing
each row. The independent exact-INT expected result is:
This uses no
ORDER BY, so the legal default frame is the full partition.The same expectation follows directly from the two one-row partitions and
REGEXP_LIKE('a','a') = 1.Dolt actual
Dolt returned: