pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Make ExecGetInsertedCols() and friends more robust and improve c 4+ messages / 1 participants [nested] [flat]
* pgsql: Make ExecGetInsertedCols() and friends more robust and improve c @ 2021-02-15 07:31 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 4+ messages in thread From: Heikki Linnakangas @ 2021-02-15 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/18cacf89b9fe5523941b57fbd01d408585e70737 Modified Files -------------- src/backend/executor/execUtils.c | 28 +++++++++++++++++++++------- src/include/nodes/execnodes.h | 15 +++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Make ExecGetInsertedCols() and friends more robust and improve c @ 2021-02-15 07:31 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 4+ messages in thread From: Heikki Linnakangas @ 2021-02-15 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2b81444a88cc499f5d3608c5943e9a6e4b489070 Modified Files -------------- src/backend/executor/execUtils.c | 28 +++++++++++++++++++++------- src/include/nodes/execnodes.h | 15 +++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Make ExecGetInsertedCols() and friends more robust and improve c @ 2021-02-15 07:31 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 4+ messages in thread From: Heikki Linnakangas @ 2021-02-15 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/54e51dcde03e5c746e8de6243c69fafdc8d0ec7a Modified Files -------------- src/backend/executor/execUtils.c | 28 +++++++++++++++++++++------- src/include/nodes/execnodes.h | 15 +++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Make ExecGetInsertedCols() and friends more robust and improve c @ 2021-02-15 07:31 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 4+ messages in thread From: Heikki Linnakangas @ 2021-02-15 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6e437ce5a6b64c443cf7c907db0988bf571e6042 Modified Files -------------- src/backend/executor/execUtils.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-02-15 07:31 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-02-15 07:31 pgsql: Make ExecGetInsertedCols() and friends more robust and improve c Heikki Linnakangas <heikki.linnakangas@iki.fi> 2021-02-15 07:31 pgsql: Make ExecGetInsertedCols() and friends more robust and improve c Heikki Linnakangas <heikki.linnakangas@iki.fi> 2021-02-15 07:31 pgsql: Make ExecGetInsertedCols() and friends more robust and improve c Heikki Linnakangas <heikki.linnakangas@iki.fi> 2021-02-15 07:31 pgsql: Make ExecGetInsertedCols() and friends more robust and improve c Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox