From 4808eebbb31abb26e61bd07831bbcefa43d02a47 Mon Sep 17 00:00:00 2001 From: Prathamesh Hukkeri Date: Sun, 12 Jul 2026 20:35:49 +0530 Subject: [PATCH] fix: use single quotes in SQL query to support ANSI_QUOTES mode The SQL query in HeatWaveCheckTask.on_connected() used double quotes for string literals, which causes Error 1054 when ANSI_QUOTES is enabled in sql_mode. Changed to single quotes which work in all sql_mode settings. Also fixed a secondary TypeError in DbSession.terminate_thread() where _message_callback was called with 2 arguments but on_session_message expects 3 positional arguments. Added None as the result parameter. Closes #88 --- .../gui_plugin/core/dbms/DbMySQLSessionSetupTasks.py | 6 +++--- gui/backend/gui_plugin/core/dbms/DbSession.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/backend/gui_plugin/core/dbms/DbMySQLSessionSetupTasks.py b/gui/backend/gui_plugin/core/dbms/DbMySQLSessionSetupTasks.py index 81ab28be..2ae88c88 100644 --- a/gui/backend/gui_plugin/core/dbms/DbMySQLSessionSetupTasks.py +++ b/gui/backend/gui_plugin/core/dbms/DbMySQLSessionSetupTasks.py @@ -93,9 +93,9 @@ def on_connected(self): result = self.execute(""" SELECT ROUTINE_NAME FROM information_schema.routines - WHERE ROUTINE_SCHEMA="sys" - AND ROUTINE_NAME="mle_explain_error" - AND ROUTINE_TYPE="PROCEDURE" + WHERE ROUTINE_SCHEMA='sys' + AND ROUTINE_NAME='mle_explain_error' + AND ROUTINE_TYPE='PROCEDURE' """).fetch_all() self.define_data(common.MySQLData.HAS_EXPLAIN_ERROR, len(result) > 0) diff --git a/gui/backend/gui_plugin/core/dbms/DbSession.py b/gui/backend/gui_plugin/core/dbms/DbSession.py index 376cec75..a972a41f 100644 --- a/gui/backend/gui_plugin/core/dbms/DbSession.py +++ b/gui/backend/gui_plugin/core/dbms/DbSession.py @@ -251,7 +251,7 @@ def terminate_thread(self): self._close_database(True) if self.thread_error is not None: logger.error(f"Thread {self._id} exiting with code {self.thread_error}") - self._message_callback("ERROR", self.thread_error) + self._message_callback("ERROR", self.thread_error, None) self._term_complete.set() def execute_thread(self, sql, params, options=None):