Bug #121422 Workbench 26.7.1 reverses Ctrl+Enter / Ctrl+Shift+Enter shortcuts, creating risk of unintended script execution
Submitted: 2 Oct 8:29 Modified: 5 Oct 7:02
Reporter: Justin Sycamore Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:26.7.1 OS:Any
Assigned to: CPU Architecture:Any

[2 Oct 8:29] Justin Sycamore
Description:
MySQL Workbench 26.7.1 appears to have reversed the long-established keyboard shortcuts for executing SQL statements.

In previous versions of MySQL Workbench, including the 8.0 series:

Ctrl+Enter = Execute the current statement containing the cursor

Ctrl+Shift+Enter = Execute all statements / selection

In Workbench 26.7.1, the Run menu now shows:

Ctrl+Enter = Execute
Ctrl+Shift+Enter = Execute One

This creates a potentially serious safety issue for existing Workbench users.

After many years of using Workbench, users have developed muscle memory that Ctrl+Enter executes only the SQL statement containing the cursor. In 26.7.1, pressing the same shortcut can instead execute the whole script.

A SQL editor tab commonly contains several statements while investigating or modifying a database. Some of those statements may be UPDATE, DELETE, INSERT, ALTER, DROP, TRUNCATE or other data-changing statements.

An experienced Workbench user can therefore press Ctrl+Enter intending to execute only the statement at the cursor and unintentionally execute additional statements elsewhere in the editor.

This is particularly concerning because the shortcut for the historically safer/narrower operation has been reassigned to the broader operation.

This issue has significant precedent in the MySQL bug tracker.

Bug #50747 — "Hotkey for executing a single query"
https://bugs.mysql.com/bug.php?id=50747

This bug raised essentially the same concern: users accustomed to Ctrl+Enter executing a single query could accidentally execute DELETE/UPDATE/etc. statements when the shortcut instead executed multiple queries. The resolution explicitly changed Workbench back. This was included in Workbench 5.2.16.

Bug #50911 — "Improved handling of SQL Editor keyboard shortcuts and Stop Toolbar icon"
https://bugs.mysql.com/bug.php?id=50911

Bug #53333 — "Windows hotkeys reverted / acting strangely"
https://bugs.mysql.com/bug.php?id=53333

Bug #66025 — "Default behavior of Ctrl + Enter now changed..."
https://bugs.mysql.com/bug.php?id=66025

This later reported another Ctrl+Enter behavioural regression. The reporter gave an example involving DESCRIBE statements followed by a TRUNCATE statement and explained that the unexpected Ctrl+Enter behaviour could result in the table being truncated. The issue was fixed in Workbench 5.2.43, restoring Ctrl+Enter to executing the statement containing the cursor.

How to repeat:
Open MySQL Workbench 26.7.1.

Connect to a database and open a SQL editor.

Enter multiple statements, for example:

SELECT 'statement 1';

SELECT 'statement 2';

SELECT 'statement 3';

Place the cursor inside the second statement without selecting any text.

Press Ctrl+Enter.

Suggested fix:
The established MySQL Workbench mappings should be retained:

Ctrl+Enter — Execute One / Execute Current Statement
Ctrl+Shift+Enter — Execute All / Selection

Alternatively, Workbench should provide configurable keyboard shortcuts so users upgrading from previous versions can restore the established mapping.