Skip to content
Snippets Groups Projects
Commit c2d181c5 authored by Sergei Golovan's avatar Sergei Golovan
Browse files

Fix FTBFS with libmariadb 10.3.

parent fe99f24a
No related branches found
No related tags found
No related merge requests found
jabberd2 (2.6.1-4) unstable; urgency=medium
* Team upload.
* Fix FTBFS with libmariadb 10.3. Closes: #917758.
-- Sergei Golovan <sgolovan@debian.org> Tue, 29 Jan 2019 00:41:56 +0300
jabberd2 (2.6.1-3) unstable; urgency=medium
* Update Vcs-Browser and Vcs-Git URLs to salsa.
......
Author: Sergei Golovan <sgolovan@debian.org>
Description: Patch fixes FTBFS with libmariadb 10.3 by using
proper call to mysql_options() instead of using an internal structure
which has been changed between 10.1 and 10.3.
The code is taken from the MySQL docs:
https://dev.mysql.com/doc/refman/5.7/en/c-api-auto-reconnect.html
Last-Modified: Tue, 29 Jan 2019 00:39:39 +0300
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917758
Bug: https://github.com/jabberd2/jabberd2/issues/193
--- a/storage/authreg_mysql.c
+++ b/storage/authreg_mysql.c
@@ -487,6 +487,7 @@
MYSQL *conn;
mysqlcontext_t mysqlcontext;
int fail = 0;
+ my_bool reconnect = 1;
/* configure the database context with field names and SQL statements */
mysqlcontext = (mysqlcontext_t) malloc( sizeof( struct mysqlcontext_st ) );
@@ -628,7 +629,7 @@
mysql_query(conn, "SET NAMES 'utf8'");
/* Set reconnect flag to 1 (set to 0 by default from mysql 5 on) */
- conn->reconnect = 1;
+ mysql_options(conn, MYSQL_OPT_RECONNECT, &reconnect);
ar->user_exists = _ar_mysql_user_exists;
if (MPC_PLAIN == mysqlcontext->password_type) {
--- a/storage/storage_mysql.c
+++ b/storage/storage_mysql.c
@@ -584,6 +584,7 @@
const char *host, *port, *dbname, *user, *pass;
MYSQL *conn;
drvdata_t data;
+ 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);
@@ -613,7 +614,7 @@
}
/* Set reconnect flag to 1 (set to 0 by default from mysql 5 on) */
- conn->reconnect = 1;
+ mysql_options(conn, MYSQL_OPT_RECONNECT, &reconnect);
data = (drvdata_t) calloc(1, sizeof(struct drvdata_st));
......@@ -8,3 +8,4 @@ systemd-alias.diff
systemd-bindsto.diff
m4-ax_check_compile_flag.diff
openssl11.diff
mariadb10.3.diff
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment