Commit e1ee4ee
committed
fix: qualified column names with SQL keywords parse as identifiers
Since v0.55.0, qualified column names using SQL keywords failed to
parse. For example, `T.interval` in `PARTITION BY T.key, T.interval
ORDER BY ...` was incorrectly interpreted as an INTERVAL expression
instead of a column.
In `3e90a18` changed `parse_compound_expr` to use `parse_subexpr()` for
tokens after `.`, causing keywords like INTERVAL, CASE, CAST, etc. to be
treated as expression starters.
Explicitly handle `Token::Word` in `parse_compound_expr` by treating it
as an identifier. If followed by `(` (excluding the `(+)` outer join
operator), parse as a method call. This restores the original behavior
where words after `.` were always converted to identifiers.1 parent 3af9988 commit e1ee4ee
2 files changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1856 | 1856 | | |
1857 | 1857 | | |
1858 | 1858 | | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
1859 | 1874 | | |
1860 | 1875 | | |
1861 | 1876 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15009 | 15009 | | |
15010 | 15010 | | |
15011 | 15011 | | |
| 15012 | + | |
| 15013 | + | |
| 15014 | + | |
| 15015 | + | |
| 15016 | + | |
| 15017 | + | |
| 15018 | + | |
| 15019 | + | |
| 15020 | + | |
| 15021 | + | |
| 15022 | + | |
| 15023 | + | |
| 15024 | + | |
| 15025 | + | |
| 15026 | + | |
| 15027 | + | |
| 15028 | + | |
| 15029 | + | |
| 15030 | + | |
| 15031 | + | |
| 15032 | + | |
| 15033 | + | |
| 15034 | + | |
| 15035 | + | |
| 15036 | + | |
| 15037 | + | |
| 15038 | + | |
| 15039 | + | |
| 15040 | + | |
| 15041 | + | |
| 15042 | + | |
| 15043 | + | |
| 15044 | + | |
| 15045 | + | |
| 15046 | + | |
| 15047 | + | |
| 15048 | + | |
| 15049 | + | |
| 15050 | + | |
| 15051 | + | |
| 15052 | + | |
| 15053 | + | |
| 15054 | + | |
| 15055 | + | |
| 15056 | + | |
15012 | 15057 | | |
15013 | 15058 | | |
15014 | 15059 | | |
| |||
0 commit comments