7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.38 2000/01/11 02:30:05 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.39 2000/01/11 05:22:25 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -80,8 +80,9 @@ ProcedureCreate(char *procedureName,
80
80
{
81
81
Value * t = lfirst (x );
82
82
83
- if (parameterCount > FUNC_MAX_ARGS )
84
- elog (ERROR , "Procedures cannot take more than %d arguments" ,FUNC_MAX_ARGS );
83
+ if (parameterCount >= FUNC_MAX_ARGS )
84
+ elog (ERROR , "Procedures cannot take more than %d arguments" ,
85
+ FUNC_MAX_ARGS );
85
86
86
87
if (strcmp (strVal (t ), "opaque" ) == 0 )
87
88
{
@@ -172,7 +173,6 @@ ProcedureCreate(char *procedureName,
172
173
elog (ERROR , "ProcedureCreate: sql functions cannot return type \"opaque\"" );
173
174
typeObjectId = 0 ;
174
175
}
175
-
176
176
else
177
177
{
178
178
typeObjectId = TypeGet (returnTypeName , & defined );
@@ -192,7 +192,6 @@ ProcedureCreate(char *procedureName,
192
192
returnTypeName );
193
193
}
194
194
}
195
-
196
195
else if (!defined )
197
196
{
198
197
elog (NOTICE , "ProcedureCreate: return type '%s' is only a shell" ,
@@ -247,7 +246,7 @@ ProcedureCreate(char *procedureName,
247
246
prosrc = procedureName ;
248
247
if (fmgr_lookupByName (prosrc ) == (func_ptr ) NULL )
249
248
elog (ERROR ,
250
- "ProcedureCreate: there is no builtin function named \"%s\"" ,
249
+ "ProcedureCreate: there is no builtin function named \"%s\"" ,
251
250
prosrc );
252
251
}
253
252
@@ -266,30 +265,18 @@ ProcedureCreate(char *procedureName,
266
265
values [i ++ ] = NameGetDatum (& procname );
267
266
values [i ++ ] = Int32GetDatum (GetUserId ());
268
267
values [i ++ ] = ObjectIdGetDatum (languageObjectId );
269
-
270
268
/* XXX isinherited is always false for now */
271
-
272
269
values [i ++ ] = Int8GetDatum ((bool ) 0 );
273
-
274
- /* XXX istrusted is always false for now */
275
-
276
270
values [i ++ ] = Int8GetDatum (trusted );
277
271
values [i ++ ] = Int8GetDatum (canCache );
278
272
values [i ++ ] = UInt16GetDatum (parameterCount );
279
273
values [i ++ ] = Int8GetDatum (returnsSet );
280
274
values [i ++ ] = ObjectIdGetDatum (typeObjectId );
281
-
282
275
values [i ++ ] = (Datum ) typev ;
283
-
284
- /*
285
- * The following assignments of constants are made. The real values
286
- * will have to be extracted from the arglist someday soon.
287
- */
288
276
values [i ++ ] = Int32GetDatum (byte_pct ); /* probyte_pct */
289
277
values [i ++ ] = Int32GetDatum (perbyte_cpu ); /* properbyte_cpu */
290
278
values [i ++ ] = Int32GetDatum (percall_cpu ); /* propercall_cpu */
291
279
values [i ++ ] = Int32GetDatum (outin_ratio ); /* prooutin_ratio */
292
-
293
280
values [i ++ ] = (Datum ) fmgr (F_TEXTIN , prosrc ); /* prosrc */
294
281
values [i ++ ] = (Datum ) fmgr (F_TEXTIN , probin ); /* probin */
295
282
0 commit comments