- Fixed bug #48227 (NumberFormatter::format leaks memory). (Felipe)
- Fixed bug #48200 (compile failure with mbstring.c when
--enable-zend-multibyte is used). (Jani)
+- Fixed bug #48188 (Cannot execute a scrollable cursors twice with
+ PDO_PGSQL). (Matteo)
07 May 2009, PHP 5.3.0 RC 2
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);
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);
$res->execute(array("it's working"));
var_dump($res->fetch(PDO::FETCH_NUM));
+
+// Test bug #48188, trying to execute again
+$res->execute(array("try again"));
+var_dump($res->fetchColumn());
+var_dump($res->fetchColumn());
+
?>
--EXPECT--
string(4) "row1"
[0]=>
string(12) "it's working"
}
+string(9) "try again"
+bool(false)