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
1212  . Add missing filter cleanups on phar failure. (nielsdos)
1313  . Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
1414
15+ - PGSQL:
16+   . Fix warning not being emitted when failure to cancel a query with
17+     pg_cancel_query(). (Girgias)
18+ 
1519- Readline:
1620  . Fix memory leak when calloc() fails in php_readline_completion_cb().
1721    (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)
35763576			int  rc ;
35773577
35783578			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+ 			 */ 
35793585			RETVAL_LONG ((rc  =  PQcancel (c , err , sizeof (err ))));
3580- 			if  (rc  <  0 ) {
3586+ 			if  (rc  ==  0 ) {
35813587				zend_error (E_WARNING , "cannot cancel the query: %s" , err );
35823588			}
35833589			while  ((pgsql_result  =  PQgetResult (pgsql ))) {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments