forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit83604cc
committed
Repair unsafe use of shared typecast-lookup table in plpgsql DO blocks.
DO blocks use private simple_eval_estates to avoid intra-transaction memoryleakage, cf commitc7b849a. I had forgotten about that while writingcommit0fc94a5, but it means that expression execution trees createdwithin a DO block disappear immediately on exiting the DO block, and hencecan't safely be linked into plpgsql's session-wide cast hash table.To fix, give a DO block a private cast hash table to go with its privatesimple_eval_estate. This is less efficient than one could wish, sinceDO blocks can no longer share any cast lookup work with other plpgsqlexecution, but it shouldn't be too bad; in any case it's no worse thanwhat happened in DO blocks before commit0fc94a5.Per bug #13571 from Feike Steenbergen. Preliminary analysis byOleksandr Shulgin.1 parente95126c commit83604cc
File tree
4 files changed
+71
-28
lines changed- src
- pl/plpgsql/src
- test/regress
- expected
- sql
4 files changed
+71
-28
lines changedLines changed: 51 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
101 | 105 |
| |
102 | 106 |
| |
103 | 107 |
| |
| |||
118 | 122 |
| |
119 | 123 |
| |
120 | 124 |
| |
121 |
| - | |
122 |
| - | |
| 125 | + | |
| 126 | + | |
123 | 127 |
| |
124 | 128 |
| |
125 | 129 |
| |
| |||
287 | 291 |
| |
288 | 292 |
| |
289 | 293 |
| |
290 |
| - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
291 | 297 |
| |
292 | 298 |
| |
293 | 299 |
| |
| |||
3271 | 3277 |
| |
3272 | 3278 |
| |
3273 | 3279 |
| |
| 3280 | + | |
| 3281 | + | |
3274 | 3282 |
| |
3275 | 3283 |
| |
3276 | 3284 |
| |
| |||
3319 | 3327 |
| |
3320 | 3328 |
| |
3321 | 3329 |
| |
3322 |
| - | |
| 3330 | + | |
3323 | 3331 |
| |
| 3332 | + | |
3324 | 3333 |
| |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
3325 | 3345 |
| |
| 3346 | + | |
3326 | 3347 |
| |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
3327 | 3368 |
| |
3328 | 3369 |
| |
3329 | 3370 |
| |
| |||
6111 | 6152 |
| |
6112 | 6153 |
| |
6113 | 6154 |
| |
6114 |
| - | |
6115 |
| - | |
6116 |
| - | |
6117 |
| - | |
6118 |
| - | |
6119 |
| - | |
6120 |
| - | |
6121 |
| - | |
6122 |
| - | |
6123 |
| - | |
6124 |
| - | |
6125 |
| - | |
6126 |
| - | |
6127 |
| - | |
6128 |
| - | |
6129 |
| - | |
6130 |
| - | |
6131 |
| - | |
6132 |
| - | |
6133 |
| - | |
6134 | 6155 |
| |
6135 | 6156 |
| |
6136 | 6157 |
| |
6137 | 6158 |
| |
6138 | 6159 |
| |
6139 |
| - | |
| 6160 | + | |
6140 | 6161 |
| |
6141 | 6162 |
| |
6142 | 6163 |
| |
| |||
6221 | 6242 |
| |
6222 | 6243 |
| |
6223 | 6244 |
| |
6224 |
| - | |
| 6245 | + | |
6225 | 6246 |
| |
6226 | 6247 |
| |
6227 | 6248 |
| |
6228 | 6249 |
| |
6229 | 6250 |
| |
6230 | 6251 |
| |
6231 | 6252 |
| |
6232 |
| - | |
| 6253 | + | |
6233 | 6254 |
| |
6234 | 6255 |
| |
6235 | 6256 |
| |
| |||
6251 | 6272 |
| |
6252 | 6273 |
| |
6253 | 6274 |
| |
6254 |
| - | |
| 6275 | + | |
| 6276 | + | |
| 6277 | + | |
6255 | 6278 |
| |
6256 | 6279 |
| |
6257 | 6280 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
801 | 801 |
| |
802 | 802 |
| |
803 | 803 |
| |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
804 | 808 |
| |
805 | 809 |
| |
806 | 810 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4764 | 4764 |
| |
4765 | 4765 |
| |
4766 | 4766 |
| |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
| 4772 | + | |
| 4773 | + | |
4767 | 4774 |
| |
4768 | 4775 |
| |
4769 | 4776 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3836 | 3836 |
| |
3837 | 3837 |
| |
3838 | 3838 |
| |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
3839 | 3848 |
| |
3840 | 3849 |
| |
3841 | 3850 |
| |
|
0 commit comments
Comments
(0)