Commit cef9488
committed
Fix issue #217: Wrap FuncCall arguments in parentheses when using :: cast syntax
- Fixes operator precedence issues with double casts like CAST(...AS text)::date
- Wraps FuncCall arguments (e.g., AT TIME ZONE expressions) in parentheses
- Prevents :: operator from binding to wrong operand
- Refactored empty if block to pass lint checks
- Updated pg-catalog snapshot to reflect correct parenthesization
This is a minimal fix with only 13 lines changed in the TypeCast function.
Co-Authored-By: Dan Lynch <[email protected]>1 parent 95ae97e commit cef9488
File tree
2 files changed
+8
-3
lines changed- packages/deparser
- __tests__/misc/__snapshots__
- src
2 files changed
+8
-3
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2255 | 2255 | | |
2256 | 2256 | | |
2257 | 2257 | | |
2258 | | - | |
2259 | | - | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
2260 | 2261 | | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
2261 | 2266 | | |
2262 | 2267 | | |
2263 | 2268 | | |
| |||
0 commit comments