Commit cc19476
Address Copilot round 2: NULL-list guard, single() comment, pg_aggregate.h
1. Add NULL-list guard for all predicate functions (all/any/none/single).
Wraps the result with CASE WHEN list IS NULL THEN NULL ELSE <result>
END in the grammar layer. This fixes single(x IN null WHERE ...)
returning false instead of NULL. The expr pointer is safely shared
between the NullTest and the predicate function node because AGE's
expression transformer creates new nodes without modifying the
parse tree in-place.
2. Fix single() block comment in transform_cypher_predicate_function:
described LIMIT 2 optimization but implementation uses plain
count(*). Updated comment to match actual implementation.
3. Keep #include "catalog/pg_aggregate.h" -- Copilot suggested removal
but AGGKIND_NORMAL macro requires it (build fails without it).
Regression test: predicate_functions OK.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 77a6aea commit cc19476
File tree
4 files changed
+58
-19
lines changed- regress
- expected
- sql
- src/backend/parser
4 files changed
+58
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1776 | 1776 | | |
1777 | 1777 | | |
1778 | 1778 | | |
1779 | | - | |
1780 | | - | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
1781 | 1782 | | |
1782 | 1783 | | |
1783 | 1784 | | |
| |||
1786 | 1787 | | |
1787 | 1788 | | |
1788 | 1789 | | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
1792 | 1793 | | |
1793 | 1794 | | |
1794 | | - | |
1795 | | - | |
1796 | 1795 | | |
1797 | 1796 | | |
1798 | 1797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3404 | 3404 | | |
3405 | 3405 | | |
3406 | 3406 | | |
| 3407 | + | |
3407 | 3408 | | |
3408 | 3409 | | |
3409 | 3410 | | |
| |||
3422 | 3423 | | |
3423 | 3424 | | |
3424 | 3425 | | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
3425 | 3430 | | |
3426 | 3431 | | |
3427 | 3432 | | |
| |||
3443 | 3448 | | |
3444 | 3449 | | |
3445 | 3450 | | |
3446 | | - | |
| 3451 | + | |
3447 | 3452 | | |
3448 | 3453 | | |
3449 | 3454 | | |
3450 | 3455 | | |
3451 | 3456 | | |
3452 | 3457 | | |
3453 | 3458 | | |
3454 | | - | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
3455 | 3495 | | |
3456 | 3496 | | |
3457 | 3497 | | |
| |||
0 commit comments