forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2b81444
committed
Make ExecGetInsertedCols() and friends more robust and improve comments.
If ExecGetInsertedCols(), ExecGetUpdatedCols() or ExecGetExtraUpdatedCols()were called with a ResultRelInfo that's not in the range table and isn't apartition routing target, the functions would dereference a NULL pointer,relinfo->ri_RootResultRelInfo. Such ResultRelInfos are created when firingRI triggers in tables that are not modified directly. None of the currentcallers of these functions pass such relations, so this isn't a live bug,but let's make them more robust.Also update comment in ResultRelInfo; after commit6214e2b,ri_RangeTableIndex is zero for ResultRelInfos created for partition tuplerouting.Noted by Coverity. Backpatch down to v11, like commit6214e2b.Reviewed-by: Tom Lane, Amit Langote1 parenta27f3a7 commit2b81444
2 files changed
+30
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
1194 | 1194 | | |
1195 | 1195 | | |
1196 | | - | |
| 1196 | + | |
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1208 | 1218 | | |
1209 | 1219 | | |
1210 | 1220 | | |
| |||
1218 | 1228 | | |
1219 | 1229 | | |
1220 | 1230 | | |
1221 | | - | |
| 1231 | + | |
1222 | 1232 | | |
1223 | 1233 | | |
1224 | 1234 | | |
| |||
1230 | 1240 | | |
1231 | 1241 | | |
1232 | 1242 | | |
| 1243 | + | |
| 1244 | + | |
1233 | 1245 | | |
1234 | 1246 | | |
1235 | 1247 | | |
| |||
1243 | 1255 | | |
1244 | 1256 | | |
1245 | 1257 | | |
1246 | | - | |
| 1258 | + | |
1247 | 1259 | | |
1248 | 1260 | | |
1249 | 1261 | | |
| |||
1255 | 1267 | | |
1256 | 1268 | | |
1257 | 1269 | | |
| 1270 | + | |
| 1271 | + | |
1258 | 1272 | | |
1259 | 1273 | | |
1260 | 1274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
401 | 404 | | |
402 | 405 | | |
403 | 406 | | |
| |||
0 commit comments
Comments
(0)