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