forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita98a040
committed
Avoid Assert failure when processing empty statement in aborted xact.
exec_parse_message() wants to create a cached plan in all cases,including for empty input. The empty-input path does not havea test for being in an aborted transaction, making it possiblethat plancache.c will fail due to trying to do database lookupseven though there's no real work to do.One solution would be to throw an aborted-transaction error inthis path too, but it's not entirely clear whether the lack ofsuch an error was intentional or whether some clients might berelying on non-error behavior. Instead, let's hack plancache.cso that it treats empty statements with the same logic italready had for transaction control commands, ensuring that itcan soldier through even in an already-aborted transaction.Per bug #17983 from Alexander Lakhin. Back-patch to allsupported branches.Discussion:https://postgr.es/m/17983-da4569fcb878672e@postgresql.org1 parent0e73b9a commita98a040
File tree
3 files changed
+22
-1
lines changed- src
- backend/utils/cache
- test/regress
- expected
- sql
3 files changed
+22
-1
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
| 81 | + | |
| 82 | + | |
81 | 83 |
| |
82 | 84 |
| |
83 |
| - | |
| 85 | + | |
84 | 86 |
| |
85 | 87 |
| |
86 | 88 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
215 | 215 |
| |
216 | 216 |
| |
217 | 217 |
| |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
218 | 229 |
| |
219 | 230 |
| |
220 | 231 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
115 | 123 |
| |
116 | 124 |
| |
117 | 125 |
| |
|
0 commit comments
Comments
(0)