Bug #57267 table->send to sql editor->create statement->error "Index was out of range..."
Submitted: 6 Oct 2010 3:06 Modified: 30 Jun 2011 9:44
Reporter: Valeriy Yuferov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.29 CE, Revision 6756 OS:Windows
Assigned to: Mike Lischke CPU Architecture:Any
Tags: stack

[6 Oct 2010 3:06] Valeriy Yuferov
Description:
table->send to sql editor->create statement->error "Index was out of range..."

How to repeat:
table->send to sql editor->create statement->error "Index was out of range..."
[6 Oct 2010 4:00] Valeriy Kravchuk
Looks like we need more details. I can not repeat this on Mac OS X with my tables.
[6 Oct 2010 11:43] Valeriy Yuferov
windows with error message

Attachment: scr1.png (image/png, text), 207.05 KiB.

[6 Oct 2010 11:44] Valeriy Yuferov
table structure

Attachment: scr2.png (image/png, text), 39.14 KiB.

[6 Oct 2010 11:45] Valeriy Yuferov
MS Windows 7 Home Premium 64-bit
[6 Oct 2010 11:45] Valeriy Yuferov
MS Windows 7 Home Premium 64-bit
[12 Oct 2010 17:37] Valeriy Yuferov
The same with 5.2.29 CE, Revision 6756
[28 Oct 2010 15:39] Alfredo Kojima
Please try repeating again and when the error dialog pops up, right click somewhere that has no text and select the Copy Stack item then paste to this bug report.
[29 Oct 2010 7:29] Valeriy Yuferov
Exception = System.ArgumentOutOfRangeException
Message = Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
FullText = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
   at System.String.ToCharArray(Int32 startIndex, Int32 length)
   at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.SendMessageDirectWithLength(UInt32 msg, Int32 wParam, String lParam)
   at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.AddText(Int32 length, String s)
   at MySQL.Grt.Db.Sql.SqlEditor.DoInsertText(String text)
   at MySQL.Grt.RunWrappedDelegate1<int\,int\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> >\,System::String ^\,MySQL::Grt::DelegateSlot1<int\,int\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> >\,System::String ^>::ManagedDelegate>.native_callback(basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a1)
   at sigc.pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int>.()(pointer_functor1<std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,int>* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_a1)
   at sigc.adaptor_functor<sigc::pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int> >.operator()<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &>(adaptor_functor<sigc::pointer_functor1<std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,int> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_arg1)
   at sigc.internal.slot_call1<sigc::pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int>,int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &>.call_it(slot_rep* rep, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a_1)
   at MySQL.Grt.ListModel.activate_popup_item_for_nodes(String name, List`1 nodes)
   at MySQL.GUI.Workbench.SqlIdeMenuManager.OnMenuItemClick(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.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)
[29 Oct 2010 12:32] Alfredo Kojima
Please attach the structure of the table you're interacting with. Does that error happen with any table? If so, can you send the structure of all the tables in the schema?
[29 Oct 2010 14:39] Valeriy Yuferov
here we are
[29 Oct 2010 16:48] Alfredo Kojima
In what encoding are the comments in your tables? They don't look like UTF-8
[29 Oct 2010 18:43] Valeriy Yuferov
may be windows-1251
[29 Oct 2010 18:45] Valeriy Yuferov
I think that any encoding is not the reason for the error. Isn't it?
[30 Nov 2010 16:32] Valeriy Yuferov
I've tested 5.2.30. the same error presents. See below
===
Exception = System.ArgumentOutOfRangeException
Message = Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
FullText = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
   at System.String.ToCharArray(Int32 startIndex, Int32 length)
   at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.SendMessageDirectWithLength(UInt32 msg, Int32 wParam, String lParam)
   at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.AddText(Int32 length, String s)
   at MySQL.Grt.Db.Sql.SqlEditor.DoInsertText(String text)
   at MySQL.Grt.RunWrappedDelegate1<int\,int\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> >\,System::String ^\,MySQL::Grt::DelegateSlot1<int\,int\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> >\,System::String ^>::ManagedDelegate>.native_callback(basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a1)
   at sigc.pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int>.()(pointer_functor1<std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,int>* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_a1)
   at sigc.adaptor_functor<sigc::pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int> >.operator()<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &>(adaptor_functor<sigc::pointer_functor1<std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,int> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_arg1)
   at sigc.internal.slot_call1<sigc::pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int>,int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &>.call_it(slot_rep* rep, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a_1)
   at MySQL.Grt.ListModel.activate_popup_item_for_nodes(String name, List`1 nodes)
   at MySQL.GUI.Workbench.SqlIdeMenuManager.OnMenuItemClick(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.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)
[13 Dec 2010 12:40] Valeriy Yuferov
the same with 5.2.31
[13 Dec 2010 12:40] Valeriy Yuferov
Exception = System.ArgumentOutOfRangeException
Message = Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
FullText = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
   at System.String.ToCharArray(Int32 startIndex, Int32 length)
   at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.SendMessageDirectWithLength(UInt32 msg, Int32 wParam, String lParam)
   at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.AddText(Int32 length, String s)
   at MySQL.Grt.Db.Sql.SqlEditor.DoInsertText(String text)
   at MySQL.Grt.RunWrappedDelegate1<int\,int\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> >\,System::String ^\,MySQL::Grt::DelegateSlot1<int\,int\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> >\,System::String ^>::ManagedDelegate>.native_callback(basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a1)
   at sigc.pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int>.()(pointer_functor1<std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,int>* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_a1)
   at sigc.adaptor_functor<sigc::pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int> >.operator()<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &>(adaptor_functor<sigc::pointer_functor1<std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&\,int> >* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* _A_arg1)
   at sigc.internal.slot_call1<sigc::pointer_functor1<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,int>,int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &>.call_it(slot_rep* rep, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a_1)
   at MySQL.Grt.ListModel.activate_popup_item_for_nodes(String name, List`1 nodes)
   at MySQL.GUI.Workbench.SqlIdeMenuManager.OnMenuItemClick(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.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)
[19 Mar 2011 9:16] Finn Nielsen
Description:
table->send to sql editor->create statement->error "Index was out of range..."

A table like this using the danish "ø" i column name:

CREATE TABLE `tblDemoBug` (
  `idtblDemoBug` int(11) NOT NULL,
  `Seek_Danish_Søg` varchar(50) COLLATE utf8_danish_ci DEFAULT NULL,
  PRIMARY KEY (`idtblDemoBug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci;
[30 Jun 2011 9:45] Jon Stephens
Duplicate of BUG#60475.