Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MySQL-Diff CPAN distribution.

Report information
The Basics
Id: 71476
Status: open
Priority: 0/
Queue: MySQL-Diff

People
Owner: Nobody in particular
Requestors: marcus [...] synchromedia.co.uk
Cc:
AdminCc:

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



Subject: issues with changing table charset/collation options
Hi, I've been using your excellent mysqldiff utility, but I ran into a really small bug. If the charset/collation value for a table changes, the charset for fields are not altered if they match the table's original setting, because they are left blank in that case. So if I have a table with CHARSET=latin1 that I change to CHARSET=utf8 and I also change a couple of fields (say a VarChar to Char), mysqldiff will make the field changes first, then the table changes. This means that the fields will be left in latin1. The exact example that I ran into this on is: ALTER TABLE `ITEM_VALUE` CHANGE COLUMN `UID` `UID` char(12) NOT NULL; # was varchar(12) NOT NULL ALTER TABLE `ITEM_VALUE` ENGINE=MyISAM DEFAULT CHARSET=utf8; # was ENGINE=MyISAM DEFAULT CHARSET=latin1 If I then apply this script to the original database and run another diff, if generates another patch to change the charset on that field. If I change the order to this, it all works as expected: ALTER TABLE `ITEM_VALUE` ENGINE=MyISAM DEFAULT CHARSET=utf8; # was ENGINE=MyISAM DEFAULT CHARSET=latin1 ALTER TABLE `ITEM_VALUE` CHANGE COLUMN `UID` `UID` char(12) NOT NULL; # was varchar(12) NOT NULL So, a fix for this bug would be to output table changes before field changes. Sound reasonable? Thanks, Marcus