Dolt BIT_OR ignores ORDER BY when selecting its window frame
Author: Yibo-DongCreated Sep 15, 2026Updated Sep 16, 2026
Labelsbuggood reprocustomer issue
What happened
For a legal ordered BIT_OR window, Dolt evaluates the whole partition unless the SQL redundantly spells out the default RANGE frame.
Environment
Dolt main (commit 92baa5e78afd013b42a62d21b05da0481031e8d0). MySQL version 8.0.43.
How to reproduce
Run the corresponding SQL in a fresh Dolt repository.
CREATE TABLE t(id INT PRIMARY KEY, x INT, v INT);
INSERT INTO t VALUES (1,1,1),(2,2,2),(3,3,4);
SELECT id,
BIT_OR(v) OVER (ORDER BY x) AS implicit_frame,
BIT_OR(v) OVER (
ORDER BY x
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS explicit_equivalent
FROM t
ORDER BY id;Expected Result
The exact SQL above was run against MySQL 8.0.43. MySQL returned:
1 1 1
2 3 3
3 7 7The implicit and explicit default RANGE frames are equivalent, and their running bitwise OR is 1, 3, 7.
Dolt actual
Dolt returned:
1 7 1
2 7 3
3 7 7Source: dolthub/dolt