Bug #63866 reordered tabs switch automatically when executing query
Submitted: 28 Dec 2011 14:55 Modified: 9 Feb 2012 20:58
Reporter: Bob Dankert Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.36, 5.2.37 OS:Windows (W7 64)
Assigned to: CPU Architecture:Any
Tags: execute, query, reordered, switch, tab

[28 Dec 2011 14:55] Bob Dankert
Description:
If you open two sql query tabs on the same connection, write two different queries, then change the order of the tabs (SQL File 2 first, then SQL File 1), execute one of the queries, the active tab will switch to the other tab (the one you aren't viewing) and execute that query.  Details below:

How to repeat:
1.  Open a connection to a database
2.  Open two SQL tabs for executing queries on the same connection
3.  Write a query in each of the tabs
4.  Re-order the two tabs using drag and drop.  SQL File 2 should be first, then SQL File 1
5.  Execute a query in either of the tabs.  If you are on SQL File 2 (the first tab), it will switch to SQL File 1 and execute that query.  It never executes the query on SQL File 2, the tab you were looking at when you hit the execute query button (or hit the Ctrl-Enter).  The same is true for executing a query on the other tab.

Suggested fix:
Execute the query you are viewing when you have re-ordered tabs.
[28 Dec 2011 16:17] Valeriy Kravchuk
Thank you for the bug report. Verified with 5.2.36 on Windows XP also (so this is not a recent regression). 5.2.37 on Mac OS X does NOT have this problem.
[9 Feb 2012 20:58] Philip Olson
Fixed as of 5.2.38:

Executing a query after reordering multiple editor tabs would
make the inactive editor tab active, and execute that query.