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
332c6940
Commit
332c6940
authored
Aug 08, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix nasty little order-of-operations bug in _SPI_cursor_operation.
Per report from Mendola Gaetano.
parent
4ae02fd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/backend/executor/spi.c
src/backend/executor/spi.c
+17
-6
No files found.
src/backend/executor/spi.c
View file @
332c6940
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.10
1 2003/08/04 02:39:59 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.10
2 2003/08/08 19:18:21 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1263,6 +1263,8 @@ static void
...
@@ -1263,6 +1263,8 @@ static void
_SPI_cursor_operation
(
Portal
portal
,
bool
forward
,
int
count
,
_SPI_cursor_operation
(
Portal
portal
,
bool
forward
,
int
count
,
DestReceiver
*
dest
)
DestReceiver
*
dest
)
{
{
long
nfetched
;
/* Check that the portal is valid */
/* Check that the portal is valid */
if
(
!
PortalIsValid
(
portal
))
if
(
!
PortalIsValid
(
portal
))
elog
(
ERROR
,
"invalid portal in SPI cursor operation"
);
elog
(
ERROR
,
"invalid portal in SPI cursor operation"
);
...
@@ -1277,11 +1279,20 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
...
@@ -1277,11 +1279,20 @@ _SPI_cursor_operation(Portal portal, bool forward, int count,
_SPI_current
->
tuptable
=
NULL
;
_SPI_current
->
tuptable
=
NULL
;
/* Run the cursor */
/* Run the cursor */
_SPI_current
->
processed
=
nfetched
=
PortalRunFetch
(
portal
,
PortalRunFetch
(
portal
,
forward
?
FETCH_FORWARD
:
FETCH_BACKWARD
,
forward
?
FETCH_FORWARD
:
FETCH_BACKWARD
,
(
long
)
count
,
(
long
)
count
,
dest
);
dest
);
/*
* Think not to combine this store with the preceding function call.
* If the portal contains calls to functions that use SPI, then
* SPI_stack is likely to move around while the portal runs. When
* control returns, _SPI_current will point to the correct stack entry...
* but the pointer may be different than it was beforehand. So we must
* be sure to re-fetch the pointer after the function call completes.
*/
_SPI_current
->
processed
=
nfetched
;
if
(
dest
->
mydest
==
SPI
&&
_SPI_checktuples
())
if
(
dest
->
mydest
==
SPI
&&
_SPI_checktuples
())
elog
(
ERROR
,
"consistency check on SPI tuple count failed"
);
elog
(
ERROR
,
"consistency check on SPI tuple count failed"
);
...
...
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