You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ORDER BY NULLS FIRST/LAST syntax is accepted but MySQL rejects it #25332
MySQL does not accept ORDER BY ... NULLS FIRST/LAST syntax. MatrixOne accepts and executes it. This creates a MySQL compatibility gap for syntax that should be rejected by a MySQL-compatible parser.
Reproduction
dropdatabase if exists mysql_compat_module9_nulls_syntax;
createdatabasemysql_compat_module9_nulls_syntax;
use mysql_compat_module9_nulls_syntax;
createtablet(id int, score int);
insert into t values
(1,20),
(2,null),
(3,10),
(4,30),
(5,null);
select id, score from t order by score asc nulls last, id;
select id, score from t order by score desc nulls first, id;
MySQL result
ERROR 1064 (42000): You have an error in your SQL syntax ... near 'nulls last, id'
ERROR 1064 (42000): You have an error in your SQL syntax ... near 'nulls first, id'
Activity
jiangxinmeng1 commentedon Jul 29, 2026
fixed by #25236
Ariznawlll commentedon Jul 30, 2026
测试版本
main(截至 2026-07-30 16:30,Asia/Shanghai)41332062a6740978f269088a92ee362a888c7bd7etc/launch-with-proxy/launch.toml(2 CN + 1 TN + Proxy),SQL 入口127.0.0.1:6001原问题验证
顶层 ORDER BY 的
ASC NULLS LAST、DESC NULLS FIRST均返回明确的 MySQL syntax not supported 错误;完整黑盒 3/3 通过。Happy Path 覆盖
ORDER BY score ASC,id正常执行,NULL 排序结果稳定。Unhappy Path 覆盖
ORDER BY score NULLS LAST同样被拒绝;错误后会话继续可用。白盒验证
TestOrderByRejectsNullsPosition连续 3 轮通过。回归测试
修复提交
2477628c4(#26236)已更新order_by_with_nulls.sql、window BVT 和 parser 测试。测试证据
完整 3 轮 SQL 结果、测试脚本、Proxy 黑盒日志、定向 UT 与
-race输出:https://gist.github.com/Ariznawlll/b8f1a22642a58fd5264482687534728b测试结论
测试通过。
Ariznawlll commentedon Jul 30, 2026
motr 黑盒回归已补充
suites/14_issue_regression/t/issue_25332_nulls_order_rejection.testmain@41332062a6740978f269088a92ee362a888c7bd7,该批 14 个用例连续 3 轮为 42/42 成功(504/504 语句);完整14_issue_regressionsuite 为 124 成功、0 失败。