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
fd3ad7d7
Commit
fd3ad7d7
authored
Sep 12, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to call utility funcs without SPI_connect.
parent
7f97e05b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
47 deletions
+5
-47
src/backend/executor/spi.c
src/backend/executor/spi.c
+5
-47
No files found.
src/backend/executor/spi.c
View file @
fd3ad7d7
...
...
@@ -48,7 +48,7 @@ static void _SPI_fetch(FetchStmt * stmt);
#endif
static
int
_SPI_execute_plan
(
_SPI_plan
*
plan
,
char
*
*
Values
,
char
*
Nulls
,
int
tcount
);
Datum
*
Values
,
char
*
Nulls
,
int
tcount
);
#define _SPI_CPLAN_CURCXT 0
#define _SPI_CPLAN_PROCXT 1
...
...
@@ -199,7 +199,7 @@ SPI_exec(char *src, int tcount)
}
int
SPI_execp
(
void
*
plan
,
char
*
*
Values
,
char
*
Nulls
,
int
tcount
)
SPI_execp
(
void
*
plan
,
Datum
*
Values
,
char
*
Nulls
,
int
tcount
)
{
int
res
;
...
...
@@ -282,10 +282,7 @@ int
SPI_fnumber
(
TupleDesc
tupdesc
,
char
*
fname
)
{
int
res
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
return
(
SPI_ERROR_UNCONNECTED
);
for
(
res
=
0
;
res
<
tupdesc
->
natts
;
res
++
)
{
if
(
strcasecmp
(
tupdesc
->
attrs
[
res
]
->
attname
.
data
,
fname
)
==
0
)
...
...
@@ -300,12 +297,6 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
{
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tupdesc
->
natts
<
fnumber
||
fnumber
<=
0
)
{
SPI_result
=
SPI_ERROR_NOATTRIBUTE
;
...
...
@@ -313,7 +304,6 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
}
return
(
nameout
(
&
(
tupdesc
->
attrs
[
fnumber
-
1
]
->
attname
)));
}
char
*
...
...
@@ -324,12 +314,6 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
Oid
foutoid
;
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tuple
->
t_natts
<
fnumber
||
fnumber
<=
0
)
return
(
NULL
);
...
...
@@ -353,12 +337,6 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
*
isnull
=
true
;
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tuple
->
t_natts
<
fnumber
||
fnumber
<=
0
)
return
(
NULL
);
...
...
@@ -373,12 +351,6 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
HeapTuple
typeTuple
;
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
if
(
tupdesc
->
natts
<
fnumber
||
fnumber
<=
0
)
{
SPI_result
=
SPI_ERROR_NOATTRIBUTE
;
...
...
@@ -403,12 +375,6 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
{
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
InvalidOid
);
}
if
(
tupdesc
->
natts
<
fnumber
||
fnumber
<=
0
)
{
SPI_result
=
SPI_ERROR_NOATTRIBUTE
;
...
...
@@ -421,14 +387,6 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
char
*
SPI_getrelname
(
Relation
rel
)
{
SPI_result
=
0
;
if
(
_SPI_curid
+
1
!=
_SPI_connected
)
{
SPI_result
=
SPI_ERROR_UNCONNECTED
;
return
(
NULL
);
}
return
(
pstrdup
(
rel
->
rd_rel
->
relname
.
data
));
}
...
...
@@ -581,7 +539,7 @@ _SPI_execute(char *src, int tcount, _SPI_plan * plan)
}
static
int
_SPI_execute_plan
(
_SPI_plan
*
plan
,
char
*
*
Values
,
char
*
Nulls
,
int
tcount
)
_SPI_execute_plan
(
_SPI_plan
*
plan
,
Datum
*
Values
,
char
*
Nulls
,
int
tcount
)
{
QueryTreeList
*
queryTree_list
=
plan
->
qtlist
;
List
*
planTree_list
=
plan
->
ptlist
;
...
...
@@ -634,7 +592,7 @@ _SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
paramLI
->
kind
=
PARAM_NUM
;
paramLI
->
id
=
k
+
1
;
paramLI
->
isnull
=
(
Nulls
!=
NULL
&&
Nulls
[
k
]
!=
'n'
);
paramLI
->
value
=
(
Datum
)
Values
[
k
];
paramLI
->
value
=
Values
[
k
];
}
paramLI
->
kind
=
PARAM_INVALID
;
}
...
...
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