File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ PHP NEWS
12
12
. Add missing filter cleanups on phar failure. (nielsdos)
13
13
. Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
14
14
15
+ - PGSQL:
16
+ . Fix warning not being emitted when failure to cancel a query with
17
+ pg_cancel_query(). (Girgias)
18
+
15
19
- Readline:
16
20
. Fix memory leak when calloc() fails in php_readline_completion_cb().
17
21
(nielsdos)
Original file line number Diff line number Diff line change @@ -3576,8 +3576,14 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
3576
3576
int rc ;
3577
3577
3578
3578
c = PQgetCancel (pgsql );
3579
+ /* PQcancel
3580
+ * The return value of PQcancel is 1 if the cancel request was successfully dispatched and 0 if not.
3581
+ * If not, errbuf is filled with an explanatory error message.
3582
+ * errbuf must be a char array of size errbufsize (the recommended size is 256 bytes).
3583
+ * https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQCANCEL
3584
+ */
3579
3585
RETVAL_LONG ((rc = PQcancel (c , err , sizeof (err ))));
3580
- if (rc < 0 ) {
3586
+ if (rc == 0 ) {
3581
3587
zend_error (E_WARNING , "cannot cancel the query: %s" , err );
3582
3588
}
3583
3589
while ((pgsql_result = PQgetResult (pgsql ))) {
You can’t perform that action at this time.
0 commit comments