Toad World® Forums

BUGS in DDL script generation


#1

I’ve found some bugs (well I think) in the DDL script generation for MySQL :

  • comments : the syntax used for table/column comment is wrong :

    used for columns (same for table) :
       CIE_REFEXT_TX Varchar(25) COMMENT = 'Reference externe'
    

    The ‘=’ char has to be removed

  • The global before/after script doesn’t. I think the properties Instance.InsBeforeScript and Instance.InsAfterScript doesn’t work.
    I replace the test by (Instance.Model.BeforeScript != “”) and (Instance.Model.AfterScript != “”)

  • Simple quotes are not managed in comments. Example :
    CREATE TABLE Entity1
    (
    aa Char(20) NOT NULL,
    bb Char(20),
    cc Char(20)
    )
    COMMENT = ‘xxxxx’yyyyy’;

The right syntax is :
CREATE TABLE Entity1
(
aa Char(20) NOT NULL,
bb Char(20),
cc Char(20)
)
COMMENT = ‘xxxxx’‘yyyyy’;

=> simple qutoes must be doubled.
  • I’ve a bug in relationship generation (see attached file). The scenario to redo the bug is quite simple :
    - create 2 entities with a simple primary key
    - add a non-identifying relationship between the 2 => this add a field into one of the entity and the foreign key
    - remove the relationship (click on it and press delete) => this delete the relationship, but not the field in the child table… why ???
    - open the former child table and try to remove the former foreign key attribute => IMPOSSIBLE ! why ???
    - open Physical Model Explorer -> Entites -> xxx -> Attributes
    - select the field and delete it => this do it => not really consistent with 2 lines above
    - try generate DDL script => error

    MOREOVER : trying to recreate the relationship causes an Exception

Thanks a lot for answering/debugging
Arnaud
Message was edited by: arnaud.lorenzi@neuros.fr

Message was edited by: arnaud.lorenzi@neuros.fr

bugTDM.jpeg


#2

Hi Arnaud,

thanks for your feedback. To the MySQL syntax problems: our developers will look into the matter. For your reference, the first problem (The ‘=’ char has to be removed ) CR# is 38487, the second problem (simple qutoes must be doubled) CR # is 38488.

To the last reported “bug”:

"…remove the relationship (click on it and press delete) => this delete the relationship, but not the field in the child table… why ??? "

TDM3 allows you to display one entity multiple times in a diagram - for this purpose we use graphical representation of objects (entity, relationship etc.) and we call them Shortcuts.

Pressing Delete key just removes the shortcuts (graphical representation of an object) from your diagram. Press SHIFT + Delete to delete an object from a model.

We are currently working on a more “user friendly” solution. A confirmation dialog will appear and you will be able to decide what to do. A message similar to this will appear:


Define action you wish to perform:

x Remove graphical representation of selected object(s) from diagram
x Delete selected object(s) from model

If you select the first option, only graphical representation of selected object(s) will be removed from your diagram. Object(s) will not be deleted from your model and therefore will be accessible via Model Explorer etc. If you select the second option, selected object(s) will be deleted from your model completely.


Summary: you removed only shorcut of the relationship. That’s why all FK attributes were in child entities. Pressing SHIFT+Delete instead of Delete fixes the problem.

Have a nice weekend,

Vaclav


#3

Hi Arnaud,

and the problem with generation of SQL: you should not be able to delete the FK attributes via Model Explorer. It made the model incorrect and the SQL code generation failed. It is a bug. CR# 38489. Thanks for sending us the detailed bug report !!!

Regards,

Vaclav


#4

Thanks for the explanation about the separation between model/graphics. This helps a lot.


#5

Hi Arnaud,

bugs with CR 38487 and CR 38488 have been fixed.

Regards,

Vaclav