File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646#include "db_cap.h"
4747#include "db_row.h"
4848#include "db_ps.h"
49+ #include "db_pool.h"
4950#include "../globals.h"
5051
5152extern stat_var * sql_total_queries ;
@@ -393,7 +394,7 @@ int db_bind_mod(const str* mod, db_func_t* dbf);
393394 * \return returns a pointer to the db_con_t representing the connection if it was
394395 successful, otherwise 0 is returned.
395396 */
396- db_con_t * db_do_init (const str * url , void * (* new_connection )());
397+ db_con_t * db_do_init (const str * url , void * (* new_connection )(const struct db_id * ));
397398
398399
399400/**
@@ -404,7 +405,7 @@ db_con_t* db_do_init(const str* url, void* (*new_connection)());
404405 * \param _h database connection handle
405406 * \param (*free_connection) Pointer to the db specifc free_connection method
406407 */
407- void db_do_close (db_con_t * _h , void (* free_connection )());
408+ void db_do_close (db_con_t * _h , void (* free_connection )(struct pool_con * ));
408409
409410
410411/**
Original file line number Diff line number Diff line change @@ -190,12 +190,13 @@ struct my_con* db_unixodbc_new_connection(struct db_id* id)
190190/*
191191 * Close the connection and release memory
192192 */
193- void db_unixodbc_free_connection (struct my_con * con )
193+ void db_unixodbc_free_connection (struct pool_con * con )
194194{
195- if (!con ) return ;
196- SQLFreeHandle (SQL_HANDLE_ENV , con -> env );
197- SQLDisconnect (con -> dbc );
198- SQLFreeHandle (SQL_HANDLE_DBC , con -> dbc );
195+ struct my_con * mcon = (struct my_con * )con ;
196+ if (!mcon ) return ;
197+ SQLFreeHandle (SQL_HANDLE_ENV , mcon -> env );
198+ SQLDisconnect (mcon -> dbc );
199+ SQLFreeHandle (SQL_HANDLE_DBC , mcon -> dbc );
199200 pkg_free (con );
200201}
201202
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ struct my_con* db_unixodbc_new_connection(struct db_id* id);
8686/*
8787 * Close the connection and release memory
8888 */
89- void db_unixodbc_free_connection (struct my_con * con );
89+ void db_unixodbc_free_connection (struct pool_con * con );
9090
9191char * db_unixodbc_build_conn_str (const struct db_id * id , char * buf );
9292
You can’t perform that action at this time.
0 commit comments