Skip to content

Commit

Permalink
review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-tomczak committed Sep 25, 2023
1 parent 4b75ccc commit ffc5a27
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/sqlpp11/mysql/detail/connection_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,18 @@ namespace sqlpp
throw sqlpp::exception{"MySQL: could not init mysql data structure"};
}

#if MYSQL_VERSION_ID < 80034
if (config->auto_reconnect)
{
my_bool my_true{true};
if (mysql_options(native_handle(), MYSQL_OPT_RECONNECT, &my_true))
{
throw sqlpp::exception{"MySQL: could not set option MYSQL_OPT_RECONNECT"};
}
}
#else
mysql->reconnect = config->auto_reconnect
#endif

connect(native_handle(), *config);
}
Expand Down

0 comments on commit ffc5a27

Please sign in to comment.