[Bug]: YEAR INTERVAL RANGE window frame passes planning but fails in executor
メンテナーはふだん 1 日以内に返信
@matrix-meow がすでに取り組んでいます。
2026年11月27日 から。
評価
この issue はまだ評価されていません。
説明
Is there an existing issue for the same bug?
- I have checked the existing issues.
Searched open and closed issues for YEAR window RANGE frames, INTERVAL bounds, and unsupported type YEAR for RANGE frame in window function. #33171 covers a different YEAR path: a numeric RANGE bound loses its folded constant and reports a missing bound parameter. This report reaches the executor with an INTERVAL bound and fails because the RANGE boundary search has no YEAR implementation.
Branch Name
main
Commit ID
c0cef5c9cce2164fedd201c188bfffe4d2d09a96
Other Environment Information
- Hardware parameters: single-CN local deployment
- OS type: macOS
- Others: MySQL 8.0.46 used as a semantic control; both engines ran the same reproducer twice
Actual Behavior
For a YEAR ordering column, this window query passes EXPLAIN and produces a Window plan, but execution returns Error 20101:
internal error: unsupported type YEAR for RANGE frame in window function
Positive controls on the same data succeed:
- YEAR with a ROWS offset frame;
- YEAR with
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; ORDER BY y+0with a numeric RANGE offset;- an INT column with the same numeric RANGE offset;
- a DATE column with
RANGE BETWEEN INTERVAL 1 YEAR PRECEDING AND CURRENT ROW.
MySQL 8.0.46 does not return window results for the YEAR/INTERVAL query. It rejects both the query and EXPLAIN during semantic checking with Error 3589:
Window '<unnamed window>' with RANGE frame has ORDER BY expression of numeric type,
INTERVAL bound value not allowed.
Thus the compatibility problem is MatrixOne's late internal executor error, not a claim that MySQL evaluates this frame successfully.
Expected Behavior
MatrixOne should consistently handle this frame before execution: either reject the numeric/INTERVAL combination cleanly during semantic analysis, or deliberately implement complete YEAR INTERVAL RANGE semantics. EXPLAIN should not accept a plan that the executor can only fail with an internal unsupported-type error.
Steps to Reproduce
DROP DATABASE IF EXISTS repro_year_interval_window;
CREATE DATABASE repro_year_interval_window;
USE repro_year_interval_window;
CREATE TABLE t(id INT PRIMARY KEY, y YEAR, v INT);
INSERT INTO t VALUES
(1,2020,10),(2,2021,20),(3,2021,30),(4,2023,40),(5,NULL,50);
EXPLAIN
SELECT id,SUM(v) OVER(
ORDER BY y RANGE BETWEEN INTERVAL 1 YEAR PRECEDING AND CURRENT ROW
) FROM t;
-- MatrixOne: Window plan is produced.
SELECT id,SUM(v) OVER(
ORDER BY y RANGE BETWEEN INTERVAL 1 YEAR PRECEDING AND CURRENT ROW
) FROM t ORDER BY id;
-- MatrixOne Error 20101: unsupported type YEAR for RANGE frame
-- MySQL 8.0.46 Error 3589 at semantic checking, including for EXPLAIN.
-- Positive controls on MatrixOne:
SELECT id,SUM(v) OVER(
ORDER BY y ROWS BETWEEN 1 PRECEDING AND CURRENT ROW
) FROM t ORDER BY id;
SELECT id,SUM(v) OVER(
ORDER BY y RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) FROM t ORDER BY id;
SELECT id,SUM(v) OVER(
ORDER BY y+0 RANGE BETWEEN 1 PRECEDING AND CURRENT ROW
) FROM t ORDER BY id;
A DATE control table with equivalent year values successfully executes the INTERVAL 1 YEAR frame on both engines.
Additional Information
In pkg/sql/colexec/window/window.go, the left and right RANGE-boundary search switches handle temporal types such as DATE, DATETIME, TIME, and TIMESTAMP but have no types.T_year branch. YEAR with an INTERVAL bound therefore reaches the fallback that constructs the internal unsupported-type error. This is separate from #33171's planner/constant-folding failure for a numeric YEAR bound.
- 主要言語
- Go
- スター
- 1.9k
- フォーク
- 312
- 平均マージ
- 21時間 57分
- マージ済み PR(30日)
- 730
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matrixorigin/matrixone のほかの issue
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
matrixorigin/matrixone#33363 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
matrixorigin/matrixone#33362 ·
メンテナーはふだん 1 日以内に返信
-
SLEEP rejects NULL and negative durations that MySQL accepts対応中かも @XuPeng-SH が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
matrixorigin/matrixone#32653 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Shared CI loses Coverage results during GitHub throttling and runs 4.2-dev with the wrong Go対応中かも @XuPeng-SH が今日担当しました。 オープン
matrixorigin/matrixone#33416 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: RENAME COLUMN leaves stale partition expression and unreplayable SHOW CREATE対応中かも @matrix-meow が今日担当しました。 オープンkind/bug needs-triage
matrixorigin/matrixone#33397 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
matrixorigin/matrixone の issue をすべて見る
似ている issue
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
go good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Azure/prometheus-collector#1828 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信