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
338aa57b
Commit
338aa57b
authored
Aug 06, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename fields of DestReceiver to avoid collisions with (ill-considered)
macros in some platforms' sys/socket.h.
parent
d5f7d2c6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
34 deletions
+34
-34
src/backend/access/common/printtup.c
src/backend/access/common/printtup.c
+4
-4
src/backend/commands/portalcmds.c
src/backend/commands/portalcmds.c
+2
-2
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+3
-3
src/backend/executor/execTuples.c
src/backend/executor/execTuples.c
+3
-3
src/backend/executor/tstoreReceiver.c
src/backend/executor/tstoreReceiver.c
+4
-4
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+4
-4
src/backend/tcop/pquery.c
src/backend/tcop/pquery.c
+4
-4
src/include/tcop/dest.h
src/include/tcop/dest.h
+10
-10
No files found.
src/backend/access/common/printtup.c
View file @
338aa57b
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.7
7 2003/08/04 02:39:56 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.7
8 2003/08/06 17:46:45 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -90,9 +90,9 @@ printtup_create_DR(CommandDest dest, Portal portal)
else
self
->
pub
.
receiveTuple
=
printtup_20
;
}
self
->
pub
.
s
tartup
=
printtup_startup
;
self
->
pub
.
s
hutdown
=
printtup_shutdown
;
self
->
pub
.
d
estroy
=
printtup_destroy
;
self
->
pub
.
rS
tartup
=
printtup_startup
;
self
->
pub
.
rS
hutdown
=
printtup_shutdown
;
self
->
pub
.
rD
estroy
=
printtup_destroy
;
self
->
pub
.
mydest
=
dest
;
self
->
portal
=
portal
;
...
...
src/backend/commands/portalcmds.c
View file @
338aa57b
...
...
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.2
1 2003/08/04 02:39:58 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.2
2 2003/08/06 17:46:45 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -335,7 +335,7 @@ PersistHoldablePortal(Portal portal)
/* Fetch the result set into the tuplestore */
ExecutorRun
(
queryDesc
,
ForwardScanDirection
,
0L
);
(
*
queryDesc
->
dest
->
d
estroy
)
(
queryDesc
->
dest
);
(
*
queryDesc
->
dest
->
rD
estroy
)
(
queryDesc
->
dest
);
queryDesc
->
dest
=
NULL
;
/*
...
...
src/backend/executor/execMain.c
View file @
338aa57b
...
...
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.21
4 2003/08/04 02:39:58 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.21
5 2003/08/06 17:46:45 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -217,7 +217,7 @@ ExecutorRun(QueryDesc *queryDesc,
estate
->
es_processed
=
0
;
estate
->
es_lastoid
=
InvalidOid
;
(
*
dest
->
s
tartup
)
(
dest
,
operation
,
queryDesc
->
tupDesc
);
(
*
dest
->
rS
tartup
)
(
dest
,
operation
,
queryDesc
->
tupDesc
);
/*
* run plan
...
...
@@ -235,7 +235,7 @@ ExecutorRun(QueryDesc *queryDesc,
/*
* shutdown receiver
*/
(
*
dest
->
s
hutdown
)
(
dest
);
(
*
dest
->
rS
hutdown
)
(
dest
);
MemoryContextSwitchTo
(
oldcontext
);
...
...
src/backend/executor/execTuples.c
View file @
338aa57b
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.
69 2003/08/04 02:39:58 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.
70 2003/08/06 17:46:45 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -764,7 +764,7 @@ begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
tstate
->
metadata
=
TupleDescGetAttInMetadata
(
tupdesc
);
tstate
->
dest
=
dest
;
(
*
tstate
->
dest
->
s
tartup
)
(
tstate
->
dest
,
(
int
)
CMD_SELECT
,
tupdesc
);
(
*
tstate
->
dest
->
rS
tartup
)
(
tstate
->
dest
,
(
int
)
CMD_SELECT
,
tupdesc
);
return
tstate
;
}
...
...
@@ -817,7 +817,7 @@ do_text_output_multiline(TupOutputState *tstate, char *text)
void
end_tup_output
(
TupOutputState
*
tstate
)
{
(
*
tstate
->
dest
->
s
hutdown
)
(
tstate
->
dest
);
(
*
tstate
->
dest
->
rS
hutdown
)
(
tstate
->
dest
);
/* note that destroying the dest is not ours to do */
/* XXX worth cleaning up the attinmetadata? */
pfree
(
tstate
);
...
...
src/backend/executor/tstoreReceiver.c
View file @
338aa57b
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.
8 2003/08/04 02:39:59 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.
9 2003/08/06 17:46:45 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -78,9 +78,9 @@ CreateTuplestoreDestReceiver(Tuplestorestate *tStore,
TStoreState
*
self
=
(
TStoreState
*
)
palloc
(
sizeof
(
TStoreState
));
self
->
pub
.
receiveTuple
=
tstoreReceiveTuple
;
self
->
pub
.
s
tartup
=
tstoreStartupReceiver
;
self
->
pub
.
s
hutdown
=
tstoreShutdownReceiver
;
self
->
pub
.
d
estroy
=
tstoreDestroyReceiver
;
self
->
pub
.
rS
tartup
=
tstoreStartupReceiver
;
self
->
pub
.
rS
hutdown
=
tstoreShutdownReceiver
;
self
->
pub
.
rD
estroy
=
tstoreDestroyReceiver
;
self
->
pub
.
mydest
=
Tuplestore
;
self
->
tstore
=
tStore
;
...
...
src/backend/tcop/postgres.c
View file @
338aa57b
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.35
6 2003/08/04 04:03:06
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.35
7 2003/08/06 17:46:45
tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -878,7 +878,7 @@ exec_simple_query(const char *query_string)
receiver
,
completionTag
);
(
*
receiver
->
d
estroy
)
(
receiver
);
(
*
receiver
->
rD
estroy
)
(
receiver
);
PortalDrop
(
portal
,
false
);
...
...
@@ -1590,7 +1590,7 @@ exec_execute_message(const char *portal_name, long max_rows)
receiver
,
completionTag
);
(
*
receiver
->
d
estroy
)
(
receiver
);
(
*
receiver
->
rD
estroy
)
(
receiver
);
if
(
completed
)
{
...
...
@@ -2643,7 +2643,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.35
6 $ $Date: 2003/08/04 04:03:06
$
\n
"
);
puts
(
"$Revision: 1.35
7 $ $Date: 2003/08/06 17:46:45
$
\n
"
);
}
/*
...
...
src/backend/tcop/pquery.c
View file @
338aa57b
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.7
0 2003/08/04 02:40:04 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.7
1 2003/08/06 17:46:46 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -457,7 +457,7 @@ PortalRun(Portal portal, long count,
treceiver
=
CreateDestReceiver
(
Tuplestore
,
portal
);
PortalRunUtility
(
portal
,
lfirst
(
portal
->
parseTrees
),
treceiver
,
NULL
);
(
*
treceiver
->
d
estroy
)
(
treceiver
);
(
*
treceiver
->
rD
estroy
)
(
treceiver
);
portal
->
portalUtilReady
=
true
;
}
...
...
@@ -666,7 +666,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count,
{
long
current_tuple_count
=
0
;
(
*
dest
->
s
tartup
)
(
dest
,
CMD_SELECT
,
portal
->
tupDesc
);
(
*
dest
->
rS
tartup
)
(
dest
,
CMD_SELECT
,
portal
->
tupDesc
);
if
(
direction
==
NoMovementScanDirection
)
{
...
...
@@ -708,7 +708,7 @@ RunFromStore(Portal portal, ScanDirection direction, long count,
}
}
(
*
dest
->
s
hutdown
)
(
dest
);
(
*
dest
->
rS
hutdown
)
(
dest
);
return
(
uint32
)
current_tuple_count
;
}
...
...
src/include/tcop/dest.h
View file @
338aa57b
...
...
@@ -30,18 +30,18 @@
* CreateDestReceiver returns a receiver object appropriate to the specified
* destination. The executor, as well as utility statements that can return
* tuples, are passed the resulting DestReceiver* pointer. Each executor run
* or utility execution calls the receiver's
s
tartup method, then the
* receiveTuple method (zero or more times), then the
s
hutdown method.
* or utility execution calls the receiver's
rS
tartup method, then the
* receiveTuple method (zero or more times), then the
rS
hutdown method.
* The same receiver object may be re-used multiple times; eventually it is
* destroyed by calling its
d
estroy method.
* destroyed by calling its
rD
estroy method.
*
* The DestReceiver object returned by CreateDestReceiver may be a statically
* allocated object (for destination types that require no local state),
* in which case
d
estroy is a no-op. Alternatively it can be a palloc'd
* in which case
rD
estroy is a no-op. Alternatively it can be a palloc'd
* object that has DestReceiver as its first field and contains additional
* fields (see printtup.c for an example). These additional fields are then
* accessible to the DestReceiver functions by casting the DestReceiver*
* pointer passed to them. The palloc'd object is pfree'd by the
d
estroy
* pointer passed to them. The palloc'd object is pfree'd by the
rD
estroy
* method. Note that the caller of CreateDestReceiver should take care to
* do so in a memory context that is long-lived enough for the receiver
* object not to disappear while still needed.
...
...
@@ -54,7 +54,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: dest.h,v 1.4
0 2003/08/04 02:40:15 momjian
Exp $
* $Id: dest.h,v 1.4
1 2003/08/06 17:46:46 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -93,7 +93,7 @@ typedef enum
* pointers that the executor must call.
*
* Note: the receiveTuple routine must be passed a TupleDesc identical to the
* one given to the
s
tartup routine. The reason for passing it again is just
* one given to the
rS
tartup routine. The reason for passing it again is just
* that some destinations would otherwise need dynamic state merely to
* remember the tupledesc pointer.
* ----------------
...
...
@@ -107,12 +107,12 @@ struct _DestReceiver
TupleDesc
typeinfo
,
DestReceiver
*
self
);
/* Per-executor-run initialization and shutdown: */
void
(
*
s
tartup
)
(
DestReceiver
*
self
,
void
(
*
rS
tartup
)
(
DestReceiver
*
self
,
int
operation
,
TupleDesc
typeinfo
);
void
(
*
s
hutdown
)
(
DestReceiver
*
self
);
void
(
*
rS
hutdown
)
(
DestReceiver
*
self
);
/* Destroy the receiver object itself (if dynamically allocated) */
void
(
*
d
estroy
)
(
DestReceiver
*
self
);
void
(
*
rD
estroy
)
(
DestReceiver
*
self
);
/* CommandDest code for this receiver */
CommandDest
mydest
;
/* Private fields might appear beyond this point... */
...
...
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