Bug #57403 Search and replace of '[' with ' '(space)
Submitted: 12 Oct 2010 12:47 Modified: 12 Oct 2010 13:05
Reporter: Alan Melia Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.28 OS:Windows (2003 Server)
Assigned to: CPU Architecture:Any

[12 Oct 2010 12:47] Alan Melia
Description:
Exception = System.ArgumentOutOfRangeException
Message = Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: length
FullText = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: length
   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.ReplaceTarget(Int32 length, String text)
   at ScintillaNet.Range.set_Text(String value)
   at ScintillaNet.FindReplace.ReplaceAll(Int32 startPos, Int32 endPos, String searchString, String replaceString, SearchFlags flags)
   at ScintillaNet.FindReplace.ReplaceAll(String searchString, String replaceString, SearchFlags flags)
   at ScintillaNet.FindReplaceDialog.btnReplaceAll_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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)

How to repeat:
Search and replace of '[' with ' '(space) in an MSSQL script I was attempting to translate.

Suggested fix:
improve the bounds checking
[12 Oct 2010 13:05] Valeriy Kravchuk
This is a duplicate of Bug #56898.