Commit 54e51dc
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 a
partition routing target, the functions would dereference a NULL pointer,
relinfo->ri_RootResultRelInfo. Such ResultRelInfos are created when firing
RI triggers in tables that are not modified directly. None of the current
callers 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 commit 6214e2b,
ri_RangeTableIndex is zero for ResultRelInfos created for partition tuple
routing.
Noted by Coverity. Backpatch down to v11, like commit 6214e2b.
Reviewed-by: Tom Lane, Amit Langote1 parent 46d6e5f commit 54e51dc
2 files changed
+30
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1230 | 1230 | | |
1231 | 1231 | | |
1232 | 1232 | | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1237 | 1237 | | |
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
1244 | | - | |
| 1244 | + | |
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
| |||
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1255 | 1265 | | |
1256 | 1266 | | |
1257 | 1267 | | |
| |||
1265 | 1275 | | |
1266 | 1276 | | |
1267 | 1277 | | |
1268 | | - | |
| 1278 | + | |
1269 | 1279 | | |
1270 | 1280 | | |
1271 | 1281 | | |
| |||
1276 | 1286 | | |
1277 | 1287 | | |
1278 | 1288 | | |
| 1289 | + | |
| 1290 | + | |
1279 | 1291 | | |
1280 | 1292 | | |
1281 | 1293 | | |
| |||
1289 | 1301 | | |
1290 | 1302 | | |
1291 | 1303 | | |
1292 | | - | |
| 1304 | + | |
1293 | 1305 | | |
1294 | 1306 | | |
1295 | 1307 | | |
| |||
1300 | 1312 | | |
1301 | 1313 | | |
1302 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
1303 | 1317 | | |
1304 | 1318 | | |
1305 | 1319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
| |||
0 commit comments