dimanche 19 juin 2016

Error Code: 1267. Illegal mix of collations (latin1_ft_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='

I've read every post about this that I could find but nothing helps. I get the error 1267 for illegal mix of collations when I try to do update or delete (but select statements work fine). The subject table is called US_Exchange_Stocks in a database called Market_data. Using Show Table Status I get table collation = 'latin1_swedish_ci'. This is also the server collation. The table is as follows: Columns: Ticker varchar(8) Name varchar(60) PK As_of_date date PK Price decimal(8,2) UN PK Market_Cap double UN Exchange varchar(6)

Today's error comes from this statement: update US_Exchange_Stocks Set Name = 'The Madison Square Garden Company' where Ticker = 'MSG' and as_of_date > '2015-08-31'; Previously Delete for a certain as_of_date always fails (I have to rebuild table to delete). I have tried explicitly setting the collation of the character strings for Ticker and Date to latin1_swedish_ci but it makes no difference. I also explicitly set collation for the columns and the comparison strings - which doesn't work. I don't know if its relevant but I've created a user_ft_stopwords table in this database which does have latin1_ft_ci collation. Could this have an effect? What do I need to do to get my Update and Delete commands to work?

Aucun commentaire:

Enregistrer un commentaire