Repository navigation
fix(plan): prevent panic in resetDateFunctionArgs with invalid interval expression - #24283
Merged
mergify[bot] merged 5 commits intoMay 7, 2026
Merged
Conversation
…al expression (matrixorigin#24281) Add bounds checking in resetDateFunctionArgs and resetIntervalFunctionArgs to prevent index-out-of-range panic when the interval expression list has fewer than 2 elements. This fixes a crash when using INTERVAL with non-constant expressions like column references (e.g., `'2024-01-01' + INTERVAL (result % 365) DAY`). Co-Authored-By: Claude Opus 4.6 <[email protected]>
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Two changes to fix INTERVAL with parenthesized expressions: 1. Remove INTERVAL from name_confict in the grammar so that `INTERVAL (expr) unit` is no longer parsed as function call `INTERVAL(expr)` with `unit` becoming a column alias. 2. Change FuncExpr.Format() to output `INTERVAL expr unit` instead of `INTERVAL(expr, unit)` so that internally generated SQL (e.g. CTAS column names) uses the standard interval syntax. Fixes matrixorigin#24281 Co-Authored-By: Claude Opus 4.6 <[email protected]>
jiangxinmeng1
force-pushed
the
fix-interval-panic-24281
branch
from
May 6, 2026 09:38
cbdedc1 to
a940836
Compare
Update expected outputs from `interval(expr, unit)` to `INTERVAL expr unit` to match the new FuncExpr.Format() output for 2-arg interval expressions. Co-Authored-By: Claude Opus 4.6 <[email protected]>
ghost
approved these changes
May 7, 2026
Update expected outputs from `interval(expr, unit)` / `INTERVAL(expr, unit)` to `interval expr unit` / `INTERVAL expr unit` format to match the new FuncExpr.Format() output for 2-arg interval expressions. Co-Authored-By: Claude Opus 4.6 <[email protected]>
aunjgr
approved these changes
May 7, 2026
aunjgr
approved these changes
May 7, 2026
aunjgr
left a comment
Contributor
There was a problem hiding this comment.
Bounds checking fix is correct. Grammar change removing INTERVAL from name_conflict is the right approach — it prevents the parser from treating INTERVAL (expr) unit as a function call. FuncExpr.Format change to emit INTERVAL expr unit is consistent with SQL standard. BVT changes are cosmetic.
ouyuanning
approved these changes
May 7, 2026
iamlinjunhong
approved these changes
May 7, 2026
XuPeng-SH
approved these changes
May 7, 2026
Contributor
Merge Queue Status
This pull request spent 54 minutes 41 seconds in the queue, including 54 minutes 22 seconds running CI. Required conditions to merge
|
1 task done
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
fixes #24281
What this PR does / why we need it:
resetDateFunctionArgsandresetIntervalFunctionArgsto prevent index-out-of-range panic when the interval expression list has fewer than 2 elementsINTERVALwith non-constant expressions like column references (e.g.,'2024-01-01' + INTERVAL (result % 365) DAY FROM generate_series(1, 10) g)🤖 Generated with Claude Code