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
4a39057e
Commit
4a39057e
authored
Oct 13, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Back out makeNode() patch to fix gcc 3.3.1 warning.
parent
014a0a3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
46 deletions
+44
-46
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+9
-10
src/backend/executor/execQual.c
src/backend/executor/execQual.c
+33
-34
src/backend/port/sysv_shmem.c
src/backend/port/sysv_shmem.c
+2
-2
No files found.
src/backend/commands/tablecmds.c
View file @
4a39057e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.9
0 2003/10/13 20:02:52 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.9
1 2003/10/13 22:47:15 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -3397,7 +3397,6 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
...
@@ -3397,7 +3397,6 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
Relation
pkrel
)
Relation
pkrel
)
{
{
HeapScanDesc
scan
;
HeapScanDesc
scan
;
TriggerData
*
trigdata
=
makeNode
(
TriggerData
);
/* must be Node aligned */
HeapTuple
tuple
;
HeapTuple
tuple
;
Trigger
trig
;
Trigger
trig
;
List
*
list
;
List
*
list
;
...
@@ -3455,6 +3454,7 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
...
@@ -3455,6 +3454,7 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
while
((
tuple
=
heap_getnext
(
scan
,
ForwardScanDirection
))
!=
NULL
)
while
((
tuple
=
heap_getnext
(
scan
,
ForwardScanDirection
))
!=
NULL
)
{
{
FunctionCallInfoData
fcinfo
;
FunctionCallInfoData
fcinfo
;
TriggerData
trigdata
;
/*
/*
* Make a call to the trigger function
* Make a call to the trigger function
...
@@ -3466,21 +3466,20 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
...
@@ -3466,21 +3466,20 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
/*
/*
* We assume RI_FKey_check_ins won't look at flinfo...
* We assume RI_FKey_check_ins won't look at flinfo...
*/
*/
trigdata
->
type
=
T_TriggerData
;
trigdata
.
type
=
T_TriggerData
;
trigdata
->
tg_event
=
TRIGGER_EVENT_INSERT
|
TRIGGER_EVENT_ROW
;
trigdata
.
tg_event
=
TRIGGER_EVENT_INSERT
|
TRIGGER_EVENT_ROW
;
trigdata
->
tg_relation
=
rel
;
trigdata
.
tg_relation
=
rel
;
trigdata
->
tg_trigtuple
=
tuple
;
trigdata
.
tg_trigtuple
=
tuple
;
trigdata
->
tg_newtuple
=
NULL
;
trigdata
.
tg_newtuple
=
NULL
;
trigdata
->
tg_trigger
=
&
trig
;
trigdata
.
tg_trigger
=
&
trig
;
fcinfo
.
context
=
(
Node
*
)
trigdata
;
fcinfo
.
context
=
(
Node
*
)
&
trigdata
;
RI_FKey_check_ins
(
&
fcinfo
);
RI_FKey_check_ins
(
&
fcinfo
);
}
}
heap_endscan
(
scan
);
heap_endscan
(
scan
);
pfree
(
trigdata
);
pfree
(
trig
.
tgargs
);
pfree
(
trig
.
tgargs
);
}
}
...
...
src/backend/executor/execQual.c
View file @
4a39057e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.1
49 2003/10/12 23:19:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.1
50 2003/10/13 22:47:15
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -699,8 +699,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
...
@@ -699,8 +699,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
List
*
arguments
=
fcache
->
args
;
List
*
arguments
=
fcache
->
args
;
Datum
result
;
Datum
result
;
FunctionCallInfoData
fcinfo
;
FunctionCallInfoData
fcinfo
;
/* for functions returning sets, must be aligned as Node, so use makeNode */
ReturnSetInfo
rsinfo
;
/* for functions returning sets */
ReturnSetInfo
*
rsinfo
=
makeNode
(
ReturnSetInfo
);
ExprDoneCond
argDone
;
ExprDoneCond
argDone
;
bool
hasSetArg
;
bool
hasSetArg
;
int
i
;
int
i
;
...
@@ -747,15 +746,15 @@ ExecMakeFunctionResult(FuncExprState *fcache,
...
@@ -747,15 +746,15 @@ ExecMakeFunctionResult(FuncExprState *fcache,
*/
*/
if
(
fcache
->
func
.
fn_retset
)
if
(
fcache
->
func
.
fn_retset
)
{
{
fcinfo
.
resultinfo
=
(
Node
*
)
rsinfo
;
fcinfo
.
resultinfo
=
(
Node
*
)
&
rsinfo
;
rsinfo
->
type
=
T_ReturnSetInfo
;
rsinfo
.
type
=
T_ReturnSetInfo
;
rsinfo
->
econtext
=
econtext
;
rsinfo
.
econtext
=
econtext
;
rsinfo
->
expectedDesc
=
NULL
;
rsinfo
.
expectedDesc
=
NULL
;
rsinfo
->
allowedModes
=
(
int
)
SFRM_ValuePerCall
;
rsinfo
.
allowedModes
=
(
int
)
SFRM_ValuePerCall
;
rsinfo
->
returnMode
=
SFRM_ValuePerCall
;
rsinfo
.
returnMode
=
SFRM_ValuePerCall
;
/* isDone is filled below */
/* isDone is filled below */
rsinfo
->
setResult
=
NULL
;
rsinfo
.
setResult
=
NULL
;
rsinfo
->
setDesc
=
NULL
;
rsinfo
.
setDesc
=
NULL
;
}
}
/*
/*
...
@@ -804,10 +803,10 @@ ExecMakeFunctionResult(FuncExprState *fcache,
...
@@ -804,10 +803,10 @@ ExecMakeFunctionResult(FuncExprState *fcache,
if
(
callit
)
if
(
callit
)
{
{
fcinfo
.
isnull
=
false
;
fcinfo
.
isnull
=
false
;
rsinfo
->
isDone
=
ExprSingleResult
;
rsinfo
.
isDone
=
ExprSingleResult
;
result
=
FunctionCallInvoke
(
&
fcinfo
);
result
=
FunctionCallInvoke
(
&
fcinfo
);
*
isNull
=
fcinfo
.
isnull
;
*
isNull
=
fcinfo
.
isnull
;
*
isDone
=
rsinfo
->
isDone
;
*
isDone
=
rsinfo
.
isDone
;
}
}
else
else
{
{
...
@@ -904,7 +903,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -904,7 +903,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
TupleDesc
tupdesc
=
NULL
;
TupleDesc
tupdesc
=
NULL
;
Oid
funcrettype
;
Oid
funcrettype
;
FunctionCallInfoData
fcinfo
;
FunctionCallInfoData
fcinfo
;
ReturnSetInfo
*
rsinfo
=
makeNode
(
ReturnSetInfo
);
/* must be Node aligned */
ReturnSetInfo
rsinfo
;
MemoryContext
callerContext
;
MemoryContext
callerContext
;
MemoryContext
oldcontext
;
MemoryContext
oldcontext
;
TupleTableSlot
*
slot
;
TupleTableSlot
*
slot
;
...
@@ -993,15 +992,15 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -993,15 +992,15 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
* doesn't actually get to see the resultinfo, but set it up anyway
* doesn't actually get to see the resultinfo, but set it up anyway
* because we use some of the fields as our own state variables.
* because we use some of the fields as our own state variables.
*/
*/
fcinfo
.
resultinfo
=
(
Node
*
)
rsinfo
;
fcinfo
.
resultinfo
=
(
Node
*
)
&
rsinfo
;
rsinfo
->
type
=
T_ReturnSetInfo
;
rsinfo
.
type
=
T_ReturnSetInfo
;
rsinfo
->
econtext
=
econtext
;
rsinfo
.
econtext
=
econtext
;
rsinfo
->
expectedDesc
=
expectedDesc
;
rsinfo
.
expectedDesc
=
expectedDesc
;
rsinfo
->
allowedModes
=
(
int
)
(
SFRM_ValuePerCall
|
SFRM_Materialize
);
rsinfo
.
allowedModes
=
(
int
)
(
SFRM_ValuePerCall
|
SFRM_Materialize
);
rsinfo
->
returnMode
=
SFRM_ValuePerCall
;
rsinfo
.
returnMode
=
SFRM_ValuePerCall
;
/* isDone is filled below */
/* isDone is filled below */
rsinfo
->
setResult
=
NULL
;
rsinfo
.
setResult
=
NULL
;
rsinfo
->
setDesc
=
NULL
;
rsinfo
.
setDesc
=
NULL
;
/*
/*
* Switch to short-lived context for calling the function or
* Switch to short-lived context for calling the function or
...
@@ -1029,17 +1028,17 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -1029,17 +1028,17 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
if
(
direct_function_call
)
if
(
direct_function_call
)
{
{
fcinfo
.
isnull
=
false
;
fcinfo
.
isnull
=
false
;
rsinfo
->
isDone
=
ExprSingleResult
;
rsinfo
.
isDone
=
ExprSingleResult
;
result
=
FunctionCallInvoke
(
&
fcinfo
);
result
=
FunctionCallInvoke
(
&
fcinfo
);
}
}
else
else
{
{
result
=
ExecEvalExpr
(
funcexpr
,
econtext
,
result
=
ExecEvalExpr
(
funcexpr
,
econtext
,
&
fcinfo
.
isnull
,
&
rsinfo
->
isDone
);
&
fcinfo
.
isnull
,
&
rsinfo
.
isDone
);
}
}
/* Which protocol does function want to use? */
/* Which protocol does function want to use? */
if
(
rsinfo
->
returnMode
==
SFRM_ValuePerCall
)
if
(
rsinfo
.
returnMode
==
SFRM_ValuePerCall
)
{
{
/*
/*
* Check for end of result set.
* Check for end of result set.
...
@@ -1048,7 +1047,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -1048,7 +1047,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
* tupdesc or tuplestore (since we can't get a tupdesc in the
* tupdesc or tuplestore (since we can't get a tupdesc in the
* function-returning-tuple case)
* function-returning-tuple case)
*/
*/
if
(
rsinfo
->
isDone
==
ExprEndResult
)
if
(
rsinfo
.
isDone
==
ExprEndResult
)
break
;
break
;
/*
/*
...
@@ -1094,8 +1093,8 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -1094,8 +1093,8 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
}
}
tupstore
=
tuplestore_begin_heap
(
true
,
false
,
SortMem
);
tupstore
=
tuplestore_begin_heap
(
true
,
false
,
SortMem
);
MemoryContextSwitchTo
(
oldcontext
);
MemoryContextSwitchTo
(
oldcontext
);
rsinfo
->
setResult
=
tupstore
;
rsinfo
.
setResult
=
tupstore
;
rsinfo
->
setDesc
=
tupdesc
;
rsinfo
.
setDesc
=
tupdesc
;
}
}
/*
/*
...
@@ -1128,13 +1127,13 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -1128,13 +1127,13 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
/*
/*
* Are we done?
* Are we done?
*/
*/
if
(
rsinfo
->
isDone
!=
ExprMultipleResult
)
if
(
rsinfo
.
isDone
!=
ExprMultipleResult
)
break
;
break
;
}
}
else
if
(
rsinfo
->
returnMode
==
SFRM_Materialize
)
else
if
(
rsinfo
.
returnMode
==
SFRM_Materialize
)
{
{
/* check we're on the same page as the function author */
/* check we're on the same page as the function author */
if
(
!
first_time
||
rsinfo
->
isDone
!=
ExprSingleResult
)
if
(
!
first_time
||
rsinfo
.
isDone
!=
ExprSingleResult
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED
),
(
errcode
(
ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED
),
errmsg
(
"table-function protocol for materialize mode was not followed"
)));
errmsg
(
"table-function protocol for materialize mode was not followed"
)));
...
@@ -1145,7 +1144,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -1145,7 +1144,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED
),
(
errcode
(
ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED
),
errmsg
(
"unrecognized table-function returnMode: %d"
,
errmsg
(
"unrecognized table-function returnMode: %d"
,
(
int
)
rsinfo
->
returnMode
)));
(
int
)
rsinfo
.
returnMode
)));
first_time
=
false
;
first_time
=
false
;
}
}
...
@@ -1153,8 +1152,8 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
...
@@ -1153,8 +1152,8 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
MemoryContextSwitchTo
(
callerContext
);
MemoryContextSwitchTo
(
callerContext
);
/* The returned pointers are those in rsinfo */
/* The returned pointers are those in rsinfo */
*
returnDesc
=
rsinfo
->
setDesc
;
*
returnDesc
=
rsinfo
.
setDesc
;
return
rsinfo
->
setResult
;
return
rsinfo
.
setResult
;
}
}
...
...
src/backend/port/sysv_shmem.c
View file @
4a39057e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,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/port/sysv_shmem.c,v 1.2
0 2003/10/12 23:19:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.2
1 2003/10/13 22:47:15
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -365,7 +365,7 @@ PGSharedMemoryAttach(IpcMemoryKey key, IpcMemoryId *shmid)
...
@@ -365,7 +365,7 @@ PGSharedMemoryAttach(IpcMemoryKey key, IpcMemoryId *shmid)
if
(
hdr
->
magic
!=
PGShmemMagic
)
if
(
hdr
->
magic
!=
PGShmemMagic
)
{
{
shmdt
(
(
void
*
)
hdr
);
shmdt
(
hdr
);
return
NULL
;
/* segment belongs to a non-Postgres app */
return
NULL
;
/* segment belongs to a non-Postgres app */
}
}
...
...
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