add interval#24793
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
…ixone into 0601-add-interval
XuPeng-SH
left a comment
There was a problem hiding this comment.
I found two blocking issues.
-
The binder still steals some legal
INTERVAL()function calls away from the new builtin path. In this patchbase_binder.gorewritesinterval(...)toT_intervalwheneverisIntervalExprSyntax(args)sees exactly two arguments and the second one is a string literal matching an interval unit. But the builtin itself is registered to accept string arguments, so calls likeinterval(5, 'day')never reach the new numericINTERVAL()implementation even though they are valid under the registered signature. This keeps the old interval-expression path for a subset of function-style calls instead of fully disambiguating the new builtin. -
The string conversion semantics are not MySQL-compatible yet.
makeIntervalParam()usesstrconv.ParseFloat, so inputs such as'',' ','1abc','abc', and'10.9abc'raise hard errors. The new BVT file even documents the intended behavior as “return values with warnings, not fail”, but the checked-in.resultrecords errors instead. That means the implementation and coverage are both locking in behavior that diverges from MySQL for the new function.
What type of PR is this?
Which issue(s) this PR fixes:
issue #24486
What this PR does / why we need it:
增加interval函数