fix(plan): prevent panic in resetDateFunctionArgs with invalid interval expression#24284
Merged
mergify[bot] merged 4 commits intomatrixorigin:mainfrom May 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 <noreply@anthropic.com>
ⓘ 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. |
62b0330 to
6adbd85
Compare
6adbd85 to
37557ab
Compare
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 <noreply@anthropic.com>
Update expected outputs from interval(expr, unit) to interval expr unit format to match the new FuncExpr.Format() output for 2-arg interval. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
heni02
approved these changes
May 7, 2026
ouyuanning
approved these changes
May 7, 2026
iamlinjunhong
approved these changes
May 7, 2026
Contributor
Merge Queue Status
This pull request spent 59 minutes 16 seconds in the queue, including 58 minutes 58 seconds running CI. Required conditions to merge
|
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