- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit4ba4bfa
committed
Fix possible loss of sync between rectypeid and underlying PLpgSQL_type.
When revalidate_rectypeid() acts to update a stale record type OIDin plpgsql's data structures, it fixes the active PLpgSQL_rec structas well as the PLpgSQL_type struct it references. However, the latteris shared across function executions while the former is not. In alater function execution, the PLpgSQL_rec struct would be reinitializedby copy_plpgsql_datums and would then contain a stale type OID,typically leading to "could not open relation with OID NNNN" errors.revalidate_rectypeid() can easily fix this, fortunately, just bytreating typ->typoid as authoritative.Per report and diagnosis from Ashutosh Sharma, though this is not hissuggested fix. Back-patch to v11 where this code came in.Discussion:https://postgr.es/m/CAE9k0Pkd4dZwt9J5pS9xhJFWpUtqs05C9xk_GEwPzYdV=GxwWg@mail.gmail.com1 parentfbe0232 commit4ba4bfa
File tree
3 files changed
+17
-1
lines changed- src/pl/plpgsql/src
- expected
- sql
3 files changed
+17
-1
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
479 | 485 |
| |
480 | 486 |
| |
481 | 487 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6858 | 6858 |
| |
6859 | 6859 |
| |
6860 | 6860 |
| |
6861 |
| - | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
| 6867 | + | |
| 6868 | + | |
| 6869 | + | |
| 6870 | + | |
6862 | 6871 |
| |
6863 | 6872 |
| |
6864 | 6873 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
303 | 303 |
| |
304 | 304 |
| |
305 | 305 |
| |
| 306 | + | |
306 | 307 |
| |
307 | 308 |
| |
308 | 309 |
| |
|
0 commit comments
Comments
(0)