Package: tedia2sql
Version: 1.2.12-1
Severity: normal
Tags: patch

If a foreign key relation is setup that doesn't refer to the primary
key, I get the following error, and the output file isn't generated:

In association fooFoo a doesn't refer to a primary key or unique index

This occurs even though I have setup a unique index on the target field.
If the name of the index matches the target field name it works, but not
otherwise.

This seems to be because when building the indices it doesn't actually
use the names of the indexed columns for the hash key.

I'm attaching a simple example Dia file, and a patch that fixes this
problem, at least when only one field is involved.

The patch applies cleanly to current CVS as well as to 1.2.12.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-k7
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages tedia2sql depends on:
ii  libxml-dom-perl               1.43-4     Perl module for building DOM Level
ii  perl                          5.8.8-2    Larry Wall's Practical Extraction 

tedia2sql recommends no packages.

-- no debconf information

Attachment: foo.dia
Description: Binary data

--- /usr/bin/tedia2sql  2005-02-16 14:27:31.000000000 -0600
+++ tedia2sql   2006-02-27 16:27:50.284442947 -0600
@@ -923,6 +923,8 @@
                                ];
                        }
 
+                       $paramString = join(',', @$paramDescs);
+
                        if ($verbose) { print " * Got operation: $operName / 
$operType / ($paramString) / ($operTemplate)\n"; }
                        push @$operationDescs, [ $operName, $operType,
                                                 $paramDescs, $operTemplate,

Reply via email to