Bug #76082 Trigger changes are not retained
Submitted: 1 Mar 2015 0:37 Modified: 18 Mar 2015 18:35
Reporter: Sherzod Ruzmetov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S1 (Critical)
Version:6.2.5 OS:Linux (Linux 3.18.7-200.fc21.x86_64 #1 SMP Wed Feb 11 21:53:17 UTC 2015 x86_64 x86_64)
Assigned to: CPU Architecture:Any

[1 Mar 2015 0:37] Sherzod Ruzmetov
Description:
When editing any kind of trigger SQL code doesn't get saved. 

I noticed that it stores only the initial code typed into the trigger editor. But when I attempt to edit it, it's restored back to the previous text.

Then it crashes by throwing the following error:

GLib-GObject:ERROR:gsignal.c:756:emission_pop: code should not be reached

Last night, though, it crashed, under the very same circumstance but through Segmentation Fault.

I also tried to load the trigger code from a file, synching from the database, to no avail - only the first edit is retained.

If it is realated at all, I keep getting the following warnings all the time too:

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragSource) to class (gtkmm__CustomObject_13GridViewModel) after class_init

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragDest) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragSource) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragDest) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragSource) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragDest) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:19421): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragSource) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

How to repeat:
* Open any table in the model under "Physical Schemas" section
* Open "Triggers" tab and edit a trigger
* Save the model, then edit the trigger code
* Save the model, click any other tab, and re-open the trigger code - last edit will not have been retained

Suggested fix:
I could not find any fix. I tried to load the code from a f file, synched from the database, to no avail. The trigger code is never updated.
[1 Mar 2015 0:49] Sherzod Ruzmetov
Now I received an updated error message during the crash:

(mysql-workbench-bin:19736): Gtk-CRITICAL **: IA__gtk_progress_set_percentage: assertion 'percentage >= 0 && percentage <= 1.0' failed
**
GLib-GObject:ERROR:gsignal.c:756:emission_pop: code should not be reached
[4 Mar 2015 17:35] Sherzod Ruzmetov
trigger_BEFORE_UPDATE.sql that still keeps crashing mysql-workbench

Attachment: invoice_content_BEFORE_UPDATE.sql (application/sql, text), 1.53 KiB.

[4 Mar 2015 17:39] Sherzod Ruzmetov
I just upgraded to 6.2.5. In most tables I tested triggers can be edited just fine. However, on this one particular table that I have it crashes after I make chanage to trigger content, and navigate away.

I uploaded the trigger's source (see attachment "trigger_BEFORE_UPDATE.sql")
[4 Mar 2015 17:46] Sherzod Ruzmetov
I confirm that it's the content of the trigger that's causing the crash. To test it i removed all the triggers from that particular table. Create a "hello world" trigger. It works, saves, updates, and does not crash.

But once I insert the actual trigger content (attached above) it crashes again. I'll start re-typing the trigger code a new and see which statement is the culprit. 

Btw, the error during the crash is the same
[5 Mar 2015 13:49] Sherzod Ruzmetov
I finally narrowed down the cause of this crash: it was the begin block label!!!

If I remove the "update_fifo_layer:" label before the BEGIN it stops crashing! I double-checked this by adding labels for other BEGIN blocks in other triggers, mysql-workbench crashes furiously!!!

Now the workaround for me is to re-write the triggers without having to label the blocks.

However it's fine with me labeling the loops.

If someone could tell me where in the source code I should be looking for this perhaps I could give a hand to locate this bug?
[5 Mar 2015 17:31] MySQL Verification Team
Thank you for the bug report.

(mysql-workbench-bin:30466): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragDest) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:30466): GLib-GObject-WARNING **: attempting to add an interface (GtkTreeDragSource) to class (gtkmm__CustomObject_16ListModelWrapper) after class_init

(mysql-workbench-bin:30466): glibmm-ERROR **: 
unhandled exception (type std::exception) in signal handler:
what: basic_string::substr: __pos (which is 18446744073701655208) > this->size() (which is 0)

[miguel@vbfed21 ~]$
[18 Mar 2015 18:35] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.3 release, and here's the changelog entry:

The trigger editor would fail to save data for triggers including the
"BEGIN ... END" construct. It would also generate a
"GLib-GObject:ERROR:gsignal.c:756:emission_pop: code should not be
reached" error.

Thank you for the bug report.