forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1f6a7eb
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 parent6942663 commit1f6a7eb
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 |
| |
| |||
283 | 287 |
| |
284 | 288 |
| |
285 | 289 |
| |
286 |
| - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
287 | 293 |
| |
288 | 294 |
| |
289 | 295 |
| |
| |||
3286 | 3292 |
| |
3287 | 3293 |
| |
3288 | 3294 |
| |
| 3295 | + | |
| 3296 | + | |
3289 | 3297 |
| |
3290 | 3298 |
| |
3291 | 3299 |
| |
| |||
3333 | 3341 |
| |
3334 | 3342 |
| |
3335 | 3343 |
| |
3336 |
| - | |
| 3344 | + | |
3337 | 3345 |
| |
| 3346 | + | |
3338 | 3347 |
| |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
3339 | 3359 |
| |
| 3360 | + | |
3340 | 3361 |
| |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
3341 | 3382 |
| |
3342 | 3383 |
| |
3343 | 3384 |
| |
| |||
6014 | 6055 |
| |
6015 | 6056 |
| |
6016 | 6057 |
| |
6017 |
| - | |
6018 |
| - | |
6019 |
| - | |
6020 |
| - | |
6021 |
| - | |
6022 |
| - | |
6023 |
| - | |
6024 |
| - | |
6025 |
| - | |
6026 |
| - | |
6027 |
| - | |
6028 |
| - | |
6029 |
| - | |
6030 |
| - | |
6031 |
| - | |
6032 |
| - | |
6033 |
| - | |
6034 |
| - | |
6035 |
| - | |
6036 |
| - | |
6037 | 6058 |
| |
6038 | 6059 |
| |
6039 | 6060 |
| |
6040 | 6061 |
| |
6041 | 6062 |
| |
6042 |
| - | |
| 6063 | + | |
6043 | 6064 |
| |
6044 | 6065 |
| |
6045 | 6066 |
| |
| |||
6124 | 6145 |
| |
6125 | 6146 |
| |
6126 | 6147 |
| |
6127 |
| - | |
| 6148 | + | |
6128 | 6149 |
| |
6129 | 6150 |
| |
6130 | 6151 |
| |
6131 | 6152 |
| |
6132 | 6153 |
| |
6133 | 6154 |
| |
6134 | 6155 |
| |
6135 |
| - | |
| 6156 | + | |
6136 | 6157 |
| |
6137 | 6158 |
| |
6138 | 6159 |
| |
| |||
6154 | 6175 |
| |
6155 | 6176 |
| |
6156 | 6177 |
| |
6157 |
| - | |
| 6178 | + | |
| 6179 | + | |
| 6180 | + | |
6158 | 6181 |
| |
6159 | 6182 |
| |
6160 | 6183 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
796 | 796 |
| |
797 | 797 |
| |
798 | 798 |
| |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
799 | 803 |
| |
800 | 804 |
| |
801 | 805 |
| |
|
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)