Hi,
I have an index with title, title_en, title_de (and several other fields for multi language search). I use REPLACE INTO to fill the columns after the translation is done. So if the title column already contains ’ (it worked correctly at the creation time) and you try to replace only another field, it wont escape the title column. Here is an example:
MySQL [Manticore]> REPLACE INTO `w46mt` SET title = 'but \' this works', title_en = 'why doesnt this \' escape work' where id = 49;
Query OK, 0 rows affected (0.023 sec)
MySQL [Manticore]> REPLACE INTO `w46mt` SET title_en = 'why doesnt this \' escape work' where id = 49;
ERROR 1064 (42000): P01: syntax error, unexpected identifier, expecting ',' or ')' near 'this works','','','why doesnt this \' escape work','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',49,0,6,12460,4,12,58,190,420,95.238098,95.238098,95.238098,95.238098,95.238098,505,1901.680054,1200,90,16.4384,15.3846,1.83206,1741272870,0,(1,10,28),(),1,0,0,0,0,1)'
MySQL [Manticore]>
How can i fix this problem?
Thank you!