Skip Menu |

This queue is for tickets about the GraphViz-DBI CPAN distribution.

Report information
The Basics
Id: 41768
Status: new
Priority: 0/
Queue: GraphViz-DBI

People
Owner: Nobody in particular
Requestors: Ian.Goodacre [...] xtra.co.nz
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.02
Fixed in: (no value)



Subject: foreign keys not identified with SQLite (quoted table names)
When using SQLite, $dbh->tables returns quoted table names. This causes the default is_foreign_key to fail to detect foreign keys. The following patch allows for quoted table names: # diff -u /usr/lib/perl5/site_perl/5.8.8/GraphViz/DBI.pm.orig /usr/lib/ perl5/site_perl/5.8.8/GraphViz/DBI.pm --- /usr/lib/perl5/site_perl/5.8.8/GraphViz/DBI.pm.orig 2008-12-17 12:03:51.000000000 +1300 +++ /usr/lib/perl5/site_perl/5.8.8/GraphViz/DBI.pm 2008-12-17 12:44:50.000000000 +1300 @@ -57,7 +57,9 @@ my ($self, $table, $field) = @_; return if $field =~ /$table[_-]id/i; return unless $field =~ /^(.*)[_-]id$/i; - my $candidate = $1; +# my $candidate = $1; + # get_info(29) ( 29 is SQL_IDENTIFIER_QUOTE_CHAR) returns true if table names are quoted. + my $candidate = ($self->get_dbh->get_info(29)) ? $self->get_dbh- Show quoted text
>quote_identifier($1) : $1;
return unless $self->is_table($candidate); return $candidate; }