Skip Menu |

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

Report information
The Basics
Id: 58276
Status: open
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.11006
Fixed in: (no value)



Subject: sqlt-diff and "primary key unique"
It seems that sqlt-diff generates invalid SQL if "primary key unique" is used in a schema. Consider the following schemas: create table foo (k int primary key unique) ENGINE=MyISAM DEFAULT CHARACTER SET latin1; and CREATE TABLE `foo` ( `k` int(11) NOT NULL, PRIMARY KEY (`k`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; The latter schema was generated by mysqldump. sqlt-diff would produce the following diff: $ sqlt-diff /tmp/s1=MySQL /tmp/s2=MySQL ... BEGIN; ... ALTER TABLE foo DROP INDEX ; ... COMMIT; Which seems to be invalid SQL. I would expect that no diff would be shown at all in this case. Of course, a workaround is to remove the redundant "unique" from the first schema definition. Regards, Slaven
Can you check this agains 0.11007, I think it was fixed.
On 2011-02-27 11:44:49, RIBASUSHI wrote: Show quoted text
> Can you check this agains 0.11007, I think it was fixed.
No, same behaviour. Note that the first SQL needs to be written in one line (it seems that RT added a linebreak), otherwise SQL::Translator cannot parse it at all (which looks like another bug). Regards, Slaven