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
6cc88f0a
Commit
6cc88f0a
authored
Jul 18, 2008
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a function hook to let plug-ins get control around ExecutorRun.
ITAGAKI Takahiro
parent
8d7af890
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+21
-1
src/include/executor/executor.h
src/include/executor/executor.h
+10
-1
No files found.
src/backend/executor/execMain.c
View file @
6cc88f0a
...
...
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.3
09 2008/05/12 20:02:00 alvherre
Exp $
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.3
10 2008/07/18 18:23:46 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -58,6 +58,9 @@
#include "utils/tqual.h"
/* Hook for plugins to get control in ExecutorRun() */
ExecutorRun_hook_type
ExecutorRun_hook
=
NULL
;
typedef
struct
evalPlanQual
{
Index
rti
;
...
...
@@ -214,11 +217,28 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
* Note: count = 0 is interpreted as no portal limit, i.e., run to
* completion.
*
* We provide a function hook variable that lets loadable plugins
* get control when ExecutorRun is called. Such a plugin would
* normally call standard_ExecutorRun().
*
* ----------------------------------------------------------------
*/
TupleTableSlot
*
ExecutorRun
(
QueryDesc
*
queryDesc
,
ScanDirection
direction
,
long
count
)
{
TupleTableSlot
*
result
;
if
(
ExecutorRun_hook
)
result
=
(
*
ExecutorRun_hook
)
(
queryDesc
,
direction
,
count
);
else
result
=
standard_ExecutorRun
(
queryDesc
,
direction
,
count
);
return
result
;
}
TupleTableSlot
*
standard_ExecutorRun
(
QueryDesc
*
queryDesc
,
ScanDirection
direction
,
long
count
)
{
EState
*
estate
;
CmdType
operation
;
...
...
src/include/executor/executor.h
View file @
6cc88f0a
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.14
7 2008/03/28 00:21:56
tgl Exp $
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.14
8 2008/07/18 18:23:47
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -60,6 +60,13 @@
((*(expr)->evalfunc) (expr, econtext, isNull, isDone))
/* Hook for plugins to get control in ExecutorRun() */
typedef
TupleTableSlot
*
(
*
ExecutorRun_hook_type
)
(
QueryDesc
*
queryDesc
,
ScanDirection
direction
,
long
count
);
extern
PGDLLIMPORT
ExecutorRun_hook_type
ExecutorRun_hook
;
/*
* prototypes from functions in execAmi.c
*/
...
...
@@ -136,6 +143,8 @@ extern HeapTuple ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot);
extern
void
ExecutorStart
(
QueryDesc
*
queryDesc
,
int
eflags
);
extern
TupleTableSlot
*
ExecutorRun
(
QueryDesc
*
queryDesc
,
ScanDirection
direction
,
long
count
);
extern
TupleTableSlot
*
standard_ExecutorRun
(
QueryDesc
*
queryDesc
,
ScanDirection
direction
,
long
count
);
extern
void
ExecutorEnd
(
QueryDesc
*
queryDesc
);
extern
void
ExecutorRewind
(
QueryDesc
*
queryDesc
);
extern
void
InitResultRelInfo
(
ResultRelInfo
*
resultRelInfo
,
...
...
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