mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: ext/pgsql: Fix warning not being emittedd when failure to cancel a query
This commit is contained in:
4
NEWS
4
NEWS
@@ -21,6 +21,10 @@ PHP NEWS
|
||||
. Add missing filter cleanups on phar failure. (nielsdos)
|
||||
. Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
|
||||
|
||||
- PGSQL:
|
||||
. Fix warning not being emitted when failure to cancel a query with
|
||||
pg_cancel_query(). (Girgias)
|
||||
|
||||
- Readline:
|
||||
. Fix memory leak when calloc() fails in php_readline_completion_cb().
|
||||
(nielsdos)
|
||||
|
||||
@@ -3843,8 +3843,14 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
|
||||
int rc;
|
||||
|
||||
c = PQgetCancel(pgsql);
|
||||
/* PQcancel
|
||||
* The return value of PQcancel is 1 if the cancel request was successfully dispatched and 0 if not.
|
||||
* If not, errbuf is filled with an explanatory error message.
|
||||
* errbuf must be a char array of size errbufsize (the recommended size is 256 bytes).
|
||||
* https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQCANCEL
|
||||
*/
|
||||
RETVAL_LONG((rc = PQcancel(c, err, sizeof(err))));
|
||||
if (rc < 0) {
|
||||
if (rc == 0) {
|
||||
zend_error(E_WARNING, "cannot cancel the query: %s", err);
|
||||
}
|
||||
while ((pgsql_result = PQgetResult(pgsql))) {
|
||||
|
||||
Reference in New Issue
Block a user