Skip to content

Commit

Permalink
fix mysql disconnect on error
Browse files Browse the repository at this point in the history
  • Loading branch information
poolpOrg committed Apr 6, 2020
1 parent fc62023 commit c128519
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions extras/tables/table-mysql/table_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ table_mysql_query(const char *key, int service)
}

if (mysql_stmt_execute(stmt)) {
if (mysql_stmt_errno(stmt) == CR_SERVER_LOST ||
mysql_stmt_errno(stmt) == CR_SERVER_GONE_ERROR ||
mysql_stmt_errno(stmt) == CR_COMMANDS_OUT_OF_SYNC) {
if (mysql_stmt_errno(stmt)) {
log_warnx("warn: trying to reconnect after error: %s", mysql_stmt_error(stmt));
if (config_connect(config))
goto retry;
Expand Down

2 comments on commit c128519

@apexo
Copy link

@apexo apexo commented on c128519 Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also be fixed in table_mysql_fetch().

@poolpOrg
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it was fixed and I rolled a new release, thanks !

Please sign in to comment.