From c26fbdf15f967eb1d0ade77353eed965e924a6d0 Mon Sep 17 00:00:00 2001 From: Erol Guven Date: Tue, 24 Jul 2018 23:11:33 -0400 Subject: [PATCH] ISSUE-36: Avoid using SHOW DATABASES for alive check MySQL 8.0 somehow starts a transaction when SHOW DATABASES is called. Inadvertantly starting a transaction prevents disabling LOG_BIN using SET SQL_LOG_BIN=0. Change the Server.is_alive() function to use SELECT 1 FROM DUAL instead. --- mysql/utilities/common/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/utilities/common/server.py b/mysql/utilities/common/server.py index 7d8ea80e..31449818 100755 --- a/mysql/utilities/common/server.py +++ b/mysql/utilities/common/server.py @@ -846,7 +846,7 @@ def is_alive(self): # to make sure connection is really alive retval = self.db_conn.is_connected() if retval: - self.exec_query("SHOW DATABASES") + self.exec_query("SELECT 1 FROM DUAL") else: res = False except: