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
2121  . Add missing filter cleanups on phar failure. (nielsdos)
2222  . Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
2323
24+ - PGSQL:
25+   . Fix warning not being emitted when failure to cancel a query with
26+     pg_cancel_query(). (Girgias)
27+ 
2428- Readline:
2529  . Fix memory leak when calloc() fails in php_readline_completion_cb().
2630    (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)
38433843			int  rc ;
38443844
38453845			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+ 			 */ 
38463852			RETVAL_LONG ((rc  =  PQcancel (c , err , sizeof (err ))));
3847- 			if  (rc  <  0 ) {
3853+ 			if  (rc  ==  0 ) {
38483854				zend_error (E_WARNING , "cannot cancel the query: %s" , err );
38493855			}
38503856			while  ((pgsql_result  =  PQgetResult (pgsql ))) {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments