Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1377b40

Browse files
committed
Fix uninitialized-variable bug.
map_partition_varattnos() failed to set its found_whole_row outputparameter if the given expression list was NIL. This seems to bea pre-existing bug that chanced to be exposed by commit6f6b99d.It might be unreachable in v10, but I have little faith in thatproposition, so back-patch.Per buildfarm.
1 parent5f0ac02 commit1377b40

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

‎src/backend/catalog/partition.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -916,21 +916,23 @@ map_partition_varattnos(List *expr, int target_varno,
916916
Relationpartrel,Relationparent,
917917
bool*found_whole_row)
918918
{
919-
AttrNumber*part_attnos;
920-
boolmy_found_whole_row;
919+
boolmy_found_whole_row= false;
921920

922-
if (expr==NIL)
923-
returnNIL;
921+
if (expr!=NIL)
922+
{
923+
AttrNumber*part_attnos;
924+
925+
part_attnos=convert_tuples_by_name_map(RelationGetDescr(partrel),
926+
RelationGetDescr(parent),
927+
gettext_noop("could not convert row type"));
928+
expr= (List*)map_variable_attnos((Node*)expr,
929+
target_varno,0,
930+
part_attnos,
931+
RelationGetDescr(parent)->natts,
932+
RelationGetForm(partrel)->reltype,
933+
&my_found_whole_row);
934+
}
924935

925-
part_attnos=convert_tuples_by_name_map(RelationGetDescr(partrel),
926-
RelationGetDescr(parent),
927-
gettext_noop("could not convert row type"));
928-
expr= (List*)map_variable_attnos((Node*)expr,
929-
target_varno,0,
930-
part_attnos,
931-
RelationGetDescr(parent)->natts,
932-
RelationGetForm(partrel)->reltype,
933-
&my_found_whole_row);
934936
if (found_whole_row)
935937
*found_whole_row=my_found_whole_row;
936938

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp