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 ;
@@ -407,7 +408,7 @@ int db_bind_mod(const str* mod, db_func_t* dbf);
407408 * \return returns a pointer to the db_con_t representing the connection if it was
408409 successful, otherwise 0 is returned.
409410 */
410- db_con_t * db_do_init (const str * url , void * (* new_connection )());
411+ db_con_t * db_do_init (const str * url , void * (* new_connection )(const struct db_id * ));
411412
412413
413414/**
@@ -418,7 +419,7 @@ db_con_t* db_do_init(const str* url, void* (*new_connection)());
418419 * \param _h database connection handle
419420 * \param (*free_connection) Pointer to the db specifc free_connection method
420421 */
421- void db_do_close (db_con_t * _h , void (* free_connection )());
422+ void db_do_close (db_con_t * _h , void (* free_connection )(struct pool_con * ));
422423
423424
424425/**
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