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

Commit2e56fa8

Browse files
committed
Call FDW validator functions even when the options list is empty.
This is useful since a validator might want to require certain optionsto be provided. The passed array is an empty text array in this case.Per suggestion by Laurenz Albe, though this is not quite his patch.
1 parent9a0bdc8 commit2e56fa8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/backend/commands/foreigncmds.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,18 @@ transformGenericOptions(Oid catalogId,
165165

166166
result=optionListToArray(resultOptions);
167167

168-
if (OidIsValid(fdwvalidator)&&DatumGetPointer(result)!=NULL)
169-
OidFunctionCall2(fdwvalidator,result,ObjectIdGetDatum(catalogId));
168+
if (OidIsValid(fdwvalidator))
169+
{
170+
Datumvalarg=result;
171+
172+
/*
173+
* Pass a null options list as an empty array, so that validators
174+
* don't have to be declared non-strict to handle the case.
175+
*/
176+
if (DatumGetPointer(valarg)==NULL)
177+
valarg=PointerGetDatum(construct_empty_array(TEXTOID));
178+
OidFunctionCall2(fdwvalidator,valarg,ObjectIdGetDatum(catalogId));
179+
}
170180

171181
returnresult;
172182
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp