Bug #59652 Failure to send create statment to sql editor,
Submitted: 21 Jan 2011 11:07 Modified: 29 Jun 2011 16:07
Reporter: swan liu Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.30CE r6790 OS:Windows (xp)
Assigned to: CPU Architecture:Any
Tags: create statment;sql editor;

[21 Jan 2011 11:07] swan liu
Description:
Failure  to send create statment to sql editor,
but can send create statment to clipboard.

below is stack trace.

Exception = System.ArgumentOutOfRangeException
Message = 索引超出范围。必须为非负值并小于集合大小。
参数名: startIndex
FullText = System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。
参数名: startIndex
   在 System.String.ToCharArray(Int32 startIndex, Int32 length)
   在 ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.SendMessageDirectWithLength(UInt32 msg, Int32 wParam, String lParam)
   在 ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.AddText(Int32 length, String s)
   在 MySQL.Grt.Db.Sql.SqlEditor.DoInsertText(String text)
   在 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)
   在 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)
   在 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)
   在 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)
   在 MySQL.Grt.ListModel.activate_popup_item_for_nodes(String name, List`1 nodes)
   在 MySQL.GUI.Workbench.SqlIdeMenuManager.OnMenuItemClick(Object sender, EventArgs e)
   在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   在 System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
   在 System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

How to repeat:
open workbench , connect to db ,select my db,right click on my table ,

choose 'send create statment to sql editor' 

and it is repeated.

db:./mysql  Ver 14.14 Distrib 5.5.8, for Linux (x86_64) using  EditLine wrapper
os:uname-a =Linux db30 2.6.36.2 #1 SMP Thu Dec 16 19:43:27 CST 2010 x86_64 x86_64 x86_64 GNU/Linux

table : 30+ cloumns ,60+k rows data. create statement is on Private comment section.
[21 Jan 2011 11:10] swan liu
snapshot to screen

Attachment: mysql-bench-bug.JPG (image/jpeg, text), 48.07 KiB.

[21 Jan 2011 11:13] swan liu
maybe same bug to #57267?
[21 Jan 2011 11:20] swan liu
addtional info:
this bug is not happen to other my tables. 
the schema that table belong to is UTF8 default collation.
[21 Jan 2011 11:51] Peter Laursen
Probably one more example that WB assumes ASCII for identifiers. Identifiers in MySQL 51+ are unicode.
[29 Jun 2011 16:07] Jon Stephens
Duplicate of BUG#60475.