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

Commit112caf9

Browse files
committed
Finish reverting commit0a52d37.
Apply the solution adopted in commitdcb7d3c (ie, explicitlydon't call memcmp for a zero-length comparison) to func_get_detail()as well, removing one other place where we were passing anuninitialized array to a parse_func.c entry point.Discussion:https://postgr.es/m/MN2PR18MB2927F24692485D754794F01BE3740@MN2PR18MB2927.namprd18.prod.outlook.comDiscussion:https://postgr.es/m/MN2PR18MB2927F6873DF2774A505AC298E3740@MN2PR18MB2927.namprd18.prod.outlook.com
1 parentc5e8ea9 commit112caf9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

‎src/backend/parser/parse_func.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,9 +1397,6 @@ func_get_detail(List *funcname,
13971397
FuncCandidateListraw_candidates;
13981398
FuncCandidateListbest_candidate;
13991399

1400-
/* Passing NULL for argtypes is no longer allowed */
1401-
Assert(argtypes);
1402-
14031400
/* initialize output arguments to silence compiler warnings */
14041401
*funcid=InvalidOid;
14051402
*rettype=InvalidOid;
@@ -1423,7 +1420,9 @@ func_get_detail(List *funcname,
14231420
best_candidate!=NULL;
14241421
best_candidate=best_candidate->next)
14251422
{
1426-
if (memcmp(argtypes,best_candidate->args,nargs*sizeof(Oid))==0)
1423+
/* if nargs==0, argtypes can be null; don't pass that to memcmp */
1424+
if (nargs==0||
1425+
memcmp(argtypes,best_candidate->args,nargs*sizeof(Oid))==0)
14271426
break;
14281427
}
14291428

‎src/backend/utils/adt/ruleutils.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,6 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
833833
char*tgname;
834834
char*tgoldtable;
835835
char*tgnewtable;
836-
Oidargtypes[1];/* dummy */
837836
Datumvalue;
838837
boolisnull;
839838

@@ -1045,7 +1044,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
10451044

10461045
appendStringInfo(&buf,"EXECUTE FUNCTION %s(",
10471046
generate_function_name(trigrec->tgfoid,0,
1048-
NIL,argtypes,
1047+
NIL,NULL,
10491048
false,NULL,EXPR_KIND_NONE));
10501049

10511050
if (trigrec->tgnargs>0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp