Skip to content
Snippets Groups Projects
Commit 1377b409 authored by Tom Lane's avatar Tom Lane
Browse files

Fix uninitialized-variable bug.

map_partition_varattnos() failed to set its found_whole_row output
parameter if the given expression list was NIL.  This seems to be
a pre-existing bug that chanced to be exposed by commit 6f6b99d1.
It might be unreachable in v10, but I have little faith in that
proposition, so back-patch.

Per buildfarm.
parent 5f0ac02d
No related branches found
No related tags found
No related merge requests found
...@@ -916,11 +916,11 @@ map_partition_varattnos(List *expr, int target_varno, ...@@ -916,11 +916,11 @@ map_partition_varattnos(List *expr, int target_varno,
Relation partrel, Relation parent, Relation partrel, Relation parent,
bool *found_whole_row) bool *found_whole_row)
{ {
AttrNumber *part_attnos; bool my_found_whole_row = false;
bool my_found_whole_row;
if (expr == NIL) if (expr != NIL)
return NIL; {
AttrNumber *part_attnos;
part_attnos = convert_tuples_by_name_map(RelationGetDescr(partrel), part_attnos = convert_tuples_by_name_map(RelationGetDescr(partrel),
RelationGetDescr(parent), RelationGetDescr(parent),
...@@ -931,6 +931,8 @@ map_partition_varattnos(List *expr, int target_varno, ...@@ -931,6 +931,8 @@ map_partition_varattnos(List *expr, int target_varno,
RelationGetDescr(parent)->natts, RelationGetDescr(parent)->natts,
RelationGetForm(partrel)->reltype, RelationGetForm(partrel)->reltype,
&my_found_whole_row); &my_found_whole_row);
}
if (found_whole_row) if (found_whole_row)
*found_whole_row = my_found_whole_row; *found_whole_row = my_found_whole_row;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment