vieten / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

Dot file exports have duplicate edges #1206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Export a database to a dot file in 0.9.9.1 or 0.9.9.
2. Export it again.
3. Compare the two files.

What is the expected output? What do you see instead?
 One edge per foreign-key relation. Instead there are duplicate entries as well as entries from previous exports.

What version of Sequel Pro are you using? What version of MySQL are you
connecting to on the server?
 Tested on 0.9.9.1, 0.9.9, and 0.9.8 (0.9.8 is ok) with MySQL 5.5.11, and 0.9.9.1 with MySQL 5.5.8.

Please provide any additional information below.

There are two issues, probably related. In versions after 0.9.8, the dot file 
from a DB export contains duplicate edge entries. Additionally each export 
contains the edge entries from the previous export, even if the previous export 
was of a different database. The increase in duplicate edges can be reset by 
closing the DB server connection and reconnecting.

Example:

I see this:

edge [ arrowhead=inv, arrowtail=normal, style=dashed, color="#444444" ];
table1:table2_id2 -> table2:id2 ;
table2:table2_id2 -> table2:id2 ;

instead of this:

edge [ arrowhead=inv, arrowtail=normal, style=dashed, color="#444444" ];
table1:table2_id2 -> table2:id2 ;

for attached database schema mydb.sql.

I've also attached exports and pngs of the exports from 0.9.9.1 vs. 0.9.8, as 
well as two screenshot of what happens with a regular-sized database.

Original issue reported on code.google.com by serentho...@gmail.com on 6 Oct 2011 at 11:05

Attachments:

GoogleCodeExporter commented 9 years ago
I looked at it in r3438 and verified it.

The issue seems to be that [SPTableData informationForTable:] is called for 
each table but only appends data to the constraints array instead of resetting 
it first.

Because of my little understanding of the inner workings I will leave this to 
another dev however.

Original comment by schlabbe...@gmail.com on 7 Oct 2011 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by stuart02 on 8 Oct 2011 at 6:53

GoogleCodeExporter commented 9 years ago
Fixed in r3440.

Original comment by stuart02 on 8 Oct 2011 at 7:17

GoogleCodeExporter commented 9 years ago
Issue 1297 has been merged into this issue.

Original comment by schlabbe...@gmail.com on 17 Mar 2012 at 7:46