From: František Dvořák Date: Thu, 13 Dec 2007 12:07:52 +0000 (+0000) Subject: Compilation fix, fixed MYSQL_OPT_RECONNECT option. X-Git-Tag: merge_313_3_dst~13 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=f77508b65cad5cf5814dbde6310c1dc79030ea13;p=jra1mw.git Compilation fix, fixed MYSQL_OPT_RECONNECT option. --- diff --git a/org.glite.lbjp-common.db/interface/db.h b/org.glite.lbjp-common.db/interface/db.h index d4967a2..0351d90 100644 --- a/org.glite.lbjp-common.db/interface/db.h +++ b/org.glite.lbjp-common.db/interface/db.h @@ -5,6 +5,7 @@ #include +#include #ifdef __cplusplus diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 214ee9d..9d9de63 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -915,7 +915,7 @@ static int db_connect(glite_lbu_DBContext ctx, const char *cs, MYSQL **mysql) { char *host,*user,*pw,*db; char *slash,*at,*colon; int ret; -#ifdef MYSQL_OPT_RECONNECT +#if MYSQL_VERSION_ID >= 50013 my_bool reconnect = 1; #endif @@ -927,7 +927,7 @@ static int db_connect(glite_lbu_DBContext ctx, const char *cs, MYSQL **mysql) { if (!(*mysql = db_handle.mysql_init(NULL))) return ERR(ctx, ENOMEM, NULL); db_handle.mysql_options(*mysql, MYSQL_READ_DEFAULT_FILE, "my"); -#ifdef MYSQL_OPT_RECONNECT +#if MYSQL_VERSION_ID >= 50013 /* XXX: may result in weird behaviour in the middle of transaction */ db_handle.mysql_options(*mysql, MYSQL_OPT_RECONNECT, &reconnect); #endif