From 2313d491fca21e61a3d7df56c4a4fd08d00f2096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 16 Oct 2019 23:58:36 +1100 Subject: [PATCH] If a connection is reset, assume autocommit=1 --- lib/mysql_connection.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index ab6025371..2301bb8c2 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -1789,6 +1789,13 @@ bool MySQL_Connection::IsAutoCommit() { // we assume that what we sent last is correct . #873 ret = false; } + } else { + if (options.last_set_autocommit==-1) { + // if a connection was reset (thus last_set_autocommit==-1) + // the information related to SERVER_STATUS_AUTOCOMMIT is lost + // therefore we fall back on the safe assumption that autocommit==1 + ret = true; + } } } return ret;