We have a table called site_tags
with a primary key made up of 2 fields - id
and tag
.
Some of the tag
fields are in UTF-8 which we want to convert to ISO-8859-1.
In this table there are 2 tags Seany
and seány
and we want to convert the latter from UTF-8.
When we try to do this using...
DELETE FROM site_tags WHERE id = '1325133476' AND tag = 'seány'
INSERT INTO site_tags (id, tag, active) VALUES ('1325133476', 'seány', '0')
MySQL gives the error on the insert:
Duplicate entry '1325133476-seány' for key 'PRIMARY'
This seems because it is finding the Seany
tag so thinks it's a duplicate, MySQL is not being character set sensitive (even though the delete worked on the correct record).
The database is using the latin1_swedish_ci
collation and MySQL is v5.1 (InnoDB)
Any advice on how we can acheive this?