File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -589,15 +589,18 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
589589 PGG (num_links )++ ;
590590 PGG (num_persistent )++ ;
591591 } else { /* we do */
592- if ((connect_type & PGSQL_CONNECT_FORCE_NEW )) {
593- if (zend_hash_del (& EG (persistent_list ), str .s ) != SUCCESS ) {
594- goto err ;
595- }
596- goto newpconn ;
597- }
598592 if (le -> type != le_plink ) {
599593 goto err ;
600594 }
595+ if ((connect_type & PGSQL_CONNECT_FORCE_NEW )) {
596+ PGresult * res ;
597+ pgsql = (PGconn * ) le -> ptr ;
598+ PQfinish (pgsql );
599+ PGG (num_links )-- ;
600+ PGG (num_persistent )-- ;
601+ le -> ptr = NULL ;
602+ goto newpconn ;
603+ }
601604 /* ensure that the link did not die */
602605 if (PGG (auto_reset_persistent ) & 1 ) {
603606 /* need to send & get something from backend to
You can’t perform that action at this time.
0 commit comments