Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8a093d0a
Commit
8a093d0a
authored
Jan 10, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make number of args to a function configurable.
parent
6456b17b
Changes
30
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
374 additions
and
305 deletions
+374
-305
src/backend/access/hash/hashfunc.c
src/backend/access/hash/hashfunc.c
+2
-2
src/backend/access/nbtree/nbtcompare.c
src/backend/access/nbtree/nbtcompare.c
+2
-2
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_aggregate.c
+3
-3
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_operator.c
+9
-9
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_proc.c
+5
-5
src/backend/catalog/pg_type.c
src/backend/catalog/pg_type.c
+3
-3
src/backend/commands/_deadcode/recipe.c
src/backend/commands/_deadcode/recipe.c
+5
-5
src/backend/commands/comment.c
src/backend/commands/comment.c
+99
-99
src/backend/commands/indexcmds.c
src/backend/commands/indexcmds.c
+2
-2
src/backend/commands/proclang.c
src/backend/commands/proclang.c
+2
-2
src/backend/commands/remove.c
src/backend/commands/remove.c
+5
-5
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+35
-35
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+3
-3
src/backend/libpq/be-pqexec.c
src/backend/libpq/be-pqexec.c
+6
-6
src/backend/parser/parse_coerce.c
src/backend/parser/parse_coerce.c
+3
-3
src/backend/parser/parse_func.c
src/backend/parser/parse_func.c
+15
-15
src/backend/parser/parse_target.c
src/backend/parser/parse_target.c
+3
-3
src/backend/tcop/fastpath.c
src/backend/tcop/fastpath.c
+6
-6
src/backend/utils/adt/regproc.c
src/backend/utils/adt/regproc.c
+6
-7
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+5
-5
src/backend/utils/fmgr/fmgr.c
src/backend/utils/fmgr/fmgr.c
+82
-11
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+54
-54
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump.h
+2
-2
src/include/access/funcindex.h
src/include/access/funcindex.h
+2
-2
src/include/config.h.in
src/include/config.h.in
+3
-1
src/include/parser/parse_func.h
src/include/parser/parse_func.h
+1
-4
src/include/utils/rel.h
src/include/utils/rel.h
+2
-2
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_comp.c
+2
-2
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/plpgsql.h
+2
-2
src/pl/tcl/pltcl.c
src/pl/tcl/pltcl.c
+5
-5
No files found.
src/backend/access/hash/hashfunc.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.2
1 2000/01/10 16:13:10
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.2
2 2000/01/10 17:14:28
momjian Exp $
*
*
* NOTES
* NOTES
* These functions are stored in pg_amproc. For each operator class
* These functions are stored in pg_amproc. For each operator class
...
@@ -145,7 +145,7 @@ hashoidvector(Oid *key)
...
@@ -145,7 +145,7 @@ hashoidvector(Oid *key)
int
i
;
int
i
;
uint32
result
=
0
;
uint32
result
=
0
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
INDEX_MAX_KEYS
;
i
++
)
result
=
result
^
(
~
(
uint32
)
key
[
i
]);
result
=
result
^
(
~
(
uint32
)
key
[
i
]);
return
result
;
return
result
;
}
}
...
...
src/backend/access/nbtree/nbtcompare.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.
29 2000/01/10 16:13:10
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.
30 2000/01/10 17:14:29
momjian Exp $
*
*
* NOTES
* NOTES
* These functions are stored in pg_amproc. For each operator class
* These functions are stored in pg_amproc. For each operator class
...
@@ -98,7 +98,7 @@ btoidvectorcmp(Oid *a, Oid *b)
...
@@ -98,7 +98,7 @@ btoidvectorcmp(Oid *a, Oid *b)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
INDEX_MAX_KEYS
;
i
++
)
/* we use this because we need the int4gt, etc */
/* we use this because we need the int4gt, etc */
if
(
!
int4eq
(
a
[
i
],
b
[
i
]))
if
(
!
int4eq
(
a
[
i
],
b
[
i
]))
{
{
...
...
src/backend/catalog/pg_aggregate.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.2
6 1999/11/22 17:55:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.2
7 2000/01/10 17:14:31
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -71,11 +71,11 @@ AggregateCreate(char *aggName,
...
@@ -71,11 +71,11 @@ AggregateCreate(char *aggName,
Oid
xret1
=
InvalidOid
;
Oid
xret1
=
InvalidOid
;
Oid
xret2
=
InvalidOid
;
Oid
xret2
=
InvalidOid
;
Oid
fret
=
InvalidOid
;
Oid
fret
=
InvalidOid
;
Oid
fnArgs
[
8
];
Oid
fnArgs
[
FUNC_MAX_ARGS
];
NameData
aname
;
NameData
aname
;
TupleDesc
tupDesc
;
TupleDesc
tupDesc
;
MemSet
(
fnArgs
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
fnArgs
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
/* sanity checks */
/* sanity checks */
if
(
!
aggName
)
if
(
!
aggName
)
...
...
src/backend/catalog/pg_operator.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.4
6 2000/01/05 18:23:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.4
7 2000/01/10 17:14:31
momjian Exp $
*
*
* NOTES
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
* these routines moved here from commands/define.c and somewhat cleaned up.
...
@@ -482,7 +482,7 @@ OperatorDef(char *operatorName,
...
@@ -482,7 +482,7 @@ OperatorDef(char *operatorName,
bool
rightDefined
=
false
;
bool
rightDefined
=
false
;
bool
selfCommutator
=
false
;
bool
selfCommutator
=
false
;
char
*
name
[
4
];
char
*
name
[
4
];
Oid
typeId
[
8
];
Oid
typeId
[
FUNC_MAX_ARGS
];
int
nargs
;
int
nargs
;
NameData
oname
;
NameData
oname
;
TupleDesc
tupDesc
;
TupleDesc
tupDesc
;
...
@@ -556,7 +556,7 @@ OperatorDef(char *operatorName,
...
@@ -556,7 +556,7 @@ OperatorDef(char *operatorName,
* have to worry about deleting them later.
* have to worry about deleting them later.
* ----------------
* ----------------
*/
*/
MemSet
(
typeId
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
typeId
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
if
(
!
leftTypeName
)
if
(
!
leftTypeName
)
{
{
typeId
[
0
]
=
rightTypeId
;
typeId
[
0
]
=
rightTypeId
;
...
@@ -592,7 +592,7 @@ OperatorDef(char *operatorName,
...
@@ -592,7 +592,7 @@ OperatorDef(char *operatorName,
*/
*/
if
(
restrictionName
)
if
(
restrictionName
)
{
/* optional */
{
/* optional */
MemSet
(
typeId
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
typeId
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
typeId
[
0
]
=
OIDOID
;
/* operator OID */
typeId
[
0
]
=
OIDOID
;
/* operator OID */
typeId
[
1
]
=
OIDOID
;
/* relation OID */
typeId
[
1
]
=
OIDOID
;
/* relation OID */
typeId
[
2
]
=
INT2OID
;
/* attribute number */
typeId
[
2
]
=
INT2OID
;
/* attribute number */
...
@@ -617,7 +617,7 @@ OperatorDef(char *operatorName,
...
@@ -617,7 +617,7 @@ OperatorDef(char *operatorName,
*/
*/
if
(
joinName
)
if
(
joinName
)
{
/* optional */
{
/* optional */
MemSet
(
typeId
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
typeId
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
typeId
[
0
]
=
OIDOID
;
/* operator OID */
typeId
[
0
]
=
OIDOID
;
/* operator OID */
typeId
[
1
]
=
OIDOID
;
/* relation OID 1 */
typeId
[
1
]
=
OIDOID
;
/* relation OID 1 */
typeId
[
2
]
=
INT2OID
;
/* attribute number 1 */
typeId
[
2
]
=
INT2OID
;
/* attribute number 1 */
...
...
src/backend/catalog/pg_proc.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.3
6 1999/11/22 17:55:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.3
7 2000/01/10 17:14:31
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -61,7 +61,7 @@ ProcedureCreate(char *procedureName,
...
@@ -61,7 +61,7 @@ ProcedureCreate(char *procedureName,
List
*
x
;
List
*
x
;
List
*
querytree_list
;
List
*
querytree_list
;
List
*
plan_list
;
List
*
plan_list
;
Oid
typev
[
8
];
Oid
typev
[
FUNC_MAX_ARGS
];
Oid
relid
;
Oid
relid
;
Oid
toid
;
Oid
toid
;
NameData
procname
;
NameData
procname
;
...
@@ -75,13 +75,13 @@ ProcedureCreate(char *procedureName,
...
@@ -75,13 +75,13 @@ ProcedureCreate(char *procedureName,
Assert
(
PointerIsValid
(
probin
));
Assert
(
PointerIsValid
(
probin
));
parameterCount
=
0
;
parameterCount
=
0
;
MemSet
(
typev
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
typev
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
foreach
(
x
,
argList
)
foreach
(
x
,
argList
)
{
{
Value
*
t
=
lfirst
(
x
);
Value
*
t
=
lfirst
(
x
);
if
(
parameterCount
==
8
)
if
(
parameterCount
==
FUNC_MAX_ARGS
)
elog
(
ERROR
,
"Procedures cannot take more than
8 arguments"
);
elog
(
ERROR
,
"Procedures cannot take more than
%d arguments"
,
FUNC_MAX_ARGS
);
if
(
strcmp
(
strVal
(
t
),
"opaque"
)
==
0
)
if
(
strcmp
(
strVal
(
t
),
"opaque"
)
==
0
)
{
{
...
...
src/backend/catalog/pg_type.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.4
4 1999/12/16 22:19:39 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.4
5 2000/01/10 17:14:31 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -305,7 +305,7 @@ TypeCreate(char *typeName,
...
@@ -305,7 +305,7 @@ TypeCreate(char *typeName,
bool
defined
;
bool
defined
;
NameData
name
;
NameData
name
;
TupleDesc
tupDesc
;
TupleDesc
tupDesc
;
Oid
argList
[
8
];
Oid
argList
[
FUNC_MAX_ARGS
];
static
ScanKeyData
typeKey
[
1
]
=
{
static
ScanKeyData
typeKey
[
1
]
=
{
{
0
,
Anum_pg_type_typname
,
F_NAMEEQ
}
{
0
,
Anum_pg_type_typname
,
F_NAMEEQ
}
...
@@ -393,7 +393,7 @@ TypeCreate(char *typeName,
...
@@ -393,7 +393,7 @@ TypeCreate(char *typeName,
* First look for a 1-argument func with all argtypes 0. This is
* First look for a 1-argument func with all argtypes 0. This is
* valid for all four kinds of procedure.
* valid for all four kinds of procedure.
*/
*/
MemSet
(
argList
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
argList
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
tup
=
SearchSysCacheTuple
(
PROCNAME
,
tup
=
SearchSysCacheTuple
(
PROCNAME
,
PointerGetDatum
(
procname
),
PointerGetDatum
(
procname
),
...
...
src/backend/commands/_deadcode/recipe.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/recipe.c,v 1.
7 1999/07/16 04:58:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/recipe.c,v 1.
8 2000/01/10 17:14:33
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -695,14 +695,14 @@ getParamTypes(TgElement * elem, Oid *typev)
...
@@ -695,14 +695,14 @@ getParamTypes(TgElement * elem, Oid *typev)
j
;
j
;
parameterCount
=
0
;
parameterCount
=
0
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
FUNC_MAX_ARGS
;
i
++
)
typev
[
i
]
=
0
;
typev
[
i
]
=
0
;
for
(
j
=
0
;
j
<
elem
->
inTypes
->
num
;
j
++
)
for
(
j
=
0
;
j
<
elem
->
inTypes
->
num
;
j
++
)
{
{
if
(
parameterCount
==
8
)
if
(
parameterCount
==
FUNC_MAX_ARGS
)
{
{
elog
(
ERROR
,
elog
(
ERROR
,
"getParamTypes: Ingredients cannot take >
8 arguments"
);
"getParamTypes: Ingredients cannot take >
%d arguments"
,
FUNC_MAX_ARGS
);
}
}
t
=
elem
->
inTypes
->
val
[
j
];
t
=
elem
->
inTypes
->
val
[
j
];
if
(
strcmp
(
t
,
"opaque"
)
==
0
)
if
(
strcmp
(
t
,
"opaque"
)
==
0
)
...
@@ -810,7 +810,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
...
@@ -810,7 +810,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
{
{
TgElement
*
elem
;
TgElement
*
elem
;
char
*
funcName
;
char
*
funcName
;
Oid
typev
[
8
],
/* eight arguments maximum */
Oid
typev
[
FUNC_MAX_ARGS
],
/* eight arguments maximum */
relid
;
relid
;
int
i
,
int
i
,
parameterCount
;
parameterCount
;
...
...
src/backend/commands/comment.c
View file @
8a093d0a
...
@@ -589,7 +589,7 @@ void CommentAggregate(char *aggregate, char *argument, char *comment) {
...
@@ -589,7 +589,7 @@ void CommentAggregate(char *aggregate, char *argument, char *comment) {
void
CommentProc
(
char
*
function
,
List
*
arguments
,
char
*
comment
)
{
void
CommentProc
(
char
*
function
,
List
*
arguments
,
char
*
comment
)
{
HeapTuple
argtuple
,
functuple
;
HeapTuple
argtuple
,
functuple
;
Oid
oid
,
argoids
[
8
];
Oid
oid
,
argoids
[
FUNC_MAX_ARGS
];
char
*
user
,
*
argument
;
char
*
user
,
*
argument
;
int
i
,
argcount
;
int
i
,
argcount
;
...
@@ -597,7 +597,7 @@ void CommentProc(char *function, List *arguments, char *comment) {
...
@@ -597,7 +597,7 @@ void CommentProc(char *function, List *arguments, char *comment) {
argcount
=
length
(
arguments
);
argcount
=
length
(
arguments
);
if
(
argcount
>
0
)
{
if
(
argcount
>
0
)
{
MemSet
(
argoids
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
argoids
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
for
(
i
=
0
;
i
<
argcount
;
i
++
)
{
for
(
i
=
0
;
i
<
argcount
;
i
++
)
{
argument
=
strVal
(
lfirst
(
arguments
));
argument
=
strVal
(
lfirst
(
arguments
));
arguments
=
lnext
(
arguments
);
arguments
=
lnext
(
arguments
);
...
...
src/backend/commands/indexcmds.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.1
6 1999/12/16 22:19:41 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.1
7 2000/01/10 17:14:32 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -414,7 +414,7 @@ FuncIndexArgs(IndexElem *funcIndex,
...
@@ -414,7 +414,7 @@ FuncIndexArgs(IndexElem *funcIndex,
}
}
*
opOidP
=
tuple
->
t_data
->
t_oid
;
*
opOidP
=
tuple
->
t_data
->
t_oid
;
MemSet
(
argTypes
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
argTypes
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
/*
/*
* process the function arguments
* process the function arguments
...
...
src/backend/commands/proclang.c
View file @
8a093d0a
...
@@ -50,7 +50,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
...
@@ -50,7 +50,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
HeapTuple
langTup
;
HeapTuple
langTup
;
HeapTuple
procTup
;
HeapTuple
procTup
;
Oid
typev
[
8
];
Oid
typev
[
FUNC_MAX_ARGS
];
char
nulls
[
Natts_pg_language
];
char
nulls
[
Natts_pg_language
];
Datum
values
[
Natts_pg_language
];
Datum
values
[
Natts_pg_language
];
Relation
rel
;
Relation
rel
;
...
...
src/backend/commands/remove.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.4
2 1999/12/16 22:19:41 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.4
3 2000/01/10 17:14:32 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -315,13 +315,13 @@ RemoveFunction(char *functionName, /* function name to be removed */
...
@@ -315,13 +315,13 @@ RemoveFunction(char *functionName, /* function name to be removed */
{
{
Relation
relation
;
Relation
relation
;
HeapTuple
tup
;
HeapTuple
tup
;
Oid
argList
[
8
];
Oid
argList
[
FUNC_MAX_ARGS
];
char
*
userName
;
char
*
userName
;
char
*
typename
;
char
*
typename
;
int
i
;
int
i
;
MemSet
(
argList
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
argList
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
for
(
i
=
0
;
i
<
nargs
;
i
++
)
for
(
i
=
0
;
i
<
nargs
;
i
++
)
{
{
typename
=
strVal
(
lfirst
(
argNameList
));
typename
=
strVal
(
lfirst
(
argNameList
));
...
...
src/backend/commands/trigger.c
View file @
8a093d0a
...
@@ -41,7 +41,7 @@ void
...
@@ -41,7 +41,7 @@ void
CreateTrigger
(
CreateTrigStmt
*
stmt
)
CreateTrigger
(
CreateTrigStmt
*
stmt
)
{
{
int16
tgtype
;
int16
tgtype
;
int16
tgattr
[
8
]
=
{
0
};
int16
tgattr
[
FUNC_MAX_ARGS
]
=
{
0
};
Datum
values
[
Natts_pg_trigger
];
Datum
values
[
Natts_pg_trigger
];
char
nulls
[
Natts_pg_trigger
];
char
nulls
[
Natts_pg_trigger
];
Relation
rel
;
Relation
rel
;
...
@@ -53,7 +53,7 @@ CreateTrigger(CreateTrigStmt *stmt)
...
@@ -53,7 +53,7 @@ CreateTrigger(CreateTrigStmt *stmt)
Relation
idescs
[
Num_pg_trigger_indices
];
Relation
idescs
[
Num_pg_trigger_indices
];
Relation
ridescs
[
Num_pg_class_indices
];
Relation
ridescs
[
Num_pg_class_indices
];
MemoryContext
oldcxt
;
MemoryContext
oldcxt
;
Oid
fargtypes
[
8
];
Oid
fargtypes
[
FUNC_MAX_ARGS
];
int
found
=
0
;
int
found
=
0
;
int
i
;
int
i
;
char
constrtrigname
[
NAMEDATALEN
];
char
constrtrigname
[
NAMEDATALEN
];
...
@@ -144,7 +144,7 @@ CreateTrigger(CreateTrigStmt *stmt)
...
@@ -144,7 +144,7 @@ CreateTrigger(CreateTrigStmt *stmt)
}
}
heap_endscan
(
tgscan
);
heap_endscan
(
tgscan
);
MemSet
(
fargtypes
,
0
,
8
*
sizeof
(
Oid
));
MemSet
(
fargtypes
,
0
,
FUNC_MAX_ARGS
*
sizeof
(
Oid
));
tuple
=
SearchSysCacheTuple
(
PROCNAME
,
tuple
=
SearchSysCacheTuple
(
PROCNAME
,
PointerGetDatum
(
stmt
->
funcname
),
PointerGetDatum
(
stmt
->
funcname
),
Int32GetDatum
(
0
),
Int32GetDatum
(
0
),
...
@@ -473,7 +473,7 @@ RelationBuildTriggers(Relation relation)
...
@@ -473,7 +473,7 @@ RelationBuildTriggers(Relation relation)
build
->
tgdeferrable
=
pg_trigger
->
tgdeferrable
;
build
->
tgdeferrable
=
pg_trigger
->
tgdeferrable
;
build
->
tginitdeferred
=
pg_trigger
->
tginitdeferred
;
build
->
tginitdeferred
=
pg_trigger
->
tginitdeferred
;
build
->
tgnargs
=
pg_trigger
->
tgnargs
;
build
->
tgnargs
=
pg_trigger
->
tgnargs
;
memcpy
(
build
->
tgattr
,
&
(
pg_trigger
->
tgattr
),
8
*
sizeof
(
int16
));
memcpy
(
build
->
tgattr
,
&
(
pg_trigger
->
tgattr
),
FUNC_MAX_ARGS
*
sizeof
(
int16
));
val
=
(
struct
varlena
*
)
fastgetattr
(
&
tuple
,
val
=
(
struct
varlena
*
)
fastgetattr
(
&
tuple
,
Anum_pg_trigger_tgargs
,
Anum_pg_trigger_tgargs
,
tgrel
->
rd_att
,
&
isnull
);
tgrel
->
rd_att
,
&
isnull
);
...
...
src/backend/executor/execQual.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.6
4 1999/11/12 06:39:34 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.6
5 2000/01/10 17:14:34 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -656,7 +656,7 @@ ExecMakeFunctionResult(Node *node,
...
@@ -656,7 +656,7 @@ ExecMakeFunctionResult(Node *node,
bool
*
isNull
,
bool
*
isNull
,
bool
*
isDone
)
bool
*
isDone
)
{
{
Datum
argV
[
MAXFMGR
ARGS
];
Datum
argV
[
FUNC_MAX_
ARGS
];
FunctionCachePtr
fcache
;
FunctionCachePtr
fcache
;
Func
*
funcNode
=
NULL
;
Func
*
funcNode
=
NULL
;
Oper
*
operNode
=
NULL
;
Oper
*
operNode
=
NULL
;
...
@@ -690,7 +690,7 @@ ExecMakeFunctionResult(Node *node,
...
@@ -690,7 +690,7 @@ ExecMakeFunctionResult(Node *node,
{
{
bool
argDone
;
bool
argDone
;
if
(
fcache
->
nargs
>
MAXFMGR
ARGS
)
if
(
fcache
->
nargs
>
FUNC_MAX_
ARGS
)
elog
(
ERROR
,
"ExecMakeFunctionResult: too many arguments"
);
elog
(
ERROR
,
"ExecMakeFunctionResult: too many arguments"
);
/*
/*
...
...
src/backend/libpq/be-pqexec.c
View file @
8a093d0a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.2
5 2000/01/05 18:23:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.2
6 2000/01/10 17:14:35
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -57,7 +57,7 @@ PQfn(int fnid,
...
@@ -57,7 +57,7 @@ PQfn(int fnid,
int
nargs
)
int
nargs
)
{
{
char
*
retval
;
/* XXX - should be datum, maybe ? */
char
*
retval
;
/* XXX - should be datum, maybe ? */
char
*
arg
[
8
];
char
*
arg
[
FUNC_MAX_ARGS
];
int
i
;
int
i
;
/* ----------------
/* ----------------
...
@@ -304,8 +304,8 @@ pqtest_PQfn(char *q)
...
@@ -304,8 +304,8 @@ pqtest_PQfn(char *q)
v
,
v
,
f
,
f
,
offsets
;
offsets
;
char
*
fields
[
8
];
char
*
fields
[
FUNC_MAX_ARGS
];
PQArgBlock
pqargs
[
7
];
PQArgBlock
pqargs
[
FUNC_MAX_ARGS
];
int
res
;
int
res
;
char
*
pqres
;
char
*
pqres
;
...
@@ -313,7 +313,7 @@ pqtest_PQfn(char *q)
...
@@ -313,7 +313,7 @@ pqtest_PQfn(char *q)
* parse q into fields
* parse q into fields
* ----------------
* ----------------
*/
*/
i
=
strparse
(
q
,
fields
,
&
offsets
,
8
);
i
=
strparse
(
q
,
fields
,
&
offsets
,
FUNC_MAX_ARGS
);
printf
(
"pqtest_PQfn: strparse returns %d fields
\n
"
,
i
);
/* debug */
printf
(
"pqtest_PQfn: strparse returns %d fields
\n
"
,
i
);
/* debug */
if
(
i
==
0
)
if
(
i
==
0
)
return
-
1
;
return
-
1
;
...
@@ -331,7 +331,7 @@ pqtest_PQfn(char *q)
...
@@ -331,7 +331,7 @@ pqtest_PQfn(char *q)
* build a PQArgBlock
* build a PQArgBlock
* ----------------
* ----------------
*/
*/
for
(
j
=
1
;
j
<
i
&&
j
<
8
;
j
++
)
for
(
j
=
1
;
j
<
i
&&
j
<
FUNC_MAX_ARGS
;
j
++
)
{
{
k
=
j
-
1
;
k
=
j
-
1
;
v
=
atoi
(
fields
[
j
]);
v
=
atoi
(
fields
[
j
]);
...
...
src/backend/parser/parse_coerce.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.2
6 1999/12/10 07:37:35 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.2
7 2000/01/10 17:14:36 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -142,7 +142,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
...
@@ -142,7 +142,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
HeapTuple
ftup
;
HeapTuple
ftup
;
int
i
;
int
i
;
Type
tp
;
Type
tp
;
Oid
oid_array
[
MAXF
ARGS
];
Oid
oid_array
[
FUNC_MAX_
ARGS
];
/* run through argument list... */
/* run through argument list... */
for
(
i
=
0
;
i
<
nargs
;
i
++
)
for
(
i
=
0
;
i
<
nargs
;
i
++
)
...
@@ -170,7 +170,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
...
@@ -170,7 +170,7 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
*/
*/
else
if
(
input_typeids
[
i
]
!=
UNKNOWNOID
)
else
if
(
input_typeids
[
i
]
!=
UNKNOWNOID
)
{
{
MemSet
(
oid_array
,
0
,
MAXF
ARGS
*
sizeof
(
Oid
));
MemSet
(
oid_array
,
0
,
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
oid_array
[
0
]
=
input_typeids
[
i
];
oid_array
[
0
]
=
input_typeids
[
i
];
/*
/*
...
...
src/backend/parser/parse_func.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.6
5 1999/12/16 22:19:48 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.6
6 2000/01/10 17:14:36 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -236,7 +236,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
...
@@ -236,7 +236,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
Oid
relid
;
Oid
relid
;
int
nargs
=
length
(
fargs
);
int
nargs
=
length
(
fargs
);
Func
*
funcnode
;
Func
*
funcnode
;
Oid
oid_array
[
MAXF
ARGS
];
Oid
oid_array
[
FUNC_MAX_
ARGS
];
Oid
*
true_oid_array
;
Oid
*
true_oid_array
;
Node
*
retval
;
Node
*
retval
;
bool
retset
;
bool
retset
;
...
@@ -435,7 +435,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
...
@@ -435,7 +435,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
* transform relation name arguments into varnodes of the appropriate
* transform relation name arguments into varnodes of the appropriate
* form.
* form.
*/
*/
MemSet
(
oid_array
,
0
,
MAXF
ARGS
*
sizeof
(
Oid
));
MemSet
(
oid_array
,
0
,
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
nargs
=
0
;
nargs
=
0
;
foreach
(
i
,
fargs
)
foreach
(
i
,
fargs
)
...
@@ -496,12 +496,12 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
...
@@ -496,12 +496,12 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
}
}
/* Most of the rest of the parser just assumes that functions do not
/* Most of the rest of the parser just assumes that functions do not
* have more than
MAXF
ARGS parameters. We have to test here to protect
* have more than
FUNC_MAX_
ARGS parameters. We have to test here to protect
* against array overruns, etc.
* against array overruns, etc.
*/
*/
if
(
nargs
>=
MAXF
ARGS
)
if
(
nargs
>=
FUNC_MAX_
ARGS
)
elog
(
ERROR
,
"Cannot pass more than %d arguments to a function"
,
elog
(
ERROR
,
"Cannot pass more than %d arguments to a function"
,
MAXF
ARGS
);
FUNC_MAX_
ARGS
);
oid_array
[
nargs
++
]
=
toid
;
oid_array
[
nargs
++
]
=
toid
;
}
}
...
@@ -710,8 +710,8 @@ func_get_candidates(char *funcname, int nargs)
...
@@ -710,8 +710,8 @@ func_get_candidates(char *funcname, int nargs)
current_candidate
=
(
CandidateList
)
current_candidate
=
(
CandidateList
)
palloc
(
sizeof
(
struct
_CandidateList
));
palloc
(
sizeof
(
struct
_CandidateList
));
current_candidate
->
args
=
(
Oid
*
)
current_candidate
->
args
=
(
Oid
*
)
palloc
(
MAXF
ARGS
*
sizeof
(
Oid
));
palloc
(
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
MemSet
(
current_candidate
->
args
,
0
,
MAXF
ARGS
*
sizeof
(
Oid
));
MemSet
(
current_candidate
->
args
,
0
,
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
for
(
i
=
0
;
i
<
nargs
;
i
++
)
for
(
i
=
0
;
i
<
nargs
;
i
++
)
current_candidate
->
args
[
i
]
=
pgProcP
->
proargtypes
[
i
];
current_candidate
->
args
[
i
]
=
pgProcP
->
proargtypes
[
i
];
...
@@ -1067,9 +1067,9 @@ argtype_inherit(int nargs, Oid *oid_array)
...
@@ -1067,9 +1067,9 @@ argtype_inherit(int nargs, Oid *oid_array)
{
{
Oid
relid
;
Oid
relid
;
int
i
;
int
i
;
InhPaths
arginh
[
MAXF
ARGS
];
InhPaths
arginh
[
FUNC_MAX_
ARGS
];
for
(
i
=
0
;
i
<
MAXF
ARGS
;
i
++
)
for
(
i
=
0
;
i
<
FUNC_MAX_
ARGS
;
i
++
)
{
{
if
(
i
<
nargs
)
if
(
i
<
nargs
)
{
{
...
@@ -1203,7 +1203,7 @@ gen_cross_product(InhPaths *arginh, int nargs)
...
@@ -1203,7 +1203,7 @@ gen_cross_product(InhPaths *arginh, int nargs)
Oid
*
oneres
;
Oid
*
oneres
;
int
i
,
int
i
,
j
;
j
;
int
cur
[
MAXF
ARGS
];
int
cur
[
FUNC_MAX_
ARGS
];
nanswers
=
1
;
nanswers
=
1
;
for
(
i
=
0
;
i
<
nargs
;
i
++
)
for
(
i
=
0
;
i
<
nargs
;
i
++
)
...
@@ -1217,8 +1217,8 @@ gen_cross_product(InhPaths *arginh, int nargs)
...
@@ -1217,8 +1217,8 @@ gen_cross_product(InhPaths *arginh, int nargs)
/* compute the cross product from right to left */
/* compute the cross product from right to left */
for
(;;)
for
(;;)
{
{
oneres
=
(
Oid
*
)
palloc
(
MAXF
ARGS
*
sizeof
(
Oid
));
oneres
=
(
Oid
*
)
palloc
(
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
MemSet
(
oneres
,
0
,
MAXF
ARGS
*
sizeof
(
Oid
));
MemSet
(
oneres
,
0
,
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
for
(
i
=
nargs
-
1
;
i
>=
0
&&
cur
[
i
]
>
arginh
[
i
].
nsupers
;
i
--
)
for
(
i
=
nargs
-
1
;
i
>=
0
&&
cur
[
i
]
>
arginh
[
i
].
nsupers
;
i
--
)
continue
;
continue
;
...
@@ -1508,7 +1508,7 @@ ParseComplexProjection(ParseState *pstate,
...
@@ -1508,7 +1508,7 @@ ParseComplexProjection(ParseState *pstate,
void
void
func_error
(
char
*
caller
,
char
*
funcname
,
int
nargs
,
Oid
*
argtypes
,
char
*
msg
)
func_error
(
char
*
caller
,
char
*
funcname
,
int
nargs
,
Oid
*
argtypes
,
char
*
msg
)
{
{
char
p
[(
NAMEDATALEN
+
2
)
*
MAXFMGR
ARGS
],
char
p
[(
NAMEDATALEN
+
2
)
*
FUNC_MAX_
ARGS
],
*
ptr
;
*
ptr
;
int
i
;
int
i
;
...
...
src/backend/parser/parse_target.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.5
0 1999/12/10 07:37:35 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.5
1 2000/01/10 17:14:36 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -318,14 +318,14 @@ SizeTargetExpr(ParseState *pstate,
...
@@ -318,14 +318,14 @@ SizeTargetExpr(ParseState *pstate,
int32
attrtypmod
)
int32
attrtypmod
)
{
{
char
*
funcname
;
char
*
funcname
;
Oid
oid_array
[
MAXF
ARGS
];
Oid
oid_array
[
FUNC_MAX_
ARGS
];
HeapTuple
ftup
;
HeapTuple
ftup
;
int
i
;
int
i
;
funcname
=
typeidTypeName
(
attrtype
);
funcname
=
typeidTypeName
(
attrtype
);
oid_array
[
0
]
=
attrtype
;
oid_array
[
0
]
=
attrtype
;
oid_array
[
1
]
=
INT4OID
;
oid_array
[
1
]
=
INT4OID
;
for
(
i
=
2
;
i
<
MAXF
ARGS
;
i
++
)
for
(
i
=
2
;
i
<
FUNC_MAX_
ARGS
;
i
++
)
oid_array
[
i
]
=
InvalidOid
;
oid_array
[
i
]
=
InvalidOid
;
/* attempt to find with arguments exactly as specified... */
/* attempt to find with arguments exactly as specified... */
...
...
src/backend/tcop/fastpath.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.3
2 2000/01/10 16:13:13
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.3
3 2000/01/10 17:14:37
momjian Exp $
*
*
* NOTES
* NOTES
* This cruft is the server side of PQfn.
* This cruft is the server side of PQfn.
...
@@ -116,7 +116,7 @@ SendFunctionResult(Oid fid, /* function id */
...
@@ -116,7 +116,7 @@ SendFunctionResult(Oid fid, /* function id */
/*
/*
* This structure saves enough state so that one can avoid having to
* This structure saves enough state so that one can avoid having to
* do catalog lookups over and over again. (Each RPC can require up
* do catalog lookups over and over again. (Each RPC can require up
* to
MAXFMGR
ARGS+2 lookups, which is quite tedious.)
* to
FUNC_MAX_
ARGS+2 lookups, which is quite tedious.)
*
*
* The previous incarnation of this code just assumed that any argument
* The previous incarnation of this code just assumed that any argument
* of size <= 4 was by value; this is not correct. There is no cheap
* of size <= 4 was by value; this is not correct. There is no cheap
...
@@ -127,8 +127,8 @@ struct fp_info
...
@@ -127,8 +127,8 @@ struct fp_info
{
{
Oid
funcid
;
Oid
funcid
;
int
nargs
;
int
nargs
;
bool
argbyval
[
MAXFMGR
ARGS
];
bool
argbyval
[
FUNC_MAX_
ARGS
];
int32
arglen
[
MAXFMGR
ARGS
];
/* signed (for varlena) */
int32
arglen
[
FUNC_MAX_
ARGS
];
/* signed (for varlena) */
bool
retbyval
;
bool
retbyval
;
int32
retlen
;
/* signed (for varlena) */
int32
retlen
;
/* signed (for varlena) */
TransactionId
xid
;
TransactionId
xid
;
...
@@ -278,7 +278,7 @@ HandleFunctionRequest()
...
@@ -278,7 +278,7 @@ HandleFunctionRequest()
int
argsize
;
int
argsize
;
int
nargs
;
int
nargs
;
int
tmp
;
int
tmp
;
char
*
arg
[
8
];
char
*
arg
[
FUNC_MAX_ARGS
];
char
*
retval
;
char
*
retval
;
int
i
;
int
i
;
uint32
palloced
;
uint32
palloced
;
...
@@ -317,7 +317,7 @@ HandleFunctionRequest()
...
@@ -317,7 +317,7 @@ HandleFunctionRequest()
* need to remember, so that we pfree() it after the call.
* need to remember, so that we pfree() it after the call.
*/
*/
palloced
=
0x0
;
palloced
=
0x0
;
for
(
i
=
0
;
i
<
8
;
++
i
)
for
(
i
=
0
;
i
<
FUNC_MAX_ARGS
;
++
i
)
{
{
if
(
i
>=
nargs
)
if
(
i
>=
nargs
)
arg
[
i
]
=
(
char
*
)
NULL
;
arg
[
i
]
=
(
char
*
)
NULL
;
...
...
src/backend/utils/adt/regproc.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.4
8 2000/01/10 16:13:14
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.4
9 2000/01/10 17:14:38
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -238,7 +238,6 @@ oidvectortypes(Oid *oidArray)
...
@@ -238,7 +238,6 @@ oidvectortypes(Oid *oidArray)
HeapTuple
typetup
;
HeapTuple
typetup
;
text
*
result
;
text
*
result
;
int
num
;
int
num
;
Oid
*
sp
;
if
(
oidArray
==
NULL
)
if
(
oidArray
==
NULL
)
{
{
...
@@ -247,16 +246,16 @@ oidvectortypes(Oid *oidArray)
...
@@ -247,16 +246,16 @@ oidvectortypes(Oid *oidArray)
return
result
;
return
result
;
}
}
result
=
(
text
*
)
palloc
(
NAMEDATALEN
*
8
+
8
+
VARHDRSZ
);
result
=
(
text
*
)
palloc
(
NAMEDATALEN
*
FUNC_MAX_ARGS
+
FUNC_MAX_ARGS
+
VARHDRSZ
);
*
VARDATA
(
result
)
=
'\0'
;
*
VARDATA
(
result
)
=
'\0'
;
sp
=
oidArray
;
for
(
num
=
0
;
num
<
FUNC_MAX_ARGS
;
num
++
)
for
(
num
=
8
;
num
!=
0
;
num
--
,
sp
++
)
{
{
if
(
*
sp
!=
InvalidOid
)
if
(
oidArray
[
num
]
!=
InvalidOid
)
{
{
typetup
=
SearchSysCacheTuple
(
TYPEOID
,
typetup
=
SearchSysCacheTuple
(
TYPEOID
,
ObjectIdGetDatum
(
*
sp
),
ObjectIdGetDatum
(
oidArray
[
num
]
),
0
,
0
,
0
);
0
,
0
,
0
);
if
(
HeapTupleIsValid
(
typetup
))
if
(
HeapTupleIsValid
(
typetup
))
{
{
...
...
src/backend/utils/adt/selfuncs.c
View file @
8a093d0a
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.4
5 2000/01/09 00:26:20 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.4
6 2000/01/10 17:14:38 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -512,10 +512,10 @@ convert_to_scale(Datum value, Oid typid,
...
@@ -512,10 +512,10 @@ convert_to_scale(Datum value, Oid typid,
/* See whether there is a registered type-conversion function,
/* See whether there is a registered type-conversion function,
* namely a procedure named "float8" with the right signature.
* namely a procedure named "float8" with the right signature.
*/
*/
Oid
oid_array
[
MAXF
ARGS
];
Oid
oid_array
[
FUNC_MAX_
ARGS
];
HeapTuple
ftup
;
HeapTuple
ftup
;
MemSet
(
oid_array
,
0
,
MAXF
ARGS
*
sizeof
(
Oid
));
MemSet
(
oid_array
,
0
,
FUNC_MAX_
ARGS
*
sizeof
(
Oid
));
oid_array
[
0
]
=
typid
;
oid_array
[
0
]
=
typid
;
ftup
=
SearchSysCacheTuple
(
PROCNAME
,
ftup
=
SearchSysCacheTuple
(
PROCNAME
,
PointerGetDatum
(
"float8"
),
PointerGetDatum
(
"float8"
),
...
...
src/backend/utils/fmgr/fmgr.c
View file @
8a093d0a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.3
3 1999/11/22 17:56:33
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.3
4 2000/01/10 17:14:39
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -44,9 +44,9 @@ fmgr_pl(char *arg0,...)
...
@@ -44,9 +44,9 @@ fmgr_pl(char *arg0,...)
values
.
data
[
0
]
=
arg0
;
values
.
data
[
0
]
=
arg0
;
if
(
n_arguments
>
1
)
if
(
n_arguments
>
1
)
{
{
if
(
n_arguments
>
MAXFMGR
ARGS
)
if
(
n_arguments
>
FUNC_MAX_
ARGS
)
elog
(
ERROR
,
"fmgr_pl: function %u: too many arguments (%d > %d)"
,
elog
(
ERROR
,
"fmgr_pl: function %u: too many arguments (%d > %d)"
,
fmgr_pl_finfo
->
fn_oid
,
n_arguments
,
MAXFMGR
ARGS
);
fmgr_pl_finfo
->
fn_oid
,
n_arguments
,
FUNC_MAX_
ARGS
);
va_start
(
pvar
,
arg0
);
va_start
(
pvar
,
arg0
);
for
(
i
=
1
;
i
<
n_arguments
;
i
++
)
for
(
i
=
1
;
i
<
n_arguments
;
i
++
)
values
.
data
[
i
]
=
va_arg
(
pvar
,
char
*
);
values
.
data
[
i
]
=
va_arg
(
pvar
,
char
*
);
...
@@ -165,22 +165,93 @@ fmgr_c(FmgrInfo *finfo,
...
@@ -165,22 +165,93 @@ fmgr_c(FmgrInfo *finfo,
values
->
data
[
6
],
values
->
data
[
7
]);
values
->
data
[
6
],
values
->
data
[
7
]);
break
;
break
;
case
9
:
case
9
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
]);
break
;
case
10
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
]);
break
;
case
11
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
]);
break
;
case
12
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
],
values
->
data
[
11
]);
break
;
case
13
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
],
values
->
data
[
11
],
values
->
data
[
12
]);
break
;
case
14
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
],
values
->
data
[
11
],
values
->
data
[
12
],
values
->
data
[
13
]);
break
;
case
15
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
],
values
->
data
[
11
],
values
->
data
[
12
],
values
->
data
[
13
],
values
->
data
[
14
]);
break
;
case
16
:
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
],
values
->
data
[
11
],
values
->
data
[
12
],
values
->
data
[
13
],
values
->
data
[
14
],
values
->
data
[
15
]);
break
;
case
17
:
/*
/*
* XXX Note that functions with >
8
arguments can only be
* XXX Note that functions with >
FUNC_MAX_ARGS
arguments can only be
* called from inside the system, not from the user level,
* called from inside the system, not from the user level,
* since the catalogs only store
8
argument types for user
* since the catalogs only store
FUNC_MAX_ARGS
argument types for user
* type-checking!
* type-checking!
*/
*/
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
returnValue
=
(
*
user_fn
)
(
values
->
data
[
0
],
values
->
data
[
1
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
2
],
values
->
data
[
3
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
4
],
values
->
data
[
5
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
6
],
values
->
data
[
7
],
values
->
data
[
8
]);
values
->
data
[
8
],
values
->
data
[
9
],
values
->
data
[
10
],
values
->
data
[
11
],
values
->
data
[
12
],
values
->
data
[
13
],
values
->
data
[
14
],
values
->
data
[
15
]);
break
;
break
;
default:
default:
elog
(
ERROR
,
"fmgr_c: function %u: too many arguments (%d > %d)"
,
elog
(
ERROR
,
"fmgr_c: function %u: too many arguments (%d > %d)"
,
finfo
->
fn_oid
,
n_arguments
,
MAXFMGR
ARGS
);
finfo
->
fn_oid
,
n_arguments
,
FUNC_MAX_
ARGS
);
break
;
break
;
}
}
return
returnValue
;
return
returnValue
;
...
@@ -323,9 +394,9 @@ fmgr(Oid procedureId,...)
...
@@ -323,9 +394,9 @@ fmgr(Oid procedureId,...)
fmgr_info
(
procedureId
,
&
finfo
);
fmgr_info
(
procedureId
,
&
finfo
);
pronargs
=
finfo
.
fn_nargs
;
pronargs
=
finfo
.
fn_nargs
;
if
(
pronargs
>
MAXFMGR
ARGS
)
if
(
pronargs
>
FUNC_MAX_
ARGS
)
elog
(
ERROR
,
"fmgr: function %u: too many arguments (%d > %d)"
,
elog
(
ERROR
,
"fmgr: function %u: too many arguments (%d > %d)"
,
procedureId
,
pronargs
,
MAXFMGR
ARGS
);
procedureId
,
pronargs
,
FUNC_MAX_
ARGS
);
va_start
(
pvar
,
procedureId
);
va_start
(
pvar
,
procedureId
);
for
(
i
=
0
;
i
<
pronargs
;
++
i
)
for
(
i
=
0
;
i
<
pronargs
;
++
i
)
...
@@ -364,10 +435,10 @@ fmgr_ptr(FmgrInfo *finfo,...)
...
@@ -364,10 +435,10 @@ fmgr_ptr(FmgrInfo *finfo,...)
va_start
(
pvar
,
finfo
);
va_start
(
pvar
,
finfo
);
n_arguments
=
va_arg
(
pvar
,
int
);
n_arguments
=
va_arg
(
pvar
,
int
);
local_finfo
->
fn_nargs
=
n_arguments
;
local_finfo
->
fn_nargs
=
n_arguments
;
if
(
n_arguments
>
MAXFMGR
ARGS
)
if
(
n_arguments
>
FUNC_MAX_
ARGS
)
{
{
elog
(
ERROR
,
"fmgr_ptr: function %u: too many arguments (%d > %d)"
,
elog
(
ERROR
,
"fmgr_ptr: function %u: too many arguments (%d > %d)"
,
func_id
,
n_arguments
,
MAXFMGR
ARGS
);
func_id
,
n_arguments
,
FUNC_MAX_
ARGS
);
}
}
for
(
i
=
0
;
i
<
n_arguments
;
++
i
)
for
(
i
=
0
;
i
<
n_arguments
;
++
i
)
values
.
data
[
i
]
=
va_arg
(
pvar
,
char
*
);
values
.
data
[
i
]
=
va_arg
(
pvar
,
char
*
);
...
...
src/bin/pg_dump/pg_dump.c
View file @
8a093d0a
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.13
0 2000/01/10 16:13:16
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.13
1 2000/01/10 17:14:40
momjian Exp $
*
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
*
...
@@ -1069,7 +1069,7 @@ clearFuncInfo(FuncInfo *fun, int numFuncs)
...
@@ -1069,7 +1069,7 @@ clearFuncInfo(FuncInfo *fun, int numFuncs)
free
(
fun
[
i
].
proname
);
free
(
fun
[
i
].
proname
);
if
(
fun
[
i
].
usename
)
if
(
fun
[
i
].
usename
)
free
(
fun
[
i
].
usename
);
free
(
fun
[
i
].
usename
);
for
(
a
=
0
;
a
<
8
;
++
a
)
for
(
a
=
0
;
a
<
FUNC_MAX_ARGS
;
++
a
)
if
(
fun
[
i
].
argtypes
[
a
])
if
(
fun
[
i
].
argtypes
[
a
])
free
(
fun
[
i
].
argtypes
[
a
]);
free
(
fun
[
i
].
argtypes
[
a
]);
if
(
fun
[
i
].
prorettype
)
if
(
fun
[
i
].
prorettype
)
...
...
src/bin/pg_dump/pg_dump.h
View file @
8a093d0a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: pg_dump.h,v 1.4
3 1999/12/27 15:42:44
momjian Exp $
* $Id: pg_dump.h,v 1.4
4 2000/01/10 17:14:40
momjian Exp $
*
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
*
...
@@ -61,7 +61,7 @@ typedef struct _funcInfo
...
@@ -61,7 +61,7 @@ typedef struct _funcInfo
char
*
proowner
;
char
*
proowner
;
int
lang
;
int
lang
;
int
nargs
;
int
nargs
;
char
*
argtypes
[
8
];
/* should be derived from obj/fmgr.h
char
*
argtypes
[
FUNC_MAX_ARGS
];
/* should be derived from obj/fmgr.h
* instead of hardwired */
* instead of hardwired */
char
*
prorettype
;
char
*
prorettype
;
int
retset
;
/* 1 if the function returns a set, 0
int
retset
;
/* 1 if the function returns a set, 0
...
...
src/include/access/funcindex.h
View file @
8a093d0a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: funcindex.h,v 1.
7 1999/02/13 23:20:50
momjian Exp $
* $Id: funcindex.h,v 1.
8 2000/01/10 17:14:42
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
typedef
struct
typedef
struct
{
{
int
nargs
;
int
nargs
;
Oid
arglist
[
8
];
Oid
arglist
[
FUNC_MAX_ARGS
];
Oid
procOid
;
Oid
procOid
;
NameData
funcName
;
NameData
funcName
;
}
FuncIndexInfo
;
}
FuncIndexInfo
;
...
...
src/include/config.h.in
View file @
8a093d0a
...
@@ -93,9 +93,11 @@
...
@@ -93,9 +93,11 @@
#define INDEXSCAN_PATCH
#define INDEXSCAN_PATCH
/*
/*
* Maximum number of columns in an index.
* Maximum number of columns in an index and maximum number of args
* to a function. They must be the same value.
*/
*/
#define INDEX_MAX_KEYS 8
#define INDEX_MAX_KEYS 8
#define FUNC_MAX_ARGS INDEX_MAX_KEYS
/*
/*
* Enables debugging print statements in the date/time support routines.
* Enables debugging print statements in the date/time support routines.
...
...
src/include/parser/parse_func.h
View file @
8a093d0a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: parse_func.h,v 1.2
0 1999/12/10 07:37:33 tgl
Exp $
* $Id: parse_func.h,v 1.2
1 2000/01/10 17:14:43 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -15,9 +15,6 @@
...
@@ -15,9 +15,6 @@
#include "parser/parse_node.h"
#include "parser/parse_node.h"
#define MAXFARGS 8
/* max # args to a c or postquel function */
/*
/*
* This structure is used to explore the inheritance hierarchy above
* This structure is used to explore the inheritance hierarchy above
* nodes in the type tree in order to disambiguate among polymorphic
* nodes in the type tree in order to disambiguate among polymorphic
...
...
src/include/utils/rel.h
View file @
8a093d0a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: rel.h,v 1.3
0 1999/11/16 04:14:03
momjian Exp $
* $Id: rel.h,v 1.3
1 2000/01/10 17:14:44
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -51,7 +51,7 @@ typedef struct Trigger
...
@@ -51,7 +51,7 @@ typedef struct Trigger
bool
tgdeferrable
;
bool
tgdeferrable
;
bool
tginitdeferred
;
bool
tginitdeferred
;
int16
tgnargs
;
int16
tgnargs
;
int16
tgattr
[
8
];
int16
tgattr
[
FUNC_MAX_ARGS
];
char
**
tgargs
;
char
**
tgargs
;
}
Trigger
;
}
Trigger
;
...
...
src/pl/plpgsql/src/pl_comp.c
View file @
8a093d0a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* procedural language
* procedural language
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.1
4 1999/12/20 01:41:32 tgl
Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.1
5 2000/01/10 17:14:45 momjian
Exp $
*
*
* This software is copyrighted by Jan Wieck - Hamburg.
* This software is copyrighted by Jan Wieck - Hamburg.
*
*
...
@@ -114,7 +114,7 @@ plpgsql_compile(Oid fn_oid, int functype)
...
@@ -114,7 +114,7 @@ plpgsql_compile(Oid fn_oid, int functype)
PLpgSQL_row
*
row
;
PLpgSQL_row
*
row
;
PLpgSQL_rec
*
rec
;
PLpgSQL_rec
*
rec
;
int
i
;
int
i
;
int
arg_varnos
[
MAXFMGR
ARGS
];
int
arg_varnos
[
FUNC_MAX_
ARGS
];
/* ----------
/* ----------
* Initialize the compiler
* Initialize the compiler
...
...
src/pl/plpgsql/src/plpgsql.h
View file @
8a093d0a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* procedural language
* procedural language
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.
4 1999/07/17 20:18:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.
5 2000/01/10 17:14:45
momjian Exp $
*
*
* This software is copyrighted by Jan Wieck - Hamburg.
* This software is copyrighted by Jan Wieck - Hamburg.
*
*
...
@@ -377,7 +377,7 @@ typedef struct PLpgSQL_function
...
@@ -377,7 +377,7 @@ typedef struct PLpgSQL_function
bool
fn_retset
;
bool
fn_retset
;
int
fn_nargs
;
int
fn_nargs
;
int
fn_argvarnos
[
MAXFMGR
ARGS
];
int
fn_argvarnos
[
FUNC_MAX_
ARGS
];
int
found_varno
;
int
found_varno
;
int
new_varno
;
int
new_varno
;
int
old_varno
;
int
old_varno
;
...
...
src/pl/tcl/pltcl.c
View file @
8a093d0a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* procedural language (PL)
* procedural language (PL)
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.1
6 2000/01/05 18:23:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.1
7 2000/01/10 17:14:46
momjian Exp $
*
*
* This software is copyrighted by Jan Wieck - Hamburg.
* This software is copyrighted by Jan Wieck - Hamburg.
*
*
...
@@ -67,10 +67,10 @@ typedef struct pltcl_proc_desc
...
@@ -67,10 +67,10 @@ typedef struct pltcl_proc_desc
Oid
result_in_elem
;
Oid
result_in_elem
;
int
result_in_len
;
int
result_in_len
;
int
nargs
;
int
nargs
;
FmgrInfo
arg_out_func
[
MAXFMGR
ARGS
];
FmgrInfo
arg_out_func
[
FUNC_MAX_
ARGS
];
Oid
arg_out_elem
[
MAXFMGR
ARGS
];
Oid
arg_out_elem
[
FUNC_MAX_
ARGS
];
int
arg_out_len
[
MAXFMGR
ARGS
];
int
arg_out_len
[
FUNC_MAX_
ARGS
];
int
arg_is_rel
[
MAXFMGR
ARGS
];
int
arg_is_rel
[
FUNC_MAX_
ARGS
];
}
pltcl_proc_desc
;
}
pltcl_proc_desc
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment