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 @@ -21,6 +21,10 @@ PHP NEWS
21
21
. Add missing filter cleanups on phar failure. (nielsdos)
22
22
. Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
23
23
24
+ - PGSQL:
25
+ . Fix warning not being emitted when failure to cancel a query with
26
+ pg_cancel_query(). (Girgias)
27
+
24
28
- Readline:
25
29
. Fix memory leak when calloc() fails in php_readline_completion_cb().
26
30
(nielsdos)
Original file line number Diff line number Diff line change @@ -3843,8 +3843,14 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
3843
3843
int rc ;
3844
3844
3845
3845
c = PQgetCancel (pgsql );
3846
+ /* PQcancel
3847
+ * The return value of PQcancel is 1 if the cancel request was successfully dispatched and 0 if not.
3848
+ * If not, errbuf is filled with an explanatory error message.
3849
+ * errbuf must be a char array of size errbufsize (the recommended size is 256 bytes).
3850
+ * https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQCANCEL
3851
+ */
3846
3852
RETVAL_LONG ((rc = PQcancel (c , err , sizeof (err ))));
3847
- if (rc < 0 ) {
3853
+ if (rc == 0 ) {
3848
3854
zend_error (E_WARNING , "cannot cancel the query: %s" , err );
3849
3855
}
3850
3856
while ((pgsql_result = PQgetResult (pgsql ))) {
You can’t perform that action at this time.
0 commit comments