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)