diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2021-02-15 09:28:08 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2021-02-15 09:29:45 +0200 |
commit | 2b81444a88cc499f5d3608c5943e9a6e4b489070 (patch) | |
tree | ebadc4226504db4222e9dc901179dd6f67b849e9 /src/backend/commands/trigger.c | |
parent | a27f3a7f4159c5afaf33932df16ca4fed6689c06 (diff) | |
download | postgresql-2b81444a88cc499f5d3608c5943e9a6e4b489070.tar.gz postgresql-2b81444a88cc499f5d3608c5943e9a6e4b489070.zip |
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 6214e2b228,
ri_RangeTableIndex is zero for ResultRelInfos created for partition tuple
routing.
Noted by Coverity. Backpatch down to v11, like commit 6214e2b228.
Reviewed-by: Tom Lane, Amit Langote
Diffstat (limited to 'src/backend/commands/trigger.c')
0 files changed, 0 insertions, 0 deletions