diff options
author | Gilles Chehade <gilles@poolp.org> | 2020-04-18 10:43:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 10:43:50 +0200 |
commit | 320447adbbba6fadad98761088eb63b0a04e1f0a (patch) | |
tree | 2989d64f9cd0b4d0a2ab5215ce467812ffdcd6b0 | |
parent | fix mysql disconnect on error (diff) | |
download | OpenSMTPD-extras-320447adbbba6fadad98761088eb63b0a04e1f0a.tar.xz OpenSMTPD-extras-320447adbbba6fadad98761088eb63b0a04e1f0a.zip |
Update table_mysql.c6.7.1
use mysql_stmt_errno() as reconn condition if mysql_stmt_execute() fails in fetch
-rw-r--r-- | extras/tables/table-mysql/table_mysql.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/extras/tables/table-mysql/table_mysql.c b/extras/tables/table-mysql/table_mysql.c index 010f19e..79f3383 100644 --- a/extras/tables/table-mysql/table_mysql.c +++ b/extras/tables/table-mysql/table_mysql.c @@ -521,9 +521,7 @@ retry: 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; |