@@ -99,18 +99,18 @@ static void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode)
9999 if (S -> stmt_name && S -> is_prepared && (fin_mode & FIN_CLOSE )) {
100100 PGresult * res ;
101101#ifndef HAVE_PQCLOSEPREPARED
102- // TODO (??) libpq does not support close statement protocol < postgres 17
103- // check if we can circumvent this.
104- char * q = NULL ;
105- spprintf (& q , 0 , "DEALLOCATE %s" , S -> stmt_name );
106- res = PQexec (H -> server , q );
107- efree (q );
102+ // TODO (??) libpq does not support close statement protocol < postgres 17
103+ // check if we can circumvent this.
104+ char * q = NULL ;
105+ spprintf (& q , 0 , "DEALLOCATE %s" , S -> stmt_name );
106+ res = PQexec (H -> server , q );
107+ efree (q );
108108#else
109- res = PQclosePrepared (H -> server , S -> stmt_name );
109+ res = PQclosePrepared (H -> server , S -> stmt_name );
110110#endif
111- if (res ) {
112- PQclear (res );
113- }
111+ if (res ) {
112+ PQclear (res );
113+ }
114114
115115 S -> is_prepared = false;
116116 if (H -> running_stmt == S ) {
@@ -284,7 +284,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
284284 S -> param_formats ,
285285 0 );
286286 } else {
287- S -> result = PQexecPrepared (H -> server , S -> stmt_name ,
287+ S -> result = PQexecPrepared (H -> server , S -> stmt_name ,
288288 stmt -> bound_params ?
289289 zend_hash_num_elements (stmt -> bound_params ) :
290290 0 ,
@@ -304,7 +304,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
304304 S -> param_formats ,
305305 0 );
306306 } else {
307- S -> result = PQexecParams (H -> server , ZSTR_VAL (S -> query ),
307+ S -> result = PQexecParams (H -> server , ZSTR_VAL (S -> query ),
308308 stmt -> bound_params ? zend_hash_num_elements (stmt -> bound_params ) : 0 ,
309309 S -> param_types ,
310310 (const char * * )S -> param_values ,
@@ -317,7 +317,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
317317 if (S -> is_unbuffered ) {
318318 dispatch_result = PQsendQuery (H -> server , ZSTR_VAL (stmt -> active_query_string ));
319319 } else {
320- S -> result = PQexec (H -> server , ZSTR_VAL (stmt -> active_query_string ));
320+ S -> result = PQexec (H -> server , ZSTR_VAL (stmt -> active_query_string ));
321321 }
322322 }
323323
0 commit comments