Commit b998655
committed
Fix plan cache issue in PL/pgSQL CALL
If we are not going to save the plan, then we need to unset expr->plan
after we are done, also in error cases. Otherwise, we get a dangling
pointer next time around.
This is not the ideal solution. It would be better if we could convince
SPI not to associate a cached plan with a resource owner, and then we
could just save the plan in all cases. But that would require bigger
surgery.
Reported-by: Pavel Stehule <pavel.stehule@gmail.com>1 parent 6a5f796 commit b998655
File tree
3 files changed
+40
-4
lines changed- src/pl/plpgsql/src
- expected
- sql
3 files changed
+40
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2060 | 2060 | | |
2061 | 2061 | | |
2062 | 2062 | | |
| 2063 | + | |
2063 | 2064 | | |
2064 | 2065 | | |
2065 | 2066 | | |
| |||
2069 | 2070 | | |
2070 | 2071 | | |
2071 | 2072 | | |
2072 | | - | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
2073 | 2076 | | |
2074 | 2077 | | |
2075 | 2078 | | |
| |||
2084 | 2087 | | |
2085 | 2088 | | |
2086 | 2089 | | |
2087 | | - | |
2088 | | - | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2089 | 2111 | | |
2090 | 2112 | | |
2091 | 2113 | | |
| |||
2129 | 2151 | | |
2130 | 2152 | | |
2131 | 2153 | | |
2132 | | - | |
| 2154 | + | |
2133 | 2155 | | |
2134 | 2156 | | |
2135 | 2157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
0 commit comments