Commit 5392e89
Fix INTERVAL parsing to handle both embedded and separate units
Use different precedence based on the first token of the interval value:
- String literals like '1 day' have embedded units, so use ADD_PREC
to stop before arithmetic operators
- Other expressions need arithmetic included before the unit, so use
LOWEST precedence
This fixes `interval '1 day' - interval '1 hour'` (two separate intervals)
while still handling `INTERVAL number - 15 MONTH` correctly (arithmetic
expression with separate unit).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent caaaad4 commit 5392e89
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1718 | 1718 | | |
1719 | 1719 | | |
1720 | 1720 | | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
1724 | 1731 | | |
1725 | 1732 | | |
1726 | 1733 | | |
| |||
0 commit comments