Bug #61244 MySQL Workbench crash on selecting User account in Server Access Management Tab
Submitted: 20 May 2011 15:13 Modified: 20 Sep 2011 15:11
Reporter: Ellis Johns Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:5.2.33 OS:Any (Windows 7 64bit, 2008 64bit, Mac OS X)
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D2 (Serious)

[20 May 2011 15:13] Ellis Johns
Description:
I accidentally included single quotations in the "From Host" field when creating a user account.  Now I have a user account with the "From Host" field  = '%'  (notice the literal single quotations).  Whenever I attempt to select this user account in the workbench, to delete/change the account, an unhandled exception occurs and the application crashes.  Of note, I've attempted to delete this account from the cmd line, but a 1396 error (unable to drop user) occurs. The inner exception I get is:

 System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=mforms.wr
  StackTrace:
       at mforms.TreeView.changed(TreeView* )
       at MySQL.Forms.TreeViewImpl.SelectionChanged(Object sender, EventArgs e)
       at Aga.Controls.Tree.TreeViewAdv.OnSelectionChanged()
       at Aga.Controls.Tree.TreeViewAdv.set_SuspendSelectionEvent(Boolean value)
       at Aga.Controls.Tree.NormalInputState.DoMouseOperation(TreeNodeAdvMouseEventArgs args)
       at Aga.Controls.Tree.NormalInputState.MouseDown(TreeNodeAdvMouseEventArgs args)
       at Aga.Controls.Tree.TreeViewAdv.OnMouseDown(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.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)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at MySQL.GUI.Workbench.Program.Main(String[] Args)
  InnerException: 
    

How to repeat:
Create a user with any username and a "from host" field ='%' .  Then select this user account in the Server Access Management Tab.

Suggested fix:
Include validation in the "From Host" field before users can add accounts with illegal/troublesome formats.
[20 May 2011 16:09] Valeriy Kravchuk
On Mac OS X I get unhandled exception when trying to add use like that. We clearly have a problem here.
[20 Sep 2011 15:11] Philip Olson
Fixed as of 5.2.35:

+        Creating, then selecting or removing user accounts with invalid
+        hosts (such as <literal>'%'</literal>, including the single
+        quotes) resulted in an unhandled exception.