Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
6cc88f0a
Commit
6cc88f0a
authored
16 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Provide a function hook to let plug-ins get control around ExecutorRun.
ITAGAKI Takahiro
parent
8d7af890
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/executor/execMain.c
+21
-1
21 additions, 1 deletion
src/backend/executor/execMain.c
src/include/executor/executor.h
+10
-1
10 additions, 1 deletion
src/include/executor/executor.h
with
31 additions
and
2 deletions
src/backend/executor/execMain.c
+
21
−
1
View file @
6cc88f0a
...
...
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.30
9
2008/0
5
/1
2 20:02:00 alvherre
Exp $
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.3
1
0 2008/0
7
/1
8 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
;
...
...
This diff is collapsed.
Click to expand it.
src/include/executor/executor.h
+
10
−
1
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/0
3/28 00:21:56
tgl Exp $
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.14
8
2008/0
7/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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment