From 3d3e11a97279408d386cad23a8610b3e336b1ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 13 Nov 2018 19:29:40 +0200 Subject: [PATCH] Minor tuning on previous commit --- lib/MySQL_Session.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 4e10873b2..7dad96a85 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2040,14 +2040,16 @@ bool MySQL_Session::handler_again___status_CHANGING_AUTOCOMMIT(int *_rc) { bool ac = autocommit; if (autocommit == false) { // also IsAutoCommit==false if (mysql_thread___enforce_autocommit_on_reads == false) { - if (mybe->server_myds->myconn->IsActiveTransaction() == false) { - if (CurrentQuery.is_select_NOT_for_update()==true) { - // client wants autocommit=0 - // enforce_autocommit_on_reads=false - // there is no transaction - // this seems to be the first query, and a SELECT not FOR UPDATE - // we will switch back to autcommit=1 - ac = true; + if (mybe->server_myds->myconn->IsAutoCommit() == false) { + if (mybe->server_myds->myconn->IsActiveTransaction() == false) { + if (CurrentQuery.is_select_NOT_for_update()==true) { + // client wants autocommit=0 + // enforce_autocommit_on_reads=false + // there is no transaction + // this seems to be the first query, and a SELECT not FOR UPDATE + // we will switch back to autcommit=1 + ac = true; + } } } }