Skip Menu |
 

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

Report information
The Basics
Id: 31860
Status: new
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: barry [...] tristanmedia.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.0899_01
Fixed in: (no value)



Subject: MySQL -> PostgreSQL gets confused about unused names
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1586
Download (untitled) / with headers
text/plain 1.5k
Here is sql from mysqldump that will break when translating to PostgreSQL. Translating to Oracle or DB2 works OK. CREATE TABLE `neighborhood` ( `neighborhood_id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', PRIMARY KEY (`neighborhood_id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `event` ( `event_id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `description` text, `location` int(11) NOT NULL default '0', `start_date` date NOT NULL default '0000-00-00', `end_date` date NOT NULL default '0000-00-00', PRIMARY KEY (`event_id`), KEY `start_date` (`start_date`,`end_date`), KEY `location` (`location`), ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `location` ( `location_id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `description` text, `neighborhood` int(11) NOT NULL default '0', PRIMARY KEY (`location_id`), KEY `name` (`name`), KEY `neighborhood` (`neighborhood`), KEY `type` (`type`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; $ sqlt -f MySQL -t PostgreSQL artcal3.sql Error: translate: Error with producer 'SQL::Translator::Producer::PostgreSQL': Can't use string ("location") as a HASH ref while "strict refs" in use at /opt/perl-5.8.8/lib/site_perl/5.8.8/SQL/Translator/Producer/PostgreSQL.pm line 294. $ perl -v This is perl, v5.8.8 built for i686-linux SQL-Translator-0.0899_01 Linux artcat.net 2.6.9-023stab044.16-smp #1 SMP Fri Nov 23 20:37:16 MSK 2007 i686 i686 i386 GNU/Linux
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-9207-1198544245-1553.31860-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: barry [...] tristanmedia.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 80
Removing the location column from the event table causes the error to disappear.
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-9207-1198544245-1553.31860-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-9207-1198544245-1553.31860-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-9213-1198701600-1986.31860-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: barry [...] tristanmedia.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 100
Download (untitled) / with headers
text/plain 100b
The problem is with an index that has the same name as a field. Something is buggy in create_index.
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-9207-1198544245-1553.31860-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-9207-1198544245-1553.31860-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-9227-1198701615-66.31860-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: barry [...] tristanmedia.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 101
Download (untitled) / with headers
text/plain 101b
The problem is with an index that has the same name as a column. Something is buggy in create_index.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.