Revert threadsafe mysql connection. It does not appear to work
This commit is contained in:
parent
b0bf24ee6e
commit
0f6eb9a6a6
1 changed files with 8 additions and 3 deletions
11
database.c
11
database.c
|
@ -128,7 +128,6 @@ STATUS database_init(void)
|
|||
{
|
||||
configuration *conf = get_modifiable_conf();
|
||||
GError *error = NULL;
|
||||
dbi_inst dbi_instance = 0;
|
||||
|
||||
conf->database_host = g_key_file_get_string(conf->keyfile, "database",
|
||||
"host", &error);
|
||||
|
@ -168,8 +167,14 @@ STATUS database_init(void)
|
|||
DEBUG(1, "Setting properties to %s database %s at %s as user %s", conf->database_driver,
|
||||
conf->database_name, conf->database_host, conf->database_username);
|
||||
|
||||
dbi_initialize_r(NULL, &dbi_instance);
|
||||
conn = dbi_conn_new_r(conf->database_driver, &dbi_instance);
|
||||
if (dbi_initialize(NULL) < 1) {
|
||||
DEBUG(0, "Failed to init database instance.");
|
||||
}
|
||||
conn = dbi_conn_new(conf->database_driver);
|
||||
if (conn == NULL) {
|
||||
DEBUG(0, "Failed to open database.");
|
||||
}
|
||||
|
||||
dbi_conn_set_option(conn, "host", conf->database_host);
|
||||
dbi_conn_set_option(conn, "username", conf->database_username);
|
||||
dbi_conn_set_option(conn, "password", conf->database_password);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue