Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
infoserver
jabberd
0001-Fix-build-errors-with-MariaDB-10.2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-build-errors-with-MariaDB-10.2.patch of Package jabberd
From f955d005cee682afbfd3b004a796918804496d80 Mon Sep 17 00:00:00 2001 From: Adrian Reber <adrian@lisas.de> Date: Wed, 12 Jul 2017 11:46:17 +0200 Subject: [PATCH] Fix build errors with MariaDB 10.2 Signed-off-by: Adrian Reber <adrian@lisas.de> --- storage/authreg_mysql.c | 6 +++--- storage/storage_mysql.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/authreg_mysql.c b/storage/authreg_mysql.c index be7aaf6..0b35d6d 100644 --- a/storage/authreg_mysql.c +++ b/storage/authreg_mysql.c @@ -487,6 +487,8 @@ DLLEXPORT int ar_init(authreg_t ar) { MYSQL *conn; mysqlcontext_t mysqlcontext; int fail = 0; + /* enable reconnect */ + my_bool reconnect= 1; /* configure the database context with field names and SQL statements */ mysqlcontext = (mysqlcontext_t) malloc( sizeof( struct mysqlcontext_st ) ); @@ -618,6 +620,7 @@ DLLEXPORT int ar_init(authreg_t ar) { mysql_options(conn, MYSQL_READ_DEFAULT_GROUP, "jabberd"); mysql_options(conn, MYSQL_SET_CHARSET_NAME, "utf8"); + mysql_options(conn, MYSQL_OPT_RECONNECT, (void *)&reconnect); /* connect with CLIENT_INTERACTIVE to get a (possibly) higher timeout value than default */ if(mysql_real_connect(conn, host, user, pass, dbname, atoi(port), NULL, CLIENT_INTERACTIVE) == NULL) { @@ -627,9 +630,6 @@ DLLEXPORT int ar_init(authreg_t ar) { mysql_query(conn, "SET NAMES 'utf8'"); - /* Set reconnect flag to 1 (set to 0 by default from mysql 5 on) */ - conn->reconnect = 1; - ar->user_exists = _ar_mysql_user_exists; if (MPC_PLAIN == mysqlcontext->password_type) { /* only possible with plaintext passwords */ diff --git a/storage/storage_mysql.c b/storage/storage_mysql.c index 2355b17..eb4f62f 100644 --- a/storage/storage_mysql.c +++ b/storage/storage_mysql.c @@ -584,6 +584,8 @@ DLLEXPORT st_ret_t st_init(st_driver_t drv) { const char *host, *port, *dbname, *user, *pass; MYSQL *conn; drvdata_t data; + /* enable reconnect */ + my_bool reconnect= 1; host = config_get_one(drv->st->config, "storage.mysql.host", 0); port = config_get_one(drv->st->config, "storage.mysql.port", 0); @@ -604,6 +606,7 @@ DLLEXPORT st_ret_t st_init(st_driver_t drv) { mysql_options(conn, MYSQL_READ_DEFAULT_GROUP, "jabberd"); mysql_options(conn, MYSQL_SET_CHARSET_NAME, "utf8"); + mysql_options(conn, MYSQL_OPT_RECONNECT, (void *)&reconnect); /* connect with CLIENT_INTERACTIVE to get a (possibly) higher timeout value than default */ if(mysql_real_connect(conn, host, user, pass, dbname, atoi(port), NULL, CLIENT_INTERACTIVE) == NULL) { @@ -612,9 +615,6 @@ DLLEXPORT st_ret_t st_init(st_driver_t drv) { return st_FAILED; } - /* Set reconnect flag to 1 (set to 0 by default from mysql 5 on) */ - conn->reconnect = 1; - data = (drvdata_t) calloc(1, sizeof(struct drvdata_st)); data->conn = conn; -- 2.13.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor