implemented amb690

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401267
This commit is contained in:
David Anderson 2007-08-03 11:50:20 +00:00
parent ccaa7c95f2
commit b79f1f6df3

View File

@ -101,6 +101,12 @@ MYSQL *Connect(const DatabaseInfo *info, char *error, size_t maxlength)
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&(info->maxTimeout));
}
/* Have MySQL automatically reconnect if it times out or loses connection.
* This will prevent "MySQL server has gone away" errors after a while.
*/
my_bool my_true = true;
mysql_options(mysql, MYSQL_OPT_RECONNECT, (const char *)&my_true);
if (!mysql_real_connect(mysql,
info->host,
info->user,