Commit 6777080
committed
Explicitly support the case that a plancache's raw_parse_tree is NULL.
This only happens if a client issues a Parse message with an empty query
string, which is a bit odd; but since it is explicitly called out as legal
by our FE/BE protocol spec, we'd probably better continue to allow it.
Fix by adding tests everywhere that the raw_parse_tree field is passed to
functions that don't or shouldn't accept NULL. Also make it clear in the
relevant comments that NULL is an expected case.
This reverts commits a73c9db and
2e9650c, which fixed specific crash
symptoms by hacking things at what now seems to be the wrong end, ie the
callee functions. Making the callees allow NULL is superficially more
robust, but it's not always true that there is a defensible thing for the
callee to do in such cases. The caller has more context and is better
able to decide what the empty-query case ought to do.
Per followup discussion of bug #11335. Back-patch to 9.2. The code
before that is sufficiently different that it would require development
of a separate patch, which doesn't seem worthwhile for what is believed
to be an essentially cosmetic change.1 parent ec5896a commit 6777080
File tree
6 files changed
+15
-15
lines changed- src
- backend
- executor
- parser
- tcop
- utils/cache
- include/utils
6 files changed
+15
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2037 | 2037 | | |
2038 | 2038 | | |
2039 | 2039 | | |
2040 | | - | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
2041 | 2043 | | |
2042 | 2044 | | |
2043 | 2045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
298 | 297 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | 298 | | |
303 | 299 | | |
304 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | | - | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
1550 | 1552 | | |
1551 | 1553 | | |
1552 | 1554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2485 | 2485 | | |
2486 | 2486 | | |
2487 | 2487 | | |
2488 | | - | |
2489 | | - | |
2490 | | - | |
2491 | 2488 | | |
2492 | 2489 | | |
2493 | 2490 | | |
| |||
2592 | 2589 | | |
2593 | 2590 | | |
2594 | 2591 | | |
2595 | | - | |
| 2592 | + | |
2596 | 2593 | | |
2597 | 2594 | | |
2598 | 2595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
702 | | - | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
703 | 705 | | |
704 | 706 | | |
705 | 707 | | |
| |||
928 | 930 | | |
929 | 931 | | |
930 | 932 | | |
| 933 | + | |
931 | 934 | | |
932 | 935 | | |
933 | 936 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
0 commit comments