forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6f9bd50
committed
Add locking clause for SB views for update/delete
In expand_security_qual(), we were handling locking correctly when aPlanRowMark existed, but not when we were working with the targetrelation (which doesn't have any PlanRowMarks, but the subquery createdfor the security barrier quals still needs to lock the rows under it).Noted by Etsuro Fujita when working with the Postgres FDW, which wasn'tproperly issuing a SELECT ... FOR UPDATE to the remote side under aDELETE.Back-patch to 9.4 where updatable security barrier views wereintroduced.Per discussion with Etsuro and Dean Rasheed.1 parent77903ed commit6f9bd50
File tree
3 files changed
+206
-157
lines changed- src
- backend/optimizer/prep
- test/regress/expected
3 files changed
+206
-157
lines changedLines changed: 28 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
| |||
98 | 99 |
| |
99 | 100 |
| |
100 | 101 |
| |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
101 | 111 |
| |
102 | 112 |
| |
103 | 113 |
| |
| |||
147 | 157 |
| |
148 | 158 |
| |
149 | 159 |
| |
150 |
| - | |
| 160 | + | |
| 161 | + | |
151 | 162 |
| |
152 | 163 |
| |
153 | 164 |
| |
| |||
160 | 171 |
| |
161 | 172 |
| |
162 | 173 |
| |
163 |
| - | |
| 174 | + | |
164 | 175 |
| |
165 | 176 |
| |
166 | 177 |
| |
| |||
219 | 230 |
| |
220 | 231 |
| |
221 | 232 |
| |
222 |
| - | |
223 |
| - | |
224 |
| - | |
225 |
| - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
226 | 238 |
| |
227 | 239 |
| |
228 | 240 |
| |
| |||
255 | 267 |
| |
256 | 268 |
| |
257 | 269 |
| |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
258 | 279 |
| |
259 | 280 |
| |
260 | 281 |
| |
|
Lines changed: 36 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1034 | 1034 |
| |
1035 | 1035 |
| |
1036 | 1036 |
| |
1037 |
| - | |
1038 |
| - | |
| 1037 | + | |
| 1038 | + | |
1039 | 1039 |
| |
1040 | 1040 |
| |
1041 | 1041 |
| |
1042 |
| - | |
1043 |
| - | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1044 | 1045 |
| |
1045 | 1046 |
| |
1046 |
| - | |
1047 |
| - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1048 | 1050 |
| |
1049 | 1051 |
| |
1050 |
| - | |
1051 |
| - | |
1052 |
| - | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1053 | 1056 |
| |
1054 | 1057 |
| |
1055 | 1058 |
| |
| |||
1058 | 1061 |
| |
1059 | 1062 |
| |
1060 | 1063 |
| |
1061 |
| - | |
1062 |
| - | |
| 1064 | + | |
| 1065 | + | |
1063 | 1066 |
| |
1064 | 1067 |
| |
1065 | 1068 |
| |
1066 |
| - | |
1067 |
| - | |
1068 |
| - | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
1069 | 1073 |
| |
1070 | 1074 |
| |
1071 | 1075 |
| |
| |||
1131 | 1135 |
| |
1132 | 1136 |
| |
1133 | 1137 |
| |
1134 |
| - | |
1135 |
| - | |
| 1138 | + | |
| 1139 | + | |
1136 | 1140 |
| |
1137 | 1141 |
| |
1138 | 1142 |
| |
1139 |
| - | |
1140 |
| - | |
1141 |
| - | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1142 | 1147 |
| |
1143 | 1148 |
| |
1144 |
| - | |
1145 |
| - | |
| 1149 | + | |
| 1150 | + | |
1146 | 1151 |
| |
1147 | 1152 |
| |
1148 | 1153 |
| |
1149 |
| - | |
1150 |
| - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1151 | 1157 |
| |
1152 | 1158 |
| |
1153 |
| - | |
1154 |
| - | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1155 | 1162 |
| |
1156 | 1163 |
| |
1157 |
| - | |
1158 |
| - | |
1159 |
| - | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1160 | 1168 |
| |
1161 | 1169 |
| |
1162 | 1170 |
| |
|
0 commit comments
Comments
(0)