Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions db/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "db_cap.h"
#include "db_row.h"
#include "db_ps.h"
#include "db_pool.h"
#include "../globals.h"

extern stat_var *sql_total_queries;
Expand Down Expand Up @@ -407,7 +408,7 @@ int db_bind_mod(const str* mod, db_func_t* dbf);
* \return returns a pointer to the db_con_t representing the connection if it was
successful, otherwise 0 is returned.
*/
db_con_t* db_do_init(const str* url, void* (*new_connection)());
db_con_t* db_do_init(const str* url, void* (*new_connection)(const struct db_id *));


/**
Expand All @@ -418,7 +419,7 @@ db_con_t* db_do_init(const str* url, void* (*new_connection)());
* \param _h database connection handle
* \param (*free_connection) Pointer to the db specifc free_connection method
*/
void db_do_close(db_con_t* _h, void (*free_connection)());
void db_do_close(db_con_t* _h, void (*free_connection)(struct pool_con*));


/**
Expand Down
11 changes: 6 additions & 5 deletions modules/db_unixodbc/db_con.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ struct my_con* db_unixodbc_new_connection(struct db_id* id)
/*
* Close the connection and release memory
*/
void db_unixodbc_free_connection(struct my_con* con)
void db_unixodbc_free_connection(struct pool_con* con)
{
if (!con) return;
SQLFreeHandle(SQL_HANDLE_ENV, con->env);
SQLDisconnect(con->dbc);
SQLFreeHandle(SQL_HANDLE_DBC, con->dbc);
struct my_con* mcon = (struct my_con*)con;
if (!mcon) return;
SQLFreeHandle(SQL_HANDLE_ENV, mcon->env);
SQLDisconnect(mcon->dbc);
SQLFreeHandle(SQL_HANDLE_DBC, mcon->dbc);
pkg_free(con);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/db_unixodbc/db_con.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct my_con* db_unixodbc_new_connection(struct db_id* id);
/*
* Close the connection and release memory
*/
void db_unixodbc_free_connection(struct my_con* con);
void db_unixodbc_free_connection(struct pool_con* con);

char *db_unixodbc_build_conn_str(const struct db_id* id, char *buf);

Expand Down