Skip Menu |

This queue is for tickets about the Autodia CPAN distribution.

Report information
The Basics
Id: 32828
Status: resolved
Priority: 0/
Queue: Autodia

People
Owner: Nobody in particular
Requestors: petschge [...] tretboot.petschge.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 2.03
  • 2.04
  • 2.05
  • 2.06
Fixed in: 2.07



Subject: [Fwd: Bugs in SQL-Import of Autodia 2.03]
Date: Thu, 31 Jan 2008 12:28:54 +0100 (CET)
To: bug-autodia [...] rt.cpan.org
From: petschge [...] tretboot.petschge.de
Show quoted text
---------------------------- Original Message ---------------------------- Subject: Bugs in SQL-Import of Autodia 2.03 From: "Patrick Kilian" <mail@petschge.de> Date: Thu, January 10, 2008 1:35 pm To: dia-list@gnome.org Cc: hans@breuer.org -------------------------------------------------------------------------- Hello, I am trying to generate diagrams from SQL dumps of a MySQL database which I administrate. I found the tool autodia which seems to do what I need. So I downloaded version 2.03 from http://search.cpan.org/CPAN/authors/id/T/TE/TEEJAY/Autodia-2.03.tar.gz and tried it. When I run autodia on the dumpfile I get the following output: getting handlers.. getting pattern for sql AutoDia - version 2.03(c) Copyright 2003 A Trevena using language : sql ..using Autodia::Handler::SQL opening dump Can't call method "add_attribute" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/Autodia/Handler/SQL.pm line 86, <INFILE> line 96613. Line 96613 is the very last line of the file an contains: -- Dump completed on 2008-01-10 12:02:37 Unfortunately I can not give you that file for debugging so I decided to strip town the dump to the minimum needed to reproduce the error. The first step was: cat dump | grep -v "INSERT" | grep -v "^--" | grep -v LOCK | grep -v "^\/\*" | uniq > dump_a.sql And the resulting file is attached to this email. If I run "autodia.pl -l sql dump_a.sql" I get: getting handlers.. getting pattern for sql AutoDia - version 2.03(c) Copyright 2003 A Trevena using language : sql ..using Autodia::Handler::SQL opening dump_a.sql Can't call method "add_attribute" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/Autodia/Handler/SQL.pm line 86, <INFILE> line 402. I continued to further strip down the sql dump and found that the inline comments /* ... */ caused the problem. Removing them from the dump file allowed autodia to complete with the following output: getting handlers.. getting pattern for sql AutoDia - version 2.03(c) Copyright 2003 A Trevena using language : sql ..using Autodia::Handler::SQL opening dump_b.sql using default (dia) template Diagram.pm : Dependancies : no dependancies to be printed - ignoring.. Diagram.pm : Dependancies : no dependancies to be printed - ignoring.. Diagram.pm : Dependancies : no dependancies to be printed - ignoring.. written outfile : autodia.out.xml successfully complete. (processed 1 files) But if I run dia on the resulting file autodia.out.xml I get: <type 'exceptions.SyntaxError'>SyntaxError('invalid syntax', ('<string>', 1, 4, 'Dia:diagram()'))Traceback (most recent call last): File "/usr/share/dia/python/doxrev.py", line 482, in import_file classes = GetClasses ([sFile]) File "/usr/share/dia/python/doxrev.py", line 400, in GetClasses classes.extend (Parse (f.read())) File "/usr/share/dia/python/doxrev.py", line 391, in Parse p.Parse(sData) File "/usr/share/dia/python/doxrev.py", line 344, in start_element o = eval (s + "()") Thank you for using Dia. The dia version I use is Dia version 0.96.1, compiled 23:09:04 Sep 22 2007 as shipped with openSuSE 10.3 Looking at the output with vim I was unable to find anything in the xml file which looked wrong. Could you please give me some help how to debug this problem? Greets, Patrick "Petschge" Kilian PS.: Please CC my email address as I am not subscribed to the list. Thanks.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Show quoted text
> But if I run dia on the resulting file autodia.out.xml I get: > <type 'exceptions.SyntaxError'>SyntaxError('invalid syntax', > ('<string>', 1, 4, 'Dia:diagram()'))Traceback (most recent call last): > File "/usr/share/dia/python/doxrev.py", line 482, in import_file > classes = GetClasses ([sFile]) > File "/usr/share/dia/python/doxrev.py", line 400, in GetClasses > classes.extend (Parse (f.read())) > File "/usr/share/dia/python/doxrev.py", line 391, in Parse > p.Parse(sData) > File "/usr/share/dia/python/doxrev.py", line 344, in start_element > o = eval (s + "()") > Thank you for using Dia. > > > The dia version I use is > Dia version 0.96.1, compiled 23:09:04 Sep 22 2007 > as shipped with openSuSE 10.3 > > Looking at the output with vim I was unable to find anything in the xml > file which looked wrong.
This was fixed by changing the default output name to autodia.out.dia - Dia 0.96 onwards treats .xml file extension as something special for pyhthon scripts and doesn't spot that they're valid Dia xml :(