Commit 423887c
committed
fix: improve COALESCE handling and jsonb_array_length compatibility
This commit addresses two issues with PostgreSQL compatibility:
1. COALESCE expression handling:
- Recursively process all expressions in COALESCE arguments
- Handles nested function calls within COALESCE (e.g., jsonb_array_length)
- Previously only processed SubLink nodes, now handles all expression types
2. jsonb_array_length return type:
- Cast result to INTEGER to match PostgreSQL's int4 return type (OID 23)
- PostgreSQL's jsonb_array_length() returns INTEGER, not BIGINT or UBIGINT
- Updated test expectations from XID8OID (5069) to Int4OID (23)
Tests added:
- COALESCE with JSONB types
- jsonb_array_length with COALESCE expressions1 parent a56c8ce commit 423887c
3 files changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
362 | 360 | | |
363 | 361 | | |
364 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments