aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-04-02 20:16:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-04-02 20:16:30 +0000
commit735cb9692d220a009c90deb8f29176bf9b54c75b (patch)
tree483c8e9ff75c77586c794575b0a86a5f07341450 /src
parent3b07182e613a0e63ff662e3dc7f820f010923ec7 (diff)
downloadpostgresql-735cb9692d220a009c90deb8f29176bf9b54c75b.tar.gz
postgresql-735cb9692d220a009c90deb8f29176bf9b54c75b.zip
Minor code beautification/consolidation.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpgsql/src/pl_exec.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 588c2fe63b0..6a6f3580d61 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.238 2009/04/02 19:20:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.239 2009/04/02 20:16:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3284,7 +3284,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
SPITupleTable *tuptab;
Portal portal;
char *curname;
- int n;
+ uint32 n;
/* ----------
* Get the portal of the cursor by name
@@ -3342,19 +3342,13 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
n = SPI_processed;
/* ----------
- * Set the target and the global FOUND variable appropriately.
+ * Set the target appropriately.
* ----------
*/
if (n == 0)
- {
exec_move_row(estate, rec, row, NULL, tuptab->tupdesc);
- exec_set_found(estate, false);
- }
else
- {
exec_move_row(estate, rec, row, tuptab->vals[0], tuptab->tupdesc);
- exec_set_found(estate, true);
- }
SPI_freetuptable(tuptab);
}
@@ -3363,12 +3357,11 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
/* Move the cursor */
SPI_scroll_cursor_move(portal, stmt->direction, how_many);
n = SPI_processed;
-
- /* Set the global FOUND variable appropriately. */
- exec_set_found(estate, n != 0);
}
+ /* Set the ROW_COUNT and the global FOUND variable appropriately. */
estate->eval_processed = n;
+ exec_set_found(estate, n != 0);
return PLPGSQL_RC_OK;
}