1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-27 22:56:53 +03:00

set_deparse_plan: Reuse variable to appease Coverity

Coverity complains that dpns->outer_plan is deferenced (to obtain
->targetlist) when possibly NULL.  We can avoid this by using
dpns->outer_tlist instead, which was already obtained a few lines up.

The fact that we end up with
  dpns->inner_tlist = dpns->outer_tlist
is a bit suspicious-looking and maybe worthy of more investigation, but
I'll leave that for another day.

Reviewed-by: Michaël Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/202204191345.qerjy3kxi3eb@alvherre.pgsql
This commit is contained in:
Alvaro Herrera 2022-04-20 11:44:08 +02:00
parent a87e759569
commit e70813fbc4
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE

View File

@ -4996,7 +4996,7 @@ set_deparse_plan(deparse_namespace *dpns, Plan *plan)
if (IsA(plan, ModifyTable))
{
if (((ModifyTable *) plan)->operation == CMD_MERGE)
dpns->inner_tlist = dpns->outer_plan->targetlist;
dpns->inner_tlist = dpns->outer_tlist;
else
dpns->inner_tlist = ((ModifyTable *) plan)->exclRelTlist;
}