Bug #60764 Exception returned
Submitted: 5 Apr 2011 21:00 Modified: 17 Nov 2011 18:22
Reporter: John David Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.32 CE, 5.2.33 OS:Windows
Assigned to: CPU Architecture:Any

[5 Apr 2011 21:00] John David
Description:
MySQL 5.1.56 (MyISAM table type)

Workbench has encountered a problem.
Index was outside the bounds of the array.

How to repeat:

Typed in and executed: use <db_name>; in "Query 1" tab
Opened new "Query 2" tab with "Create new Scratch Area" button.
Typed in and executed: select max(id) from <table1>;
Query returned a value in "Query 2 Result" tab.
Clicked back to Query 1 tab.
Removed previous text from "use" command.
Typed in: select max(id) from <table2>;
...
Workbench has encountered a problem.
Index was outside the bounds of the array.

The correct result gets returned when I click the close button on the exception dialog.
[5 Apr 2011 22:52] MySQL Verification Team
Thank you for the bug report. Could you please try version 5.2.33. Thanks.
[6 Apr 2011 2:09] John David
Apologize for not checking for a newer version.
I am still seeing the exact same behavior with 5.2.33.
I have attached screenshots.
The array out of bounds exception...
Could this be referring to the tabs array?
If you look at the step2.png shot, when the exception happens, the tabs get hammered.
When I click OK on the exception dialog, the max(id) result is shown (but the tabs are still whacked).
[6 Apr 2011 2:11] John David
Screen shots of error

Attachment: bug_60764.zip (application/zip, text), 51.08 KiB.

[6 Apr 2011 2:59] Alfredo Kojima
When the bug happens, right click on the blank area below the icon in the bug dialog and select Copy Stacktrace, then paste it here.
[6 Apr 2011 12:23] John David
Exception = System.IndexOutOfRangeException
Message = Index was outside the bounds of the array.
FullText = System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.TabControl.get_SelectedTabInternal()
   at System.Windows.Forms.TabControl.get_SelectedTab()
   at MySQL.Controls.FlatTabControl.DrawControl(Graphics g)
   at MySQL.Controls.FlatTabControl.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TabControl.WndProc(Message& m)
   at MySQL.Controls.FlatTabControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
[7 Apr 2011 1:20] MySQL Verification Team
Thank you for the feedback. Verified as described.
[17 Nov 2011 18:22] Philip Olson
Fixed as of 5.2.36:
+        Manipulating multiple SQL editor tabs would sometimes result in
+        uncaught exceptions.