File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3887,8 +3887,14 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
38873887 int rc ;
38883888
38893889 c = PQgetCancel (pgsql );
3890+ /* PQcancel
3891+ * The return value of PQcancel is 1 if the cancel request was successfully dispatched and 0 if not.
3892+ * If not, errbuf is filled with an explanatory error message.
3893+ * errbuf must be a char array of size errbufsize (the recommended size is 256 bytes).
3894+ * https://www.postgresql.org/docs/current/libpq-cancel.html#LIBPQ-PQCANCEL
3895+ */
38903896 RETVAL_LONG ((rc = PQcancel (c , err , sizeof (err ))));
3891- if (rc < 0 ) {
3897+ if (rc == 0 ) {
38923898 zend_error (E_WARNING , "cannot cancel the query: %s" , err );
38933899 }
38943900 while ((pgsql_result = PQgetResult (pgsql ))) {
You can’t perform that action at this time.
0 commit comments