Bug #59361 Clicking "Apply changes to data" button cause a bug dialog to display
Submitted: 7 Jan 2011 19:34 Modified: 22 Aug 2014 21:19
Reporter: Alice Lee Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.31 CE Revision 7115 OS:Windows
Assigned to: CPU Architecture:Any

[7 Jan 2011 19:34] Alice Lee
Description:
On the Inserts tab for a table inside MySQL Model, after I entered 5 rows of data to the table and clicked the button "Apply changes to data".  It didn't complain.  But when I click the refresh button, it says "There are pending changes. Please commit or rollback first.".  But I cannot find any button that can commit or rollback the data.  After I click the button for applying the changes a few times, a dialog about a bug found in WorkBench display.

How to repeat:
see above.

Suggested fix:
add a way to commit or rollback the data inside MySQL Model->Inserts
[10 Jan 2011 9:09] Valeriy Kravchuk
Please, send .mwb file that demonstrates this behavior. I can not repeat this with my simple models/tables.
[14 Jan 2011 14:31] Alice Lee
It is probably because the table I tried to insert data into has a foreign key from another table that doesn't contain the data yet.

I think the error message should indicate the actual foreign key problem, rather than saying "There are pending..."

Also, I can easily cause the dialog for reporting the bug to popup by inserting data in the Insert tab inside the Model tab, if that table contains a foreign key.

Thanks,
Alice
[22 Mar 2011 20:19] Rafael Antonio Bedoy Torres
Hello Alice,

colud you please try using the newest version?, if you still have the problem, may you please share the model or the structure of the specific table you're working on? if it's possible please share the .mwb file that demonstrates the behavior.
[22 Apr 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[9 Jul 2014 22:47] Alvah Sewell
I had the same (or at least a similar) problem.   It looks like my problem was that I had a field marked for "not null" and it was empty.
[20 Jul 2014 22:51] Michael Jephcote
I'm experiencing this issue on workbench version 6.1.7  revision 11891 build 1788.

I have a table as follows:

CREATE TABLE IF NOT EXISTS `Db`.`users` (
  `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(64) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NULL DEFAULT NULL,
  `email` VARCHAR(48) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL,
  `password` VARCHAR(128) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL,
  `must_change_password` TINYINT(1) NULL,
  `group_id` TINYINT(3) UNSIGNED NOT NULL,
  `banned` TINYINT(1) NOT NULL,
  `suspended` TINYINT(1) NOT NULL,
  `active` TINYINT(1) NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `email_UNIQUE` (`email` ASC),
  INDEX `group_idx` (`group_id` ASC),
  CONSTRAINT `user_group`
    FOREIGN KEY (`group_id`)
    REFERENCES `Db`.`user_groups` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_bin

Upon adding an insert:

id NULL
name Michael Jephcote
email notincluded@somedomain.co.uk
password (this is a hash that has been modified for here) $2a$08$EFCzRlDx98qmVxNm3/cPDjPeIsVWGbX5IWUvNspQpjusrqtpbst.G
must_change_password 0
group_id 1
banned 0
suspended 0
active 1

The application throws this error upon trying to apply changes, the below is taken from wb.log:

23:31:20 [ERR][      Workbench]: External component has thrown an exception.
Exception = System.Runtime.InteropServices.SEHException
Message = External component has thrown an exception.
FullText = System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at mforms.ToolBarItem.callback(ToolBarItem* )
   at ToolbarItemEventTarget.OnItemActivation(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.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.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.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)
[20 Jul 2014 22:58] Michael Jephcote
How odd... Closing and reopening the workbench and re-adding the insert has fixed this issue.... Weird
[22 Aug 2014 21:19] Alfredo Kojima
Please reopen the bug with details of how to get the bug if you're able to repeat this.