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

Commit813895e

Browse files
committed
Don't pass oidvector by value.
Since the structure ends with a flexible array, doing so truncates anyvector having more than one element. New in 9.3, so no back-patch.
1 parentfb435f4 commit813895e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎src/backend/commands/alter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name)
231231
Form_pg_procproc= (Form_pg_proc)GETSTRUCT(oldtup);
232232

233233
IsThereFunctionInNamespace(new_name,proc->pronargs,
234-
proc->proargtypes,proc->pronamespace);
234+
&proc->proargtypes,proc->pronamespace);
235235
}
236236
elseif (classId==CollationRelationId)
237237
{
@@ -611,7 +611,7 @@ AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
611611
Form_pg_procproc= (Form_pg_proc)GETSTRUCT(tup);
612612

613613
IsThereFunctionInNamespace(NameStr(proc->proname),proc->pronargs,
614-
proc->proargtypes,nspOid);
614+
&proc->proargtypes,nspOid);
615615
}
616616
elseif (classId==CollationRelationId)
617617
{

‎src/backend/commands/functioncmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,18 +1626,18 @@ DropCastById(Oid castOid)
16261626
*/
16271627
void
16281628
IsThereFunctionInNamespace(constchar*proname,intpronargs,
1629-
oidvectorproargtypes,OidnspOid)
1629+
oidvector*proargtypes,OidnspOid)
16301630
{
16311631
/* check for duplicate name (more friendly than unique-index failure) */
16321632
if (SearchSysCacheExists3(PROCNAMEARGSNSP,
16331633
CStringGetDatum(proname),
1634-
PointerGetDatum(&proargtypes),
1634+
PointerGetDatum(proargtypes),
16351635
ObjectIdGetDatum(nspOid)))
16361636
ereport(ERROR,
16371637
(errcode(ERRCODE_DUPLICATE_FUNCTION),
16381638
errmsg("function %s already exists in schema \"%s\"",
16391639
funcname_signature_string(proname,pronargs,
1640-
NIL,proargtypes.values),
1640+
NIL,proargtypes->values),
16411641
get_namespace_name(nspOid))));
16421642
}
16431643

‎src/include/commands/defrem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern OidAlterFunction(AlterFunctionStmt *stmt);
5050
externOidCreateCast(CreateCastStmt*stmt);
5151
externvoidDropCastById(OidcastOid);
5252
externvoidIsThereFunctionInNamespace(constchar*proname,intpronargs,
53-
oidvectorproargtypes,OidnspOid);
53+
oidvector*proargtypes,OidnspOid);
5454
externvoidExecuteDoStmt(DoStmt*stmt);
5555
externOidget_cast_oid(Oidsourcetypeid,Oidtargettypeid,boolmissing_ok);
5656

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp