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
f893ee27
Commit
f893ee27
authored
Nov 25, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused constisset and constiscast fields of Const nodes. Clean
up code and documentation associated with Param nodes.
parent
dbe100c4
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
159 additions
and
248 deletions
+159
-248
src/backend/commands/copy.c
src/backend/commands/copy.c
+2
-4
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+52
-86
src/backend/nodes/copyfuncs.c
src/backend/nodes/copyfuncs.c
+1
-3
src/backend/nodes/equalfuncs.c
src/backend/nodes/equalfuncs.c
+1
-9
src/backend/nodes/makefuncs.c
src/backend/nodes/makefuncs.c
+4
-9
src/backend/nodes/outfuncs.c
src/backend/nodes/outfuncs.c
+1
-2
src/backend/nodes/readfuncs.c
src/backend/nodes/readfuncs.c
+1
-2
src/backend/optimizer/path/clausesel.c
src/backend/optimizer/path/clausesel.c
+2
-3
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/indxpath.c
+4
-4
src/backend/optimizer/prep/preptlist.c
src/backend/optimizer/prep/preptlist.c
+3
-7
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/prep/prepunion.c
+2
-4
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/clauses.c
+7
-7
src/backend/parser/gram.y
src/backend/parser/gram.y
+1
-7
src/backend/parser/parse_coerce.c
src/backend/parser/parse_coerce.c
+3
-8
src/backend/parser/parse_node.c
src/backend/parser/parse_node.c
+3
-9
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/ruleutils.c
+1
-3
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+2
-2
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/lsyscache.c
+2
-4
src/include/nodes/execnodes.h
src/include/nodes/execnodes.h
+7
-5
src/include/nodes/makefuncs.h
src/include/nodes/makefuncs.h
+2
-4
src/include/nodes/params.h
src/include/nodes/params.h
+43
-40
src/include/nodes/primnodes.h
src/include/nodes/primnodes.h
+15
-26
No files found.
src/backend/commands/copy.c
View file @
f893ee27
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.18
1 2002/11/23 03:59:07 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.18
2 2002/11/25 21:29:34 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -860,9 +860,7 @@ CopyFrom(Relation rel, List *attnumlist, bool binary, bool oids,
...
@@ -860,9 +860,7 @@ CopyFrom(Relation rel, List *attnumlist, bool binary, bool oids,
attr
[
i
]
->
attlen
,
attr
[
i
]
->
attlen
,
(
Datum
)
0
,
(
Datum
)
0
,
true
,
/* is null */
true
,
/* is null */
attr
[
i
]
->
attbyval
,
attr
[
i
]
->
attbyval
);
false
,
/* not a set */
false
);
/* not coerced */
node
=
coerce_type_constraints
((
Node
*
)
con
,
attr
[
i
]
->
atttypid
,
node
=
coerce_type_constraints
((
Node
*
)
con
,
attr
[
i
]
->
atttypid
,
COERCE_IMPLICIT_CAST
);
COERCE_IMPLICIT_CAST
);
...
...
src/backend/executor/execQual.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.1
09 2002/11/15 02:50:06 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.1
10 2002/11/25 21:29:35 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -392,40 +392,32 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
...
@@ -392,40 +392,32 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
* Returns the value of a parameter. A param node contains
* Returns the value of a parameter. A param node contains
* something like ($.name) and the expression context contains
* something like ($.name) and the expression context contains
* the current parameter bindings (name = "sam") (age = 34)...
* the current parameter bindings (name = "sam") (age = 34)...
* so our job is to replace the param node with the datum
* so our job is to find and return the appropriate datum ("sam").
* containing the appropriate information ("sam").
*
*
* Q: if we have a parameter ($.foo) without a binding, i.e.
* Q: if we have a parameter ($.foo) without a binding, i.e.
* there is no (foo = xxx) in the parameter list info,
* there is no (foo = xxx) in the parameter list info,
* is this a fatal error or should this be a "not available"
* is this a fatal error or should this be a "not available"
* (in which case we shoud return a Const node with the
* (in which case we could return NULL)? -cim 10/13/89
* isnull flag) ? -cim 10/13/89
*
* Minor modification: Param nodes now have an extra field,
* `paramkind' which specifies the type of parameter
* (see params.h). So while searching the paramList for
* a paramname/value pair, we have also to check for `kind'.
*
* NOTE: The last entry in `paramList' is always an
* entry with kind == PARAM_INVALID.
* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
*/
Datum
Datum
ExecEvalParam
(
Param
*
expression
,
ExprContext
*
econtext
,
bool
*
isNull
)
ExecEvalParam
(
Param
*
expression
,
ExprContext
*
econtext
,
bool
*
isNull
)
{
{
char
*
thisParameterName
;
int
thisParamKind
=
expression
->
paramkind
;
int
thisParameterKind
=
expression
->
paramkind
;
AttrNumber
thisParamId
=
expression
->
paramid
;
AttrNumber
thisParameterId
=
expression
->
paramid
;
int
matchFound
;
ParamListInfo
paramList
;
if
(
thisParam
eter
Kind
==
PARAM_EXEC
)
if
(
thisParamKind
==
PARAM_EXEC
)
{
{
/*
* PARAM_EXEC params (internal executor parameters) are stored in
* the ecxt_param_exec_vals array, and can be accessed by array index.
*/
ParamExecData
*
prm
;
ParamExecData
*
prm
;
prm
=
&
(
econtext
->
ecxt_param_exec_vals
[
thisParam
eter
Id
]);
prm
=
&
(
econtext
->
ecxt_param_exec_vals
[
thisParamId
]);
if
(
prm
->
execPlan
!=
NULL
)
if
(
prm
->
execPlan
!=
NULL
)
{
{
/* Parameter not evaluated yet, so go do it */
ExecSetParamPlan
(
prm
->
execPlan
,
econtext
);
ExecSetParamPlan
(
prm
->
execPlan
,
econtext
);
/* ExecSetParamPlan should have processed this param... */
/* ExecSetParamPlan should have processed this param... */
Assert
(
prm
->
execPlan
==
NULL
);
Assert
(
prm
->
execPlan
==
NULL
);
...
@@ -433,61 +425,37 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
...
@@ -433,61 +425,37 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
*
isNull
=
prm
->
isnull
;
*
isNull
=
prm
->
isnull
;
return
prm
->
value
;
return
prm
->
value
;
}
}
else
thisParameterName
=
expression
->
paramname
;
{
paramList
=
econtext
->
ecxt_param_list_info
;
*
isNull
=
false
;
/*
/*
* search the list with the parameter info to find a matching name. An
* All other parameter types must be sought in ecxt_param_list_info.
* entry with an InvalidName denotes the last element in the array.
* NOTE: The last entry in the param array is always an
* entry with kind == PARAM_INVALID.
*/
*/
matchFound
=
0
;
ParamListInfo
paramList
=
econtext
->
ecxt_param_list_info
;
char
*
thisParamName
=
expression
->
paramname
;
bool
matchFound
=
false
;
if
(
paramList
!=
NULL
)
if
(
paramList
!=
NULL
)
{
{
/*
* search for an entry in 'paramList' that matches the
* `expression'.
*/
while
(
paramList
->
kind
!=
PARAM_INVALID
&&
!
matchFound
)
while
(
paramList
->
kind
!=
PARAM_INVALID
&&
!
matchFound
)
{
{
switch
(
thisParameterKind
)
if
(
thisParamKind
==
paramList
->
kind
)
{
switch
(
thisParamKind
)
{
{
case
PARAM_NAMED
:
case
PARAM_NAMED
:
if
(
thisParameterKind
==
paramList
->
kind
&&
if
(
strcmp
(
paramList
->
name
,
thisParamName
)
==
0
)
strcmp
(
paramList
->
name
,
thisParameterName
)
==
0
)
matchFound
=
true
;
matchFound
=
1
;
break
;
break
;
case
PARAM_NUM
:
case
PARAM_NUM
:
if
(
thisParameterKind
==
paramList
->
kind
&&
if
(
paramList
->
id
==
thisParamId
)
paramList
->
id
==
thisParameterId
)
matchFound
=
true
;
matchFound
=
1
;
break
;
case
PARAM_OLD
:
case
PARAM_NEW
:
if
(
thisParameterKind
==
paramList
->
kind
&&
paramList
->
id
==
thisParameterId
)
{
matchFound
=
1
;
/*
* sanity check
*/
if
(
strcmp
(
paramList
->
name
,
thisParameterName
)
!=
0
)
{
elog
(
ERROR
,
"ExecEvalParam: new/old params with same id & diff names"
);
}
}
break
;
break
;
default:
default:
/*
* oops! this is not supposed to happen!
*/
elog
(
ERROR
,
"ExecEvalParam: invalid paramkind %d"
,
elog
(
ERROR
,
"ExecEvalParam: invalid paramkind %d"
,
thisParameterKind
);
thisParamKind
);
}
}
}
if
(
!
matchFound
)
if
(
!
matchFound
)
paramList
++
;
paramList
++
;
...
@@ -496,19 +464,17 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
...
@@ -496,19 +464,17 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
if
(
!
matchFound
)
if
(
!
matchFound
)
{
{
/*
if
(
thisParamKind
==
PARAM_NAMED
)
* ooops! we couldn't find this parameter in the parameter list.
* Signal an error
*/
elog
(
ERROR
,
"ExecEvalParam: Unknown value for parameter %s"
,
elog
(
ERROR
,
"ExecEvalParam: Unknown value for parameter %s"
,
thisParameterName
);
thisParamName
);
else
elog
(
ERROR
,
"ExecEvalParam: Unknown value for parameter %d"
,
thisParamId
);
}
}
/*
* return the value.
*/
*
isNull
=
paramList
->
isnull
;
*
isNull
=
paramList
->
isnull
;
return
paramList
->
value
;
return
paramList
->
value
;
}
}
}
...
...
src/backend/nodes/copyfuncs.c
View file @
f893ee27
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.22
2 2002/11/25 03:33:27
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.22
3 2002/11/25 21:29:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -769,8 +769,6 @@ _copyConst(Const *from)
...
@@ -769,8 +769,6 @@ _copyConst(Const *from)
COPY_SCALAR_FIELD
(
constisnull
);
COPY_SCALAR_FIELD
(
constisnull
);
COPY_SCALAR_FIELD
(
constbyval
);
COPY_SCALAR_FIELD
(
constbyval
);
COPY_SCALAR_FIELD
(
constisset
);
COPY_SCALAR_FIELD
(
constiscast
);
return
newnode
;
return
newnode
;
}
}
...
...
src/backend/nodes/equalfuncs.c
View file @
f893ee27
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.16
8 2002/11/25 03:33:27
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.16
9 2002/11/25 21:29:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -190,7 +190,6 @@ _equalConst(Const *a, Const *b)
...
@@ -190,7 +190,6 @@ _equalConst(Const *a, Const *b)
COMPARE_SCALAR_FIELD
(
constlen
);
COMPARE_SCALAR_FIELD
(
constlen
);
COMPARE_SCALAR_FIELD
(
constisnull
);
COMPARE_SCALAR_FIELD
(
constisnull
);
COMPARE_SCALAR_FIELD
(
constbyval
);
COMPARE_SCALAR_FIELD
(
constbyval
);
/* XXX What about constisset and constiscast? */
/*
/*
* We treat all NULL constants of the same type as equal. Someday this
* We treat all NULL constants of the same type as equal. Someday this
...
@@ -212,19 +211,12 @@ _equalParam(Param *a, Param *b)
...
@@ -212,19 +211,12 @@ _equalParam(Param *a, Param *b)
switch
(
a
->
paramkind
)
switch
(
a
->
paramkind
)
{
{
case
PARAM_NAMED
:
case
PARAM_NAMED
:
case
PARAM_NEW
:
case
PARAM_OLD
:
COMPARE_STRING_FIELD
(
paramname
);
COMPARE_STRING_FIELD
(
paramname
);
break
;
break
;
case
PARAM_NUM
:
case
PARAM_NUM
:
case
PARAM_EXEC
:
case
PARAM_EXEC
:
COMPARE_SCALAR_FIELD
(
paramid
);
COMPARE_SCALAR_FIELD
(
paramid
);
break
;
break
;
case
PARAM_INVALID
:
/*
* XXX: Hmmm... What are we supposed to return in this case ??
*/
break
;
default:
default:
elog
(
ERROR
,
"_equalParam: Invalid paramkind value: %d"
,
elog
(
ERROR
,
"_equalParam: Invalid paramkind value: %d"
,
a
->
paramkind
);
a
->
paramkind
);
...
...
src/backend/nodes/makefuncs.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.3
5 2002/09/18 21:35:21
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.3
6 2002/11/25 21:29:36
tgl Exp $
*/
*/
#include "postgres.h"
#include "postgres.h"
...
@@ -157,9 +157,7 @@ makeConst(Oid consttype,
...
@@ -157,9 +157,7 @@ makeConst(Oid consttype,
int
constlen
,
int
constlen
,
Datum
constvalue
,
Datum
constvalue
,
bool
constisnull
,
bool
constisnull
,
bool
constbyval
,
bool
constbyval
)
bool
constisset
,
bool
constiscast
)
{
{
Const
*
cnst
=
makeNode
(
Const
);
Const
*
cnst
=
makeNode
(
Const
);
...
@@ -168,8 +166,7 @@ makeConst(Oid consttype,
...
@@ -168,8 +166,7 @@ makeConst(Oid consttype,
cnst
->
constvalue
=
constvalue
;
cnst
->
constvalue
=
constvalue
;
cnst
->
constisnull
=
constisnull
;
cnst
->
constisnull
=
constisnull
;
cnst
->
constbyval
=
constbyval
;
cnst
->
constbyval
=
constbyval
;
cnst
->
constisset
=
constisset
;
cnst
->
constiscast
=
constiscast
;
return
cnst
;
return
cnst
;
}
}
...
@@ -188,9 +185,7 @@ makeNullConst(Oid consttype)
...
@@ -188,9 +185,7 @@ makeNullConst(Oid consttype)
(
int
)
typLen
,
(
int
)
typLen
,
(
Datum
)
0
,
(
Datum
)
0
,
true
,
true
,
typByVal
,
typByVal
);
false
,
false
);
}
}
/*
/*
...
...
src/backend/nodes/outfuncs.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.18
2 2002/11/25 18:12:09
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.18
3 2002/11/25 21:29:36
tgl Exp $
*
*
* NOTES
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
* Every node type that can appear in stored rules' parsetrees *must*
...
@@ -735,7 +735,6 @@ _outConst(StringInfo str, Const *node)
...
@@ -735,7 +735,6 @@ _outConst(StringInfo str, Const *node)
WRITE_INT_FIELD
(
constlen
);
WRITE_INT_FIELD
(
constlen
);
WRITE_BOOL_FIELD
(
constbyval
);
WRITE_BOOL_FIELD
(
constbyval
);
WRITE_BOOL_FIELD
(
constisnull
);
WRITE_BOOL_FIELD
(
constisnull
);
/* XXX what about constisset, constiscast? */
appendStringInfo
(
str
,
" :constvalue "
);
appendStringInfo
(
str
,
" :constvalue "
);
if
(
node
->
constisnull
)
if
(
node
->
constisnull
)
...
...
src/backend/nodes/readfuncs.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.1
39 2002/11/25 18:12:10
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.1
40 2002/11/25 21:29:38
tgl Exp $
*
*
* NOTES
* NOTES
* Path and Plan nodes do not have any readfuncs support, because we
* Path and Plan nodes do not have any readfuncs support, because we
...
@@ -390,7 +390,6 @@ _readConst(void)
...
@@ -390,7 +390,6 @@ _readConst(void)
READ_INT_FIELD
(
constlen
);
READ_INT_FIELD
(
constlen
);
READ_BOOL_FIELD
(
constbyval
);
READ_BOOL_FIELD
(
constbyval
);
READ_BOOL_FIELD
(
constisnull
);
READ_BOOL_FIELD
(
constisnull
);
/* XXX what about constisset, constiscast? */
token
=
pg_strtok
(
&
length
);
/* skip :constvalue */
token
=
pg_strtok
(
&
length
);
/* skip :constvalue */
if
(
local_node
->
constisnull
)
if
(
local_node
->
constisnull
)
...
...
src/backend/optimizer/path/clausesel.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.5
2 2002/10/19 02:56:16
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.5
3 2002/11/25 21:29:39
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -29,8 +29,7 @@
...
@@ -29,8 +29,7 @@
/* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
/* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
#define MAKEBOOLCONST(val,isnull) \
#define MAKEBOOLCONST(val,isnull) \
((Node *) makeConst(BOOLOID, 1, (Datum) (val), \
((Node *) makeConst(BOOLOID, 1, (Datum) (val), (isnull), true))
(isnull), true, false, false))
/*
/*
...
...
src/backend/optimizer/path/indxpath.c
View file @
f893ee27
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.12
5 2002/11/24 21:52:14
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.12
6 2002/11/25 21:29:39
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -2167,7 +2167,7 @@ network_prefix_quals(Var *leftop, Oid expr_op, Datum rightop)
...
@@ -2167,7 +2167,7 @@ network_prefix_quals(Var *leftop, Oid expr_op, Datum rightop)
op
=
makeOper
(
opr1oid
,
InvalidOid
,
BOOLOID
,
false
);
op
=
makeOper
(
opr1oid
,
InvalidOid
,
BOOLOID
,
false
);
expr
=
make_opclause
(
op
,
leftop
,
expr
=
make_opclause
(
op
,
leftop
,
(
Var
*
)
makeConst
(
datatype
,
-
1
,
opr1right
,
(
Var
*
)
makeConst
(
datatype
,
-
1
,
opr1right
,
false
,
false
,
false
,
false
));
false
,
false
));
result
=
makeList1
(
expr
);
result
=
makeList1
(
expr
);
/* create clause "key <= network_scan_last( rightop )" */
/* create clause "key <= network_scan_last( rightop )" */
...
@@ -2182,7 +2182,7 @@ network_prefix_quals(Var *leftop, Oid expr_op, Datum rightop)
...
@@ -2182,7 +2182,7 @@ network_prefix_quals(Var *leftop, Oid expr_op, Datum rightop)
op
=
makeOper
(
opr2oid
,
InvalidOid
,
BOOLOID
,
false
);
op
=
makeOper
(
opr2oid
,
InvalidOid
,
BOOLOID
,
false
);
expr
=
make_opclause
(
op
,
leftop
,
expr
=
make_opclause
(
op
,
leftop
,
(
Var
*
)
makeConst
(
datatype
,
-
1
,
opr2right
,
(
Var
*
)
makeConst
(
datatype
,
-
1
,
opr2right
,
false
,
false
,
false
,
false
));
false
,
false
));
result
=
lappend
(
result
,
expr
);
result
=
lappend
(
result
,
expr
);
return
result
;
return
result
;
...
@@ -2233,5 +2233,5 @@ string_to_const(const char *str, Oid datatype)
...
@@ -2233,5 +2233,5 @@ string_to_const(const char *str, Oid datatype)
Datum
conval
=
string_to_datum
(
str
,
datatype
);
Datum
conval
=
string_to_datum
(
str
,
datatype
);
return
makeConst
(
datatype
,
((
datatype
==
NAMEOID
)
?
NAMEDATALEN
:
-
1
),
return
makeConst
(
datatype
,
((
datatype
==
NAMEOID
)
?
NAMEDATALEN
:
-
1
),
conval
,
false
,
false
,
false
,
false
);
conval
,
false
,
false
);
}
}
src/backend/optimizer/prep/preptlist.c
View file @
f893ee27
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.5
7 2002/09/18 21:35:21
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.5
8 2002/11/25 21:29:40
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -183,9 +183,7 @@ expand_targetlist(List *tlist, int command_type,
...
@@ -183,9 +183,7 @@ expand_targetlist(List *tlist, int command_type,
att_tup
->
attlen
,
att_tup
->
attlen
,
(
Datum
)
0
,
(
Datum
)
0
,
true
,
/* isnull */
true
,
/* isnull */
att_tup
->
attbyval
,
att_tup
->
attbyval
);
false
,
/* not a set */
false
);
if
(
!
att_tup
->
attisdropped
)
if
(
!
att_tup
->
attisdropped
)
new_expr
=
coerce_type_constraints
(
new_expr
,
new_expr
=
coerce_type_constraints
(
new_expr
,
atttype
,
atttype
,
...
@@ -198,9 +196,7 @@ expand_targetlist(List *tlist, int command_type,
...
@@ -198,9 +196,7 @@ expand_targetlist(List *tlist, int command_type,
att_tup
->
attlen
,
att_tup
->
attlen
,
(
Datum
)
0
,
(
Datum
)
0
,
true
,
/* isnull */
true
,
/* isnull */
att_tup
->
attbyval
,
att_tup
->
attbyval
);
false
,
/* not a set */
false
);
else
else
new_expr
=
(
Node
*
)
makeVar
(
result_relation
,
new_expr
=
(
Node
*
)
makeVar
(
result_relation
,
attrno
,
attrno
,
...
...
src/backend/optimizer/prep/prepunion.c
View file @
f893ee27
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.8
0 2002/09/18 21:35:21
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.8
1 2002/11/25 21:29:40
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -448,9 +448,7 @@ generate_setop_tlist(List *colTypes, int flag,
...
@@ -448,9 +448,7 @@ generate_setop_tlist(List *colTypes, int flag,
sizeof
(
int4
),
sizeof
(
int4
),
Int32GetDatum
(
flag
),
Int32GetDatum
(
flag
),
false
,
false
,
true
,
true
);
false
,
false
);
tlist
=
lappend
(
tlist
,
makeTargetEntry
(
resdom
,
expr
));
tlist
=
lappend
(
tlist
,
makeTargetEntry
(
resdom
,
expr
));
}
}
...
...
src/backend/optimizer/util/clauses.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.11
1 2002/11/15 02:50:07 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.11
2 2002/11/25 21:29:40 tgl
Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -36,8 +36,7 @@
...
@@ -36,8 +36,7 @@
/* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
/* note that pg_type.h hardwires size of bool as 1 ... duplicate it */
#define MAKEBOOLCONST(val,isnull) \
#define MAKEBOOLCONST(val,isnull) \
((Node *) makeConst(BOOLOID, 1, (Datum) (val), \
((Node *) makeConst(BOOLOID, 1, (Datum) (val), (isnull), true))
(isnull), true, false, false))
typedef
struct
typedef
struct
{
{
...
@@ -666,7 +665,8 @@ check_subplans_for_ungrouped_vars_walker(Node *node,
...
@@ -666,7 +665,8 @@ check_subplans_for_ungrouped_vars_walker(Node *node,
if
(
node
==
NULL
)
if
(
node
==
NULL
)
return
false
;
return
false
;
if
(
IsA
(
node
,
Const
)
||
IsA
(
node
,
Param
))
if
(
IsA
(
node
,
Const
)
||
IsA
(
node
,
Param
))
return
false
;
/* constants are always acceptable */
return
false
;
/* constants are always acceptable */
/*
/*
...
@@ -1287,7 +1287,7 @@ eval_const_expressions_mutator(Node *node, void *context)
...
@@ -1287,7 +1287,7 @@ eval_const_expressions_mutator(Node *node, void *context)
*/
*/
return
(
Node
*
)
makeConst
(
result_typeid
,
resultTypLen
,
return
(
Node
*
)
makeConst
(
result_typeid
,
resultTypLen
,
const_val
,
const_is_null
,
const_val
,
const_is_null
,
resultTypByVal
,
false
,
false
);
resultTypByVal
);
}
}
break
;
break
;
}
}
...
@@ -1734,7 +1734,7 @@ simplify_op_or_func(Expr *expr, List *args)
...
@@ -1734,7 +1734,7 @@ simplify_op_or_func(Expr *expr, List *args)
*/
*/
return
(
Expr
*
)
makeConst
(
result_typeid
,
resultTypLen
,
return
(
Expr
*
)
makeConst
(
result_typeid
,
resultTypLen
,
const_val
,
const_is_null
,
const_val
,
const_is_null
,
resultTypByVal
,
false
,
false
);
resultTypByVal
);
}
}
...
...
src/backend/parser/gram.y
View file @
f893ee27
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.38
2 2002/11/25 03:36:5
0 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.38
3 2002/11/25 21:29:4
0 tgl Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -4437,8 +4437,6 @@ select_limit_value:
...
@@ -4437,8 +4437,6 @@ select_limit_value:
n->constvalue = Int32GetDatum($1);
n->constvalue = Int32GetDatum($1);
n->constisnull = FALSE;
n->constisnull = FALSE;
n->constbyval = TRUE;
n->constbyval = TRUE;
n->constisset = FALSE;
n->constiscast = FALSE;
$$ = (Node *)n;
$$ = (Node *)n;
}
}
| ALL
| ALL
...
@@ -4451,8 +4449,6 @@ select_limit_value:
...
@@ -4451,8 +4449,6 @@ select_limit_value:
n->constvalue = (Datum) 0;
n->constvalue = (Datum) 0;
n->constisnull = TRUE;
n->constisnull = TRUE;
n->constbyval = TRUE;
n->constbyval = TRUE;
n->constisset = FALSE;
n->constiscast = FALSE;
$$ = (Node *)n;
$$ = (Node *)n;
}
}
| PARAM
| PARAM
...
@@ -4479,8 +4475,6 @@ select_offset_value:
...
@@ -4479,8 +4475,6 @@ select_offset_value:
n->constvalue = Int32GetDatum($1);
n->constvalue = Int32GetDatum($1);
n->constisnull = FALSE;
n->constisnull = FALSE;
n->constbyval = TRUE;
n->constbyval = TRUE;
n->constisset = FALSE;
n->constiscast = FALSE;
$$ = (Node *)n;
$$ = (Node *)n;
}
}
| PARAM
| PARAM
...
...
src/backend/parser/parse_coerce.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.8
6 2002/11/15 02:50:09 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.8
7 2002/11/25 21:29:41 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -161,7 +161,6 @@ coerce_type(Node *node, Oid inputTypeId, Oid targetTypeId,
...
@@ -161,7 +161,6 @@ coerce_type(Node *node, Oid inputTypeId, Oid targetTypeId,
newcon
->
constlen
=
typeLen
(
targetType
);
newcon
->
constlen
=
typeLen
(
targetType
);
newcon
->
constbyval
=
typeByVal
(
targetType
);
newcon
->
constbyval
=
typeByVal
(
targetType
);
newcon
->
constisnull
=
con
->
constisnull
;
newcon
->
constisnull
=
con
->
constisnull
;
newcon
->
constisset
=
false
;
if
(
!
con
->
constisnull
)
if
(
!
con
->
constisnull
)
{
{
...
@@ -553,9 +552,7 @@ coerce_type_typmod(Node *node, Oid targetTypeId, int32 targetTypMod,
...
@@ -553,9 +552,7 @@ coerce_type_typmod(Node *node, Oid targetTypeId, int32 targetTypMod,
sizeof
(
int32
),
sizeof
(
int32
),
Int32GetDatum
(
targetTypMod
),
Int32GetDatum
(
targetTypMod
),
false
,
false
,
true
,
true
);
false
,
false
);
args
=
makeList2
(
node
,
cons
);
args
=
makeList2
(
node
,
cons
);
...
@@ -566,9 +563,7 @@ coerce_type_typmod(Node *node, Oid targetTypeId, int32 targetTypMod,
...
@@ -566,9 +563,7 @@ coerce_type_typmod(Node *node, Oid targetTypeId, int32 targetTypMod,
sizeof
(
bool
),
sizeof
(
bool
),
BoolGetDatum
(
cformat
!=
COERCE_IMPLICIT_CAST
),
BoolGetDatum
(
cformat
!=
COERCE_IMPLICIT_CAST
),
false
,
false
,
true
,
true
);
false
,
false
);
args
=
lappend
(
args
,
cons
);
args
=
lappend
(
args
,
cons
);
}
}
...
...
src/backend/parser/parse_node.c
View file @
f893ee27
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.7
3 2002/11/15 02:50:09 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.7
4 2002/11/25 21:29:41 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -293,9 +293,7 @@ transformArraySubscripts(ParseState *pstate,
...
@@ -293,9 +293,7 @@ transformArraySubscripts(ParseState *pstate,
sizeof
(
int32
),
sizeof
(
int32
),
Int32GetDatum
(
1
),
Int32GetDatum
(
1
),
false
,
false
,
true
,
/* pass by value */
true
);
/* pass by value */
false
,
false
);
}
}
lowerIndexpr
=
lappend
(
lowerIndexpr
,
subexpr
);
lowerIndexpr
=
lappend
(
lowerIndexpr
,
subexpr
);
}
}
...
@@ -444,8 +442,6 @@ make_const(Value *value)
...
@@ -444,8 +442,6 @@ make_const(Value *value)
-
1
,
-
1
,
(
Datum
)
NULL
,
(
Datum
)
NULL
,
true
,
true
,
false
,
false
,
false
);
false
);
return
con
;
return
con
;
}
}
...
@@ -454,9 +450,7 @@ make_const(Value *value)
...
@@ -454,9 +450,7 @@ make_const(Value *value)
typelen
,
typelen
,
val
,
val
,
false
,
false
,
typebyval
,
typebyval
);
false
,
/* not a set */
false
);
/* not coerced */
return
con
;
return
con
;
}
}
src/backend/utils/adt/ruleutils.c
View file @
f893ee27
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* back to source text
* back to source text
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.12
5 2002/11/15 02:50:09 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.12
6 2002/11/25 21:29:41 tgl
Exp $
*
*
* This software is copyrighted by Jan Wieck - Hamburg.
* This software is copyrighted by Jan Wieck - Hamburg.
*
*
...
@@ -2243,8 +2243,6 @@ get_rule_expr(Node *node, deparse_context *context,
...
@@ -2243,8 +2243,6 @@ get_rule_expr(Node *node, deparse_context *context,
switch
(
param
->
paramkind
)
switch
(
param
->
paramkind
)
{
{
case
PARAM_NAMED
:
case
PARAM_NAMED
:
case
PARAM_NEW
:
case
PARAM_OLD
:
appendStringInfo
(
buf
,
"$%s"
,
param
->
paramname
);
appendStringInfo
(
buf
,
"$%s"
,
param
->
paramname
);
break
;
break
;
case
PARAM_NUM
:
case
PARAM_NUM
:
...
...
src/backend/utils/adt/selfuncs.c
View file @
f893ee27
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.12
1 2002/11/19 23:21:59
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.12
2 2002/11/25 21:29:42
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -3730,7 +3730,7 @@ string_to_const(const char *str, Oid datatype)
...
@@ -3730,7 +3730,7 @@ string_to_const(const char *str, Oid datatype)
Datum
conval
=
string_to_datum
(
str
,
datatype
);
Datum
conval
=
string_to_datum
(
str
,
datatype
);
return
makeConst
(
datatype
,
((
datatype
==
NAMEOID
)
?
NAMEDATALEN
:
-
1
),
return
makeConst
(
datatype
,
((
datatype
==
NAMEOID
)
?
NAMEDATALEN
:
-
1
),
conval
,
false
,
false
,
false
,
false
);
conval
,
false
,
false
);
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
...
src/backend/utils/cache/lsyscache.c
View file @
f893ee27
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.8
5 2002/09/19 23:40:56
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.8
6 2002/11/25 21:29:42
tgl Exp $
*
*
* NOTES
* NOTES
* Eventually, the index information should go through here, too.
* Eventually, the index information should go through here, too.
...
@@ -1047,9 +1047,7 @@ get_typdefault(Oid typid)
...
@@ -1047,9 +1047,7 @@ get_typdefault(Oid typid)
type
->
typlen
,
type
->
typlen
,
datum
,
datum
,
false
,
false
,
type
->
typbyval
,
type
->
typbyval
);
false
,
/* not a set */
false
);
pfree
(
strDefaultVal
);
pfree
(
strDefaultVal
);
}
}
else
else
...
...
src/include/nodes/execnodes.h
View file @
f893ee27
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: execnodes.h,v 1.
79 2002/11/22 22:10:01
tgl Exp $
* $Id: execnodes.h,v 1.
80 2002/11/25 21:29:42
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -281,14 +281,15 @@ typedef struct ResultRelInfo
...
@@ -281,14 +281,15 @@ typedef struct ResultRelInfo
*
*
* direction direction of the scan
* direction direction of the scan
*
*
* snapshot time qual to use
*
* range_table array of scan relation information
* range_table array of scan relation information
*
*
* result_relation information for insert/update/delete queries
* result_relation information for insert/update/delete queries
*
*
* into_relation_descriptor relation being retrieved "into"
* into_relation_descriptor relation being retrieved "into"
*
*
* param_list_info information needed to transform
* param_list_info information about Param values
* Param nodes into Const nodes
*
*
* tupleTable this is a pointer to an array
* tupleTable this is a pointer to an array
* of pointers to tuples used by
* of pointers to tuples used by
...
@@ -307,8 +308,8 @@ typedef struct EState
...
@@ -307,8 +308,8 @@ typedef struct EState
* elt */
* elt */
JunkFilter
*
es_junkFilter
;
/* currently active junk filter */
JunkFilter
*
es_junkFilter
;
/* currently active junk filter */
Relation
es_into_relation_descriptor
;
Relation
es_into_relation_descriptor
;
ParamListInfo
es_param_list_info
;
ParamListInfo
es_param_list_info
;
/* values of external params */
ParamExecData
*
es_param_exec_vals
;
/*
this is for subselect
s */
ParamExecData
*
es_param_exec_vals
;
/*
values of internal param
s */
TupleTable
es_tupleTable
;
TupleTable
es_tupleTable
;
uint32
es_processed
;
/* # of tuples processed */
uint32
es_processed
;
/* # of tuples processed */
Oid
es_lastoid
;
/* last oid processed (by INSERT) */
Oid
es_lastoid
;
/* last oid processed (by INSERT) */
...
@@ -322,6 +323,7 @@ typedef struct EState
...
@@ -322,6 +323,7 @@ typedef struct EState
* needed.
* needed.
*/
*/
ExprContext
*
es_per_tuple_exprcontext
;
ExprContext
*
es_per_tuple_exprcontext
;
/* Below is to re-evaluate plan qual in READ COMMITTED mode */
/* Below is to re-evaluate plan qual in READ COMMITTED mode */
struct
Plan
*
es_origPlan
;
struct
Plan
*
es_origPlan
;
Pointer
es_evalPlanQual
;
Pointer
es_evalPlanQual
;
...
...
src/include/nodes/makefuncs.h
View file @
f893ee27
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: makefuncs.h,v 1.4
1 2002/09/18 21:35:24
tgl Exp $
* $Id: makefuncs.h,v 1.4
2 2002/11/25 21:29:42
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -45,9 +45,7 @@ extern Const *makeConst(Oid consttype,
...
@@ -45,9 +45,7 @@ extern Const *makeConst(Oid consttype,
int
constlen
,
int
constlen
,
Datum
constvalue
,
Datum
constvalue
,
bool
constisnull
,
bool
constisnull
,
bool
constbyval
,
bool
constbyval
);
bool
constisset
,
bool
constiscast
);
extern
Const
*
makeNullConst
(
Oid
consttype
);
extern
Const
*
makeNullConst
(
Oid
consttype
);
...
...
src/include/nodes/params.h
View file @
f893ee27
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
*
*
* params.h
* params.h
* Declarations
/definitions
of stuff needed to handle parameterized plans.
* Declarations of stuff needed to handle parameterized plans.
*
*
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: params.h,v 1.1
7 2002/06/20 20:29:51 momjian
Exp $
* $Id: params.h,v 1.1
8 2002/11/25 21:29:42 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -16,66 +16,55 @@
...
@@ -16,66 +16,55 @@
#include "access/attnum.h"
#include "access/attnum.h"
/* ----------------------------------------------------------------
*
/* ----------------
* The following are the possible values for the 'paramkind'
* The following are the possible values for the 'paramkind'
* field of a Param node.
* field of a Param node.
*
*
* PARAM_NAMED: The parameter has a name, i.e. something
* PARAM_NAMED: The parameter has a name, i.e. something
* like `$.salary' or `$.foobar'.
* like `$.salary' or `$.foobar'.
* In this case field `paramname' must be a valid Name.
* In this case field `paramname' must be a valid name.
* and field `paramid' must be == 0.
*
*
* PARAM_NUM: The parameter has only a numeric identifier,
* PARAM_NUM: The parameter has only a numeric identifier,
* i.e. something like `$1', `$2' etc.
* i.e. something like `$1', `$2' etc.
* The number is contained in the `parmid' field.
* The number is contained in the `par
a
mid' field.
*
*
* PARAM_NEW: Used in PRS2 rule, similar to PARAM_NAMED.
* PARAM_EXEC: The parameter is an internal executor parameter.
* The `paramname' & `paramid' refer to the "NEW" tuple
* It has a number contained in the `paramid' field.
* `paramname' is the attribute name and `paramid' its
* attribute number.
*
*
* PARAM_OLD: Same as PARAM_NEW, but in this case we refer to
* PARAM_INVALID should never appear in a Param node; it's used to mark
* the "OLD" tuple.
* the end of a ParamListInfo array.
*
* PARAM_EXEC: Evaluated by executor. Used for subselect...
*
*
* NOTE: As of PostgreSQL 7.3, named parameters aren't actually used and
* so the code that handles PARAM_NAMED cases is dead code. We leave it
* in place since it might be resurrected someday.
* ----------------
*/
*/
#define PARAM_NAMED 11
#define PARAM_NAMED 11
#define PARAM_NUM 12
#define PARAM_NUM 12
#define PARAM_NEW 13
#define PARAM_OLD 14
#define PARAM_EXEC 15
#define PARAM_EXEC 15
#define PARAM_INVALID 100
#define PARAM_INVALID 100
/* ----------------
------------------------------------------------
/* ----------------
* ParamListInfo
* ParamListInfo
*
*
* Information needed in order for the executor to handle
* ParamListInfo entries are used to pass parameters into the executor
* parameterized plans (you know, $.salary, $.name etc. stuff...).
* for parameterized plans. Each entry in the array defines the value
*
* to be substituted for a PARAM_NAMED or PARAM_NUM parameter.
* ParamListInfoData contains information needed when substituting a
* Param node with a Const node.
*
*
* kind : the kind of parameter.
* kind : the kind of parameter (PARAM_NAMED or PARAM_NUM)
* name : the parameter name (valid if kind == PARAM_NAMED,
* name : the parameter name (valid if kind == PARAM_NAMED)
* PARAM_NEW or PARAM_OLD)
* id : the parameter id (valid if kind == PARAM_NUM)
* id : the parameter id (valid if kind == PARAM_NUM)
* or the attrno (if kind == PARAM_NEW or PARAM_OLD)
* isnull : true if the value is null (if so 'value' is undefined)
* type : PG_TYPE OID of the value
* length : length in bytes of the value
* isnull : true if & only if the value is null (if true then
* the fields 'length' and 'value' are undefined).
* value : the value that has to be substituted in the place
* value : the value that has to be substituted in the place
* of the parameter.
* of the parameter.
*
*
* ParamListInfo is to be used as an array of ParamListInfoData
* ParamListInfo is to be used as an array of ParamListInfoData
* records. An 'InvalidName' in the name field of such a record
* records. A dummy record with kind == PARAM_INVALID marks the end
* indicates that this is the last record in the array.
* of the array.
*
* ----------------
* ----------------------------------------------------------------
*/
*/
typedef
struct
ParamListInfoData
typedef
struct
ParamListInfoData
...
@@ -83,19 +72,33 @@ typedef struct ParamListInfoData
...
@@ -83,19 +72,33 @@ typedef struct ParamListInfoData
int
kind
;
int
kind
;
char
*
name
;
char
*
name
;
AttrNumber
id
;
AttrNumber
id
;
Oid
type
;
Size
length
;
bool
isnull
;
bool
isnull
;
bool
byval
;
Datum
value
;
Datum
value
;
}
ParamListInfoData
;
}
ParamListInfoData
;
typedef
ParamListInfoData
*
ParamListInfo
;
typedef
ParamListInfoData
*
ParamListInfo
;
/* ----------------
* ParamExecData
*
* ParamExecData entries are used for executor internal parameters
* (that is, values being passed into or out of a sub-query). The
* paramid of a PARAM_EXEC Param is a (zero-based) index into an
* array of ParamExecData records, which is referenced through
* es_param_exec_vals or ecxt_param_exec_vals.
*
* If execPlan is not NULL, it points to a SubPlan node that needs to
* be executed to produce the value. (This is done so that we can have
* lazy evaluation of InitPlans: they aren't executed until/unless a
* result value is needed.) Otherwise the value is assumed to be valid
* when needed.
* ----------------
*/
typedef
struct
ParamExecData
typedef
struct
ParamExecData
{
{
void
*
execPlan
;
/* plan must be executed to get param
void
*
execPlan
;
/* should be "SubPlan *" */
* value */
Datum
value
;
Datum
value
;
bool
isnull
;
bool
isnull
;
}
ParamExecData
;
}
ParamExecData
;
...
...
src/include/nodes/primnodes.h
View file @
f893ee27
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: primnodes.h,v 1.6
8 2002/09/18 21:35:24
tgl Exp $
* $Id: primnodes.h,v 1.6
9 2002/11/25 21:29:42
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -267,20 +267,16 @@ typedef struct Var
...
@@ -267,20 +267,16 @@ typedef struct Var
typedef
struct
Const
typedef
struct
Const
{
{
NodeTag
type
;
NodeTag
type
;
Oid
consttype
;
/* PG_TYPE OID of the constant's
valu
e */
Oid
consttype
;
/* PG_TYPE OID of the constant's
datatyp
e */
int
constlen
;
/*
length in bytes of the constant's valu
e */
int
constlen
;
/*
typlen of the constant's datatyp
e */
Datum
constvalue
;
/* the constant's value */
Datum
constvalue
;
/* the constant's value */
bool
constisnull
;
/* whether the constant is null (if true,
bool
constisnull
;
/* whether the constant is null (if true,
*
the other fields are
undefined) */
*
constvalue is
undefined) */
bool
constbyval
;
/* whether th
e information in constvalue
bool
constbyval
;
/* whether th
is datatype is passed by value.
*
if passed by value. If true, then all
*
If true, then all the information is
*
the information is stored in the d
atum.
*
stored in the D
atum.
* If false, then the
d
atum contains a
* If false, then the
D
atum contains a
* pointer to the information. */
* pointer to the information. */
bool
constisset
;
/* whether the const represents a set. The
* const value corresponding will be the
* query that defines the set. */
bool
constiscast
;
}
Const
;
}
Const
;
/* ----------------
/* ----------------
...
@@ -290,31 +286,24 @@ typedef struct Const
...
@@ -290,31 +286,24 @@ typedef struct Const
*
*
* PARAM_NAMED: The parameter has a name, i.e. something
* PARAM_NAMED: The parameter has a name, i.e. something
* like `$.salary' or `$.foobar'.
* like `$.salary' or `$.foobar'.
* In this case field `paramname' must be a valid
N
ame.
* In this case field `paramname' must be a valid
n
ame.
*
*
* PARAM_NUM: The parameter has only a numeric identifier,
* PARAM_NUM: The parameter has only a numeric identifier,
* i.e. something like `$1', `$2' etc.
* i.e. something like `$1', `$2' etc.
* The number is contained in the `paramid' field.
* The number is contained in the `paramid' field.
*
*
* PARAM_NEW: Used in PRS2 rule, similar to PARAM_NAMED.
* PARAM_EXEC: The parameter is an internal executor parameter.
* The `paramname' and `paramid' refer to the "NEW" tuple
* It has a number contained in the `paramid' field.
* The `pramname' is the attribute name and `paramid'
* is the attribute number.
*
*
* PARAM_OLD: Same as PARAM_NEW, but in this case we refer to
* the "OLD" tuple.
* ----------------
* ----------------
*/
*/
typedef
struct
Param
typedef
struct
Param
{
{
NodeTag
type
;
NodeTag
type
;
int
paramkind
;
/* specifies the kind of parameter. See
int
paramkind
;
/* kind of parameter. See above */
* above */
AttrNumber
paramid
;
/* numeric ID for parameter ("$1") */
AttrNumber
paramid
;
/* numeric identifier for literal-constant
char
*
paramname
;
/* name for parameter ("$.foo") */
* parameters ("$1") */
Oid
paramtype
;
/* PG_TYPE OID of parameter's datatype */
char
*
paramname
;
/* attribute name for tuple-substitution
* parameters ("$.foo") */
Oid
paramtype
;
/* PG_TYPE OID of the parameter's value */
}
Param
;
}
Param
;
/*
/*
...
...
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