Skip to content

Commit

Permalink
Fixing #317 - MySQL Auto-Reconnect
Browse files Browse the repository at this point in the history
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
  • Loading branch information
TheWitness committed Sep 22, 2023
1 parent 429ebd0 commit aac1b49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
The Cacti Group | spine

1.2.26
-issue#317: WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.

1.2.25
-issue#234: Spine should see if script to be executed is executable
-issue#291: Enhance number recognition
Expand Down
5 changes: 4 additions & 1 deletion sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ void db_connect(int type, MYSQL *mysql) {
MYSQL_SET_OPTION(MYSQL_OPT_READ_TIMEOUT, (int *)&rtimeout, "read timeout");
MYSQL_SET_OPTION(MYSQL_OPT_WRITE_TIMEOUT, (int *)&wtimeout, "write timeout");
MYSQL_SET_OPTION(MYSQL_OPT_CONNECT_TIMEOUT, (int *)&timeout, "general timeout");
MYSQL_SET_OPTION(MYSQL_OPT_RECONNECT, &reconnect, "reconnect");

#if defined(MARIADB_BASE_VERSION) || (MYSQL_VERSION_ID < 80034 && MYSQL_VERSION_ID >= 50013)
MYSQL_SET_OPTION(MYSQL_OPT_RECONNECT, &reconnect, "reconnect");
#endif

#ifdef HAS_MYSQL_OPT_RETRY_COUNT
MYSQL_SET_OPTION(MYSQL_OPT_RETRY_COUNT, &tries, "retry count");
Expand Down

0 comments on commit aac1b49

Please sign in to comment.