Skip Menu |

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

Report information
The Basics
Id: 51433
Status: resolved
Priority: 0/
Queue: Parse-Dia-SQL

People
Owner: Nobody in particular
Requestors: edy.incoletti [...] logicsistemi.it
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.11_01
Fixed in: 0.12



Subject: The multiplicity attiribute used in foreign key is not considered.
ON DELETE CASCADE or other constraint are not generated with last version of DIA. The following patch solve the problem: In file SQL.pm at line 1039 } elsif ( $nodeAttrName =~ qr/^multip[l]?icity_a$/ ) { ### Spelling !!! at line 1042 } elsif ( $nodeAttrName =~ qr/^multip[l]?icity_b$/ ) { ### Spelling !!!
On Wed Nov 11 04:05:43 2009, http://eincoletti.myopenid.com/ wrote: Show quoted text
> ON DELETE CASCADE or other constraint are not generated with last > version of DIA.
Thank you for your bug report. Could you please attach a minimal dia diagram file with the version/platform used to create it, along with the actual and expected output from PDS. Best regards, Andreas --
On Mer. 11 Nov. 2009 04:20:33, AFF wrote: Show quoted text
> On Wed Nov 11 04:05:43 2009, http://eincoletti.myopenid.com/ wrote: > > Thank you for your bug report. Could you please attach a minimal dia > diagram file with the version/platform used to create it, along with the > actual and expected output from PDS. > > Best regards, > Andreas
The diagram is generete on Debian Unstable with dia 0.97. output_wrong.sql is generated before the patch, output_ok.sql after. Have a nice day
-- Parse::SQL::Dia version 0.11_01 -- Documentation http://search.cpan.org/dist/Parse-Dia-SQL/ -- Environment Perl 5.010001, /usr/bin/perl -- Architecture i486-linux-gnu-thread-multi -- Target Database postgres -- Input file Test.dia -- Generated at Wed Nov 11 10:40:27 2009 -- get_constraints_drop alter table tbl_detail drop constraint fk_detail_main ; -- get_permissions_drop -- get_view_drop -- get_schema_drop drop table tbl_main; drop table tbl_detail; -- get_smallpackage_pre_sql -- get_schema_create create table tbl_main ( pk_main SERIAL not null, constraint pk_tbl_main primary key (pk_main) ) ; create table tbl_detail ( pk_detail SERIAL not null, fk_main INTEGER , constraint pk_tbl_detail primary key (pk_detail) ) ; -- get_view_create -- get_permissions_create -- get_inserts -- get_smallpackage_post_sql -- get_associations_create alter table tbl_detail add constraint fk_detail_main foreign key (fk_main) references tbl_main (pk_main);
Download Test.dia
application/x-dia-diagram 14.9k

Message body not shown because it is not plain text.

-- Parse::SQL::Dia version 0.11_01 -- Documentation http://search.cpan.org/dist/Parse-Dia-SQL/ -- Environment Perl 5.010001, /usr/bin/perl -- Architecture i486-linux-gnu-thread-multi -- Target Database postgres -- Input file Test.dia -- Generated at Wed Nov 11 10:40:27 2009 -- get_constraints_drop alter table tbl_detail drop constraint fk_detail_main ; -- get_permissions_drop -- get_view_drop -- get_schema_drop drop table tbl_main; drop table tbl_detail; -- get_smallpackage_pre_sql -- get_schema_create create table tbl_main ( pk_main SERIAL not null, constraint pk_tbl_main primary key (pk_main) ) ; create table tbl_detail ( pk_detail SERIAL not null, fk_main INTEGER , constraint pk_tbl_detail primary key (pk_detail) ) ; -- get_view_create -- get_permissions_create -- get_inserts -- get_smallpackage_post_sql -- get_associations_create alter table tbl_detail add constraint fk_detail_main foreign key (fk_main) references tbl_main (pk_main) ON DELETE CASCADE;