Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- MatrixOne: local single-CN deployment built from the commit above
- MySQL control: MySQL 8.0
- Client: MySQL Connector/J 8.0.33
- Verification: 3 independent roundsActual Behavior
MatrixOne accepts BIT_XOR as a grouped aggregate, and accepts BIT_AND and BIT_OR with OVER, but rejects BIT_XOR(...) OVER (...) with SQLState 42000, error 1064.
The MatrixOne parser grammar already declares the BIT_XOR '(' ... ')' window_spec_opt form, so this looks like an incomplete parser/runtime integration rather than an intentionally unsupported syntax.
MySQL result for the same cumulative window query:
1 | 10
2 | 30
3 | 0
4 | 40
Expected Behavior
BIT_XOR should support an OVER clause like the other bitwise aggregate functions and return the cumulative XOR result.
Steps to Reproduce
DROP DATABASE IF EXISTS window_bit_xor_repro;
CREATE DATABASE window_bit_xor_repro;
USE window_bit_xor_repro;
CREATE TABLE t(id INT PRIMARY KEY, v INT);
INSERT INTO t VALUES (1, 10), (2, 20), (3, 30), (4, 40);
-- Control: grouped aggregate is accepted by MatrixOne.
SELECT BIT_XOR(v) FROM t;
-- MatrixOne returns 42000/1064; MySQL returns 10, 30, 0, 40.
SELECT id,
BIT_XOR(v) OVER (
ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS cumulative_xor
FROM t
ORDER BY id;Stability, controls, and recovery
- Reproduced 3/3 on the commit above.
- MySQL returned the expected result 3/3.
BIT_XORwithoutOVER, andBIT_AND/BIT_ORwithOVER, work in MatrixOne.- After the syntax error, the same connection and a newly prepared statement remain usable.
Root-cause evidence
pkg/sql/parsers/dialect/mysql/mysql_sql.y contains a BIT_XOR production with window_spec_opt, but the generated parse path rejects the OVER form. The existing aggregate implementation therefore cannot be reached through the declared window syntax.
Suggested regression placement
Add a BVT under test/distributed/cases/window/ covering cumulative, partitioned, empty/all-NULL, and explicit-frame BIT_XOR windows alongside BIT_AND and BIT_OR controls.
Related issues
- [Bug]: tracker for remaining CTAS schema inconsistencies with MySQL #24436 tracks CTAS schema differences and does not cover
BIT_XOR ... OVERparsing or execution.
Activity
fix: support bit_xor window function (#27619)
Ariznawlll commentedon Aug 28, 2026
最新 main 复测 3/3:BIT_XOR cumulative/partition/sliding window 结果正确;空集与 NULL 控制正确;非法列报 1054 后连接可继续查询。稳定 MOTR 已加入 https://github.com/matrixorigin/motr/pull/131,并行三轮通过。无需 big-data、PITR/snapshot、stability 或 chaos。结论:关闭。
Ariznawlll commentedon Aug 28, 2026
更正补充:验证基线为 MatrixOne main 28769ff。稳定 MOTR 回归已在 https://github.com/matrixorigin/motr/pull/131,连续并行三轮通过。
fix: support bit_xor window function (matrixorigin#27619)
fix: support bit_xor window function (matrixorigin#27619)
fix: support bit_xor window function (matrixorigin#27619)