forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
up to postgresql 17, when done with a prepared statement, we could release it with DEALLOCATE sql command which is fine ; until we want to implement a cache solution based on statement ids. Since PostgreSQL 17, PQclosePrepared uses internally the `close` protocol allowing to reuse the statement name while still freeing it. Since the close protocol implementation had been added on libpq within this release, no way to reimplement it. close phpGH-14584
- Loading branch information
Showing
7 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
PostgreSQL pg_close_stmt | ||
--EXTENSIONS-- | ||
pgsql | ||
--SKIPIF-- | ||
<?php include("inc/skipif.inc"); | ||
if (!function_exists("pg_close_stmt")) die("skip pg_close_stmt unsupported"); | ||
?> | ||
--FILE-- | ||
<?php | ||
include('inc/config.inc'); | ||
|
||
|
||
$query = 'SELECT $1::text IS NULL;'; | ||
$params_null = [null]; | ||
|
||
$db = pg_connect($conn_str); | ||
$res = pg_prepare($db, 'test', $query); | ||
|
||
$res = pg_execute($db, 'test', $params_null); | ||
$res = pg_close_stmt($db, 'test'); | ||
var_dump($res !== false); | ||
var_dump(pg_result_status($res) === PGSQL_COMMAND_OK); | ||
pg_prepare($db, 'test', $query); | ||
$res = pg_execute($db, 'test', $params_null); | ||
pg_free_result($res); | ||
|
||
pg_close($db); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) |