Bug #121375 SQL editor hangs on "Starting editor session..." when server sql_mode includes ANSI_QUOTES
Submitted: 27 Sep 21:47 Modified: 28 Sep 16:29
Reporter: Eric Aizprúa Email Updates:
Status: Documenting Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:26.7.0 / 26.7.1 OS:Windows
Assigned to: CPU Architecture:Any

[27 Sep 21:47] Eric Aizprúa
Description:
Connecting to a MySQL 8.0 server (Azure Database for MySQL Flexible Server) whose
sql_mode includes ANSI_QUOTES leaves the editor stuck on "Starting editor session..."
indefinitely. The connection itself succeeds.

Two defects are involved:

1. The GUI plugin runs a query that uses double quotes for string literals, which
   fails under ANSI_QUOTES:

   SELECT ROUTINE_NAME FROM information_schema.routines
   WHERE ROUTINE_SCHEMA="sys" AND ROUTINE_NAME="mle_explain_error"
   AND ROUTINE_TYPE="PROCEDURE"

   -> MySQL Error 1054 (42S22): Unknown column 'sys' in 'where clause'

2. The error handler then crashes, so the UI never receives the error:

   File "...\gui_plugin\core\dbms\DbSession.py", line 254, in terminate_thread
     self._message_callback("ERROR", self.thread_error)
   TypeError: DbModuleSession.on_session_message() missing 1 required positional
   argument: 'result'

MySQL Workbench 8.0 connects to the same servers without issues.
Removing ANSI_QUOTES from sql_mode works around the problem.

How to repeat:
1. SET GLOBAL sql_mode = CONCAT('ANSI_QUOTES,', @@GLOBAL.sql_mode);
2. Open MySQL Workbench 26.7.1 on Windows and open a connection to that server.
3. The editor stays on "Starting editor session..." forever.

Suggested fix:
Use single quotes for string literals in internal queries, and fix the
on_session_message() callback signature so errors are reported to the UI.
[28 Sep 20:48] MySQL Admin
Posted by developer: Bug status updated to 'Documenting'