Bug #62169 "Unexpected Error" dialog box appears when typing ctrl-enter in data grid
Submitted: 14 Aug 2011 21:42 Modified: 8 Feb 2012 21:33
Reporter: Carl Robinson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.34 CE OS:Windows
Assigned to: CPU Architecture:Any

[14 Aug 2011 21:42] Carl Robinson
Description:
When viewing/editing query results in the Workbench data grid, typing [Ctrl]+[Enter] (as one would do in some software to include a newline in the text) produces an "unexpected error". Workbench continues to operate after the dialog is dismissed (does not appear to crash it). Information in the dialog box refers to an index out-of-range condition.

How to repeat:
Open a table in Workbench, click into a text field in the data grid, and type the [CTRL]+[ENTER] keystroke combination.
[15 Aug 2011 8:35] Valeriy Kravchuk
What exact Windows version is it? Exact table definition may also help, as I can not repeat this on Windows XP while working with my tables on local MySQL 5.1.58.
[15 Aug 2011 13:18] Carl Robinson
Problem occured running Workbench on Vista SP2. Was able to reproduce the problem testing against a variety of tables. Seems steps can be followed for any text field in any table to reveal the problem. Connection is to database(s) on a separate server running MySql 5.1.56 community edition.
[15 Aug 2011 16:03] MySQL Verification Team
I couldn't repeat on Vista 64-bit.
[15 Aug 2011 16:11] Carl Robinson
Forgot to indicate that problem was encountered on 32-bit edition of Vista (SP2)
[25 Aug 2011 13:59] Alfredo Kojima
When the error dialog appears, right click on the area below the icon in that window, select Copy Stack Trace in the context menu and paste it to this bug report.
[26 Aug 2011 23:37] Carl Robinson
Stack trace as requested:

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.Collections.ArrayList.get_Item(Int32 index)
   at System.Windows.Forms.DataGridViewColumnCollection.get_Item(Int32 index)
   at System.Windows.Forms.DataGridView.PositionEditingControl(Boolean setLocation, Boolean setSize, Boolean setFocus)
   at System.Windows.Forms.DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl)
   at System.Windows.Forms.DataGridView.ResetUIState(Boolean useRowShortcut, Boolean computeVisibleRows)
   at System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged_PreNotification(CollectionChangeAction cca, Int32 rowIndex, Int32 rowCount, DataGridViewRow& dataGridViewRow, Boolean changeIsInsertion)
   at System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged(CollectionChangeEventArgs e, Int32 rowIndex, Int32 rowCount, Boolean changeIsDeletion, Boolean changeIsInsertion, Boolean recreateNewRow, Point newCurrentCell)
   at System.Windows.Forms.DataGridViewRowCollection.ClearInternal(Boolean recreateNewRow)
   at System.Windows.Forms.DataGridView.OnClearingColumns()
   at System.Windows.Forms.DataGridViewColumnCollection.Clear()
   at System.Windows.Forms.DataGridView.Dispose(Boolean disposing)
   at MySQL.Controls.GridView.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at MySQL.Grt.Db.RecordsetView.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at MySQL.GUI.Workbench.DbSqlEditor.CloseRecordset(Int64 key)
   at MySQL.GUI.Workbench.DbSqlEditor.<>c__DisplayClass2.<RecordsetListChanged>b__0()
[29 Aug 2011 14:23] Armando Lopez Valencia
Thanks Carl for your report.
Reproduced in windows 7x64, WB 5.2.34 Rev. 7780 connected to MySQL 5.1 Ubuntu 10.04.
1. Open SQL Editor.
2. Double click on a table this will activate the "edition mode" for that table(EDIT `big_db`.`big_table`;).
3. Double click on any field, edit it and press Ctrl+[Enter].
[8 Feb 2012 21:33] Philip Olson
Fixed as of 5.2.38:

Pressing the "Control" + "Enter" key combination within the SQL editor 
would generate a recoverable error.