File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -3470,12 +3470,22 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
3470
3470
PQconsumeInput (pgsql );
3471
3471
RETVAL_LONG (PQisBusy (pgsql ));
3472
3472
break ;
3473
- case PHP_PG_ASYNC_REQUEST_CANCEL :
3474
- RETVAL_LONG (PQrequestCancel (pgsql ));
3473
+ case PHP_PG_ASYNC_REQUEST_CANCEL : {
3474
+ PGcancel * c ;
3475
+ char err [256 ];
3476
+ int rc ;
3477
+
3478
+ c = PQgetCancel (pgsql );
3479
+ RETVAL_LONG ((rc = PQcancel (c , err , sizeof (err ))));
3480
+ if (rc < 0 ) {
3481
+ zend_error (E_WARNING , "cannot cancel the query: %s" , err );
3482
+ }
3475
3483
while ((pgsql_result = PQgetResult (pgsql ))) {
3476
3484
PQclear (pgsql_result );
3477
3485
}
3486
+ PQfreeCancel (c );
3478
3487
break ;
3488
+ }
3479
3489
EMPTY_SWITCH_DEFAULT_CASE ()
3480
3490
}
3481
3491
if (PQsetnonblocking (pgsql , 0 )) {
You can’t perform that action at this time.
0 commit comments