mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- Fixed bug #48188
This commit is contained in:
parent
92288eca5c
commit
82151d4dc3
3 changed files with 19 additions and 1 deletions
|
@ -131,6 +131,13 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
|
|||
|
||||
if (S->cursor_name) {
|
||||
char *q = NULL;
|
||||
|
||||
if (S->is_prepared) {
|
||||
spprintf(&q, 0, "CLOSE %s", S->cursor_name);
|
||||
S->result = PQexec(H->server, q);
|
||||
efree(q);
|
||||
}
|
||||
|
||||
spprintf(&q, 0, "DECLARE %s SCROLL CURSOR WITH HOLD FOR %s", S->cursor_name, stmt->active_query_string);
|
||||
S->result = PQexec(H->server, q);
|
||||
efree(q);
|
||||
|
@ -142,6 +149,9 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* the cursor was declared correctly */
|
||||
S->is_prepared = 1;
|
||||
|
||||
/* fetch to be able to get the number of tuples later, but don't advance the cursor pointer */
|
||||
spprintf(&q, 0, "FETCH FORWARD 0 FROM %s", S->cursor_name);
|
||||
S->result = PQexec(H->server, q);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue