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
0d0254d1
Commit
0d0254d1
authored
Aug 29, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPI manager.
parent
3152996f
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
633 additions
and
18 deletions
+633
-18
src/backend/executor/functions.c
src/backend/executor/functions.c
+30
-18
src/backend/executor/spi.c
src/backend/executor/spi.c
+534
-0
src/include/executor/spi.h
src/include/executor/spi.h
+69
-0
No files found.
src/backend/executor/functions.c
View file @
0d0254d1
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.
6 1997/08/12 22:52:35 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.
7 1997/08/29 09:02:50 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -368,6 +368,16 @@ postquel_function(Func *funcNode, char **args, bool *isNull, bool *isDone)
execution_state
*
es
;
Datum
result
=
0
;
FunctionCachePtr
fcache
=
funcNode
->
func_fcache
;
CommandId
savedId
;
/*
* Before we start do anything we must save CurrentScanCommandId
* to restore it before return to upper Executor. Also, we have to
* set CurrentScanCommandId equal to CurrentCommandId.
* - vadim 08/29/97
*/
savedId
=
GetScanCommandId
();
SetScanCommandId
(
GetCurrentCommandId
());
es
=
(
execution_state
*
)
fcache
->
func_state
;
if
(
es
==
NULL
)
...
...
@@ -415,6 +425,7 @@ postquel_function(Func *funcNode, char **args, bool *isNull, bool *isDone)
* Let caller know we're finished.
*/
*
isDone
=
true
;
SetScanCommandId
(
savedId
);
return
(
fcache
->
oneResult
)
?
result
:
(
Datum
)
NULL
;
}
/*
...
...
@@ -425,5 +436,6 @@ postquel_function(Func *funcNode, char **args, bool *isNull, bool *isDone)
Assert
(
LAST_POSTQUEL_COMMAND
(
es
)
);
*
isDone
=
false
;
SetScanCommandId
(
savedId
);
return
result
;
}
src/backend/executor/spi.c
0 → 100644
View file @
0d0254d1
This diff is collapsed.
Click to expand it.
src/include/executor/spi.h
0 → 100644
View file @
0d0254d1
/*-------------------------------------------------------------------------
*
* spi.h--
*
*
*-------------------------------------------------------------------------
*/
#ifndef SPI_H
#define SPI_H
#include <string.h>
#include "postgres.h"
#include "nodes/primnodes.h"
#include "nodes/relation.h"
#include "nodes/execnodes.h"
#include "nodes/plannodes.h"
#include "catalog/pg_proc.h"
#include "parser/parse_query.h"
#include "tcop/pquery.h"
#include "tcop/tcopprot.h"
#include "tcop/utility.h"
#include "tcop/dest.h"
#include "nodes/params.h"
#include "utils/fcache.h"
#include "utils/datum.h"
#include "utils/elog.h"
#include "utils/palloc.h"
#include "utils/syscache.h"
#include "utils/mcxt.h"
#include "utils/portal.h"
#include "catalog/pg_language.h"
#include "access/heapam.h"
#include "access/xact.h"
#include "executor/executor.h"
#include "executor/execdefs.h"
typedef
struct
{
uint32
alloced
;
/* # of alloced vals */
uint32
free
;
/* # of free vals */
TupleDesc
tupdesc
;
/* tuple descriptor */
HeapTuple
*
vals
;
/* tuples */
}
SPITupleTable
;
#define SPI_ERROR_CONNECT -1
#define SPI_ERROR_COPY -2
#define SPI_ERROR_OPUNKNOWN -3
#define SPI_ERROR_UNCONNECTED -4
#define SPI_ERROR_CURSOR -5
#define SPI_ERROR_TRANSACTION -6
#define SPI_OK_CONNECT 0
#define SPI_OK_FINISH 1
#define SPI_OK_FETCH 2
#define SPI_OK_UTILITY 3
#define SPI_OK_SELECT 4
#define SPI_OK_SELINTO 5
#define SPI_OK_INSERT 6
#define SPI_OK_DELETE 7
#define SPI_OK_UPDATE 8
#define SPI_OK_CURSOR 9
extern
uint32
SPI_processed
;
extern
SPITupleTable
*
SPI_tuptable
;
extern
int
SPI_connect
(
void
);
extern
int
SPI_finish
(
void
);
extern
int
SPI_exec
(
char
*
src
);
#endif
/* SPI_H */
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