mavenlink/my_obfuscate — pull request #2 by nokinen (2013-04-18 17:58:01+00:00)
Title: Add support for single quotes that are escaped through single quotes

When using postgres and the pg_dump utility, single quotes in strings like `"Foo's Bar"` are escaped through prepended single quotes such as `'Foo''s Bar'`.

### Steps to reproduce with postgres:
1. Insert some values into your db that have single-quote escaped single-quotes in it
2. Generate an sql dump of your db: `$ pg_dump --column-inserts db_name > dump.sql`
3. Obfuscate it
4. Load it in another db: `$ psql -d db_name -f obfuscated_dump.sql`

The following error should be raised for affected rows:
```
ERROR: INSERT has more expressions than target columns
```

### Problem
`DatabaseHelperShared#context_aware_mysql_string_split` does not support doubled single-quotes and therefore returns too many fields for the current row. For the insert statement
```
"INSERT INTO `pubs` (name) VALUES ('Flann O''Brien');"
```
it parses the fields as `[["Flann O", "Brien"]]` instead of `[["Flann O''Brien"]]`.

This pull request adds improvements to the `context_aware_mysql_string_split` method to support double single quotes within fields, in order to parse the fields of the above insert statement as