2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-05 08:25:16 +00:00

[2342] Corrections based on first part for third section of review.

This commit is contained in:
Stephen Morris
2012-10-24 21:18:13 +01:00
parent 08daa03bea
commit df141d203e
5 changed files with 116 additions and 67 deletions

View File

@@ -475,6 +475,15 @@ MySqlLeaseMgr::openDatabase() {
isc_throw(NoDatabaseName, "must specified a name for the database");
}
// Set options for the connection:
// - automatic reconnection
my_bool auto_reconnect = 1;
int result = mysql_options(mysql_, MYSQL_OPT_RECONNECT, &auto_reconnect);
if (result != 0) {
isc_throw(DbOpenError, "unable to set auto-reconnect option: " <<
mysql_error(mysql_));
}
// Open the database. Use defaults for non-specified options.
MYSQL* status = mysql_real_connect(mysql_, host, user, password, name,
0, NULL, 0);