diff --git a/src/shared/Database/DatabaseMysql.cpp b/src/shared/Database/DatabaseMysql.cpp index 84c211c..e100635 100644 --- a/src/shared/Database/DatabaseMysql.cpp +++ b/src/shared/Database/DatabaseMysql.cpp @@ -165,6 +165,22 @@ bool DatabaseMysql::Initialize(const char *infoString) PExecute("SET NAMES `utf8`"); PExecute("SET CHARACTER SET `utf8`"); +#if MYSQL_VERSION_ID >= 50003 +// #if MYSQL_VERSIOB_ID >= 50013 + my_bool my_true = (my_bool)1; + if (mysql_options(mMysql, MYSQL_OPT_RECONNECT, &my_true)) + { + sLog.outDetail("Failed to turn on MYSQL_OPT_RECONNECT."); + } + else + { + sLog.outDetail("Successfully turned on MYSQL_OPT_RECONNECT."); + } +#else + sLog.outDetail("Your mySQL client lib version does not support reconnecting after a timeout."); + sLog.outDetail("If this causes you any trouble we advice you to upgrade"); + sLog.outDetail("your mySQL client libs to at least mySQL 5.0.13 to resolve this problem."); +#endif return true; } else