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

Commit9b5ca7e

Browse files
committed
Forgot to handle 'opaque' function arguments in regprocedurein/out.
1 parent9f0ae0c commit9b5ca7e

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*
1515
* IDENTIFICATION
16-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.67 2002/05/01 23:06:41 tgl Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.68 2002/05/11 00:24:16 tgl Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -40,7 +40,7 @@
4040

4141
staticList*stringToQualifiedNameList(constchar*string,constchar*caller);
4242
staticvoidparseNameAndArgTypes(constchar*string,constchar*caller,
43-
boolallow_none,
43+
constchar*type0_spelling,
4444
List**names,int*nargs,Oid*argtypes);
4545

4646

@@ -261,7 +261,7 @@ regprocedurein(PG_FUNCTION_ARGS)
261261
* datatype cannot be used for any system column that needs to receive
262262
* data during bootstrap.
263263
*/
264-
parseNameAndArgTypes(pro_name_or_oid,"regprocedurein",false,
264+
parseNameAndArgTypes(pro_name_or_oid,"regprocedurein","opaque",
265265
&names,&nargs,argtypes);
266266

267267
clist=FuncnameGetCandidates(names,nargs);
@@ -326,12 +326,16 @@ regprocedureout(PG_FUNCTION_ARGS)
326326
quote_qualified_identifier(nspname,proname));
327327
for (i=0;i<nargs;i++)
328328
{
329-
appendStringInfo(&buf,"%s%s",
330-
(i>0) ?"," :"",
331-
format_type_be(procform->proargtypes[i]));
332-
}
329+
Oidthisargtype=procform->proargtypes[i];
333330

334-
appendStringInfo(&buf,")");
331+
if (i>0)
332+
appendStringInfoChar(&buf,',');
333+
if (OidIsValid(thisargtype))
334+
appendStringInfo(&buf,"%s",format_type_be(thisargtype));
335+
else
336+
appendStringInfo(&buf,"opaque");
337+
}
338+
appendStringInfoChar(&buf,')');
335339

336340
result=buf.data;
337341

@@ -567,7 +571,7 @@ regoperatorin(PG_FUNCTION_ARGS)
567571
* datatype cannot be used for any system column that needs to receive
568572
* data during bootstrap.
569573
*/
570-
parseNameAndArgTypes(opr_name_or_oid,"regoperatorin",true,
574+
parseNameAndArgTypes(opr_name_or_oid,"regoperatorin","none",
571575
&names,&nargs,argtypes);
572576
if (nargs==1)
573577
elog(ERROR,"regoperatorin: use NONE to denote the missing argument of a unary operator");
@@ -1000,10 +1004,12 @@ stringToQualifiedNameList(const char *string, const char *caller)
10001004
* the argtypes array should be of size FUNC_MAX_ARGS). The function or
10011005
* operator name is returned to *names as a List of Strings.
10021006
*
1003-
* NONE is accepted as a placeholder for OID 0 if allow_none is true.
1007+
* If type0_spelling is not NULL, it is a name to be accepted as a
1008+
* placeholder for OID 0.
10041009
*/
10051010
staticvoid
1006-
parseNameAndArgTypes(constchar*string,constchar*caller,boolallow_none,
1011+
parseNameAndArgTypes(constchar*string,constchar*caller,
1012+
constchar*type0_spelling,
10071013
List**names,int*nargs,Oid*argtypes)
10081014
{
10091015
char*rawname;
@@ -1109,9 +1115,9 @@ parseNameAndArgTypes(const char *string, const char *caller, bool allow_none,
11091115
*ptr2='\0';
11101116
}
11111117

1112-
if (allow_none&&strcasecmp(typename,"none")==0)
1118+
if (type0_spelling&&strcasecmp(typename,type0_spelling)==0)
11131119
{
1114-
/*Report NONE as OID 0 */
1120+
/*Special case for OPAQUE or NONE */
11151121
typeid=InvalidOid;
11161122
typmod=-1;
11171123
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp