Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 64253
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: ELGAARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11007
Fixed in: (no value)



Subject: patch - GraphViz producer creates doubles
The GraphViz producer (e.g. used via sqlt-graph) produces two boxes for each table - one unconnected containing the fields, and one empty in the dependency tree. See the attached file "example.png" for an illustration. It has been created by the command sqlt-graph -d MySQL -o example.png -t png example.sql It turns out this is because nodes are added with quotes surroundung the table name, whereas edges are added without the quotes. When asked to create an edge to 'foo', GraphViz does not recognize that 'foo' is the same node as '"foo"', so it creates a new, empty node. The attached patch solves the problem. The result after applying the patch can be seen in the attached file "example2.png". ---- Standard Ubuntu 10.04 install. SQL::Translator::Producer::GraphViz version 1.59 GraphViz version 2.04
Subject: example.png
Download example.png
image/png 9.4k
example.png
Subject: example2.png
Download example2.png
image/png 7.6k
example2.png
Subject: GraphViz.patch
--- GraphViz.pm 2010-12-27 02:49:29.695248480 +0100 +++ /usr/share/perl5/SQL/Translator/Producer/GraphViz.pm 2010-12-27 02:51:16.405873459 +0100 @@ -595,8 +595,8 @@ my $table2 = $tables[ $j ]; next if $done{ $table1 }{ $table2 }; $gv->add_edge( - $table2, - $table1, + qq["$table2"], + qq["$table1"], arrowhead => $optional_constraints{$bi} ? 'empty' : 'normal', ); $done{ $table1 }{ $table2 } = 1;
On Sun Dec 26 21:13:42 2010, ELGAARD wrote: Show quoted text
> The GraphViz producer (e.g. used via sqlt-graph) produces two boxes for > each table - one unconnected containing the fields, and one empty in the > dependency tree. > > See the attached file "example.png" for an illustration. It has been > created by the command > > sqlt-graph -d MySQL -o example.png -t png example.sql > > It turns out this is because nodes are added with quotes surroundung the > table name, whereas edges are added without the quotes. When asked to > create an edge to 'foo', GraphViz does not recognize that 'foo' is the > same node as '"foo"', so it creates a new, empty node. > > The attached patch solves the problem. The result after applying the > patch can be seen in the attached file "example2.png". >
That's awesome... except an identical patch was applied over a year ago, and the changes were released as SQLT 0.11004, we are to 0.11007 now. Cheers!