Bug #97444 Closing query tab while query runs in other tab may trigger index out of range
Submitted: 31 Oct 2019 11:38 Modified: 31 Oct 2019 12:15
Reporter: Fredric Johansson Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.17, 8.0.18, 8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[31 Oct 2019 11:38] Fredric Johansson
Description:
If you have query running in a query tab and close a a query tab to the left of it Workbench will encounter an Index out of range when trying to update the busy symbol for the tab:

Info from the log:
12:16:42 [ERR][      Workbench]: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Exception = System.ArgumentOutOfRangeException
Message = Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
FullText = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at MySQL.Controls.FlatTabControl.SetBusy(Int32 index, Boolean busy)
   at MySQL.GUI.Workbench.SqlIdeForm.SetBusyTab(Int32 tab)
   at boost.detail.function.void_function_invoker1<void (__cdecl*)(int const &),void,int const &>.invoke(function_buffer* function_ptr, Int32* a0)
   at boost.function1<void,int const &>.()(function1<void\,int const \&>* , Int32* a0)
   at wb.WBContext.flush_idle_tasks(WBContext* , Boolean )
   at MySQL.Workbench.WbContext.flush_idle_tasks(Boolean force)
   at MySQL.GUI.Workbench.Program.timer_Tick(Object sender, EventArgs e)

How to repeat:
1. Open a number of query tabs
2. Start a query in the rightmost tab
3. While the query is still running close one or more tabs to the left
[31 Oct 2019 12:15] MySQL Verification Team
Hello Fredric Johansson,

Thank you for the report.
Observed this with WB 8.0.18.

regards,
Umesh
[29 Nov 2019 7:30] MySQL Verification Team
Bug #97752 marked as duplicate of this one.
[9 Apr 2020 12:36] MySQL Verification Team
Bug #99218 marked as duplicate of this one
[1 Sep 2020 23:48] Samuel Tobung
Is there a way this issue can be fixed?
[29 Apr 12:00] MySQL Verification Team
Bug #103518 marked as duplicate of this one
[30 May 14:49] Niromy Niro
To avoid this bug, Close the tabs from the right to left.