8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.238 2009/04/0219: 20:45 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.239 2009/04/02 20:16:30 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -3284,7 +3284,7 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
3284
3284
SPITupleTable * tuptab ;
3285
3285
Portal portal ;
3286
3286
char * curname ;
3287
- int n ;
3287
+ uint32 n ;
3288
3288
3289
3289
/* ----------
3290
3290
* Get the portal of the cursor by name
@@ -3342,19 +3342,13 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
3342
3342
n = SPI_processed ;
3343
3343
3344
3344
/* ----------
3345
- * Set the targetand the global FOUND variable appropriately.
3345
+ * Set the target appropriately.
3346
3346
* ----------
3347
3347
*/
3348
3348
if (n == 0 )
3349
- {
3350
3349
exec_move_row (estate ,rec ,row ,NULL ,tuptab -> tupdesc );
3351
- exec_set_found (estate , false);
3352
- }
3353
3350
else
3354
- {
3355
3351
exec_move_row (estate ,rec ,row ,tuptab -> vals [0 ],tuptab -> tupdesc );
3356
- exec_set_found (estate , true);
3357
- }
3358
3352
3359
3353
SPI_freetuptable (tuptab );
3360
3354
}
@@ -3363,12 +3357,11 @@ exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
3363
3357
/* Move the cursor */
3364
3358
SPI_scroll_cursor_move (portal ,stmt -> direction ,how_many );
3365
3359
n = SPI_processed ;
3366
-
3367
- /* Set the global FOUND variable appropriately. */
3368
- exec_set_found (estate ,n != 0 );
3369
3360
}
3370
3361
3362
+ /* Set the ROW_COUNT and the global FOUND variable appropriately. */
3371
3363
estate -> eval_processed = n ;
3364
+ exec_set_found (estate ,n != 0 );
3372
3365
3373
3366
return PLPGSQL_RC_OK ;
3374
3367
}