loadUpdateData does not escape apostrophes
Description
Environment
Maven 3.0.4, JDK 1.7.0_25, MySQL Enterprise 5.1.51sp1
Activity
Show:
Nathan Voxland October 1, 2013 at 7:52 PM
Bobby Tables can now be part of your csv file
Fixed
Details
Details
Reporter
a
aComponents
Fix versions
Affects versions
Priority
Created September 9, 2013 at 8:44 AM
Updated October 1, 2013 at 7:52 PM
Resolved October 1, 2013 at 7:52 PM
We use the loadUpdateData feature with a CSV that contains data like this:
id,key_en,content_en
"1","0100","Please don't do this."
The statement that liquibase generates from this CSV looks like this:
INSERT INTO test (id, key_en, content_en)
VALUES ('1', '0100', 'Please don''t do this.')
ON DUPLICATE KEY UPDATE
key_en='0100', content_en='Please don't do this.'
As you can see, in the update-part of the statement the CSV-string is not escaped appropriately.
We checked the code and it seems that due to the refactoring of the class InsertOrUpdateGeneratorMySQL the escaping part got lost. Maybe the escaping should now take place at the CharType-class (like at the DateTimeType).