Bug #40846 Synch problem
Submitted: 19 Nov 2008 9:49 Modified: 20 Feb 2009 16:35
Reporter: Mike Zielinski Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.x OS:Windows (XP SP3)
Assigned to: Alexander Musienko CPU Architecture:Any

[19 Nov 2008 9:49] Mike Zielinski
Description:
The problem is when you try to synchronize model which contains view and function.
Additionally view is using a function.

Proces seems to synchronize everything in order like: tables, views, functions and procedures. This leads to error "Error 1305: FUNCTION `bleble` does not exist" because view uses function `bleble`.

This error only occures if script must create both view and function.

The same is when you try "forward engineer..." option.

I don`t know if "views using functions" is only one example to break the validation during synch proces.

How to repeat:
Just create in the model view which uses function. Both should exist of course.

Suggested fix:
Validation should check entire model before it throws that something is missing.

To workaround this issue you can manually change the order of what WB will synchronize. It can be done in SQL Sync Script window which appears during the sync process.

The other way is to synchronize the model twice. During first synch it creates everything but view. Next synch creates missing views because functions which are used in these views are already created so validator won`t throw an error.
[19 Nov 2008 10:06] Mike Zielinski
One more thing which is annoying.

If you try to edit the order you`ll find that you can`t use ENTER button because it moves you to the next step which is - synchronization.

I believe that if you edit the text area focus should be set on this text area field, not on the next-button.
[16 Feb 2009 13:58] Johannes Taxacher
create order of objects is now:
-schema
-tables
-placeholder-tables for views
-procedures/functions
-views

will be included in 5.0.30
[17 Feb 2009 6:51] Mike Zielinski
Any chance to solve the problem with ENTER button (remove focus from next button to the text area synchronization window)?
[20 Feb 2009 16:35] Tony Bedford
An entry was added to the 5.0.30 changelog:

If a model contained a View that was using a Function, and an attempt was made to Synchronize the database, then an error was generated such as:

Error 1305: FUNCTION `bleble` does not exist

A similar error was also generated if the Forward Engineer SQL CREATE Script wizard was used.