Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Update table_mysql.c
Browse files Browse the repository at this point in the history
use mysql_stmt_errno() as reconn condition if mysql_stmt_execute() fails in fetch
  • Loading branch information
poolpOrg authored Apr 18, 2020
1 parent c128519 commit 320447a
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 @@ -521,9 +521,7 @@ table_mysql_fetch(int service, struct dict *params, char *dst, size_t sz)
goto fetch;

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

0 comments on commit 320447a

Please sign in to comment.