CSV engine mode for standard-compliant quote and comma parsing

Registered by Laurynas Biveinis

MySQL CSV SE is non-standard with respect to embedded " and , character parsing: http://bugs.mysql.com/bug.php?id=71091 / bug 1316042. Fixing this bug unconditionally breaks MySQL CSV format compatibility for any pre-existing user tables and for data exchange with other MySQL instances, but improves compatibility with other CSV producing/consuming tools.

To keep both MySQL and other tool compatibility, introduce a new dynamic, global/session server variable csv_mode of SET type, allowing an empty value (the default), and IETF_QUOTES.

If IETF_QUOTES is set, then embedded commas are accepted in quoted fields as-is, and a quote character is quoted by doubling it. In legacy mode embedded commas terminate the field, and quotes are quoted with a backslash.

A SET variable is chosen so that new values may be added in the future to accommodate other selective CSV format changes as needed (such as embedded newline character parsing).

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
Laurynas Biveinis
Direction:
Approved
Assignee:
Laurynas Biveinis
Definition:
Approved
Series goal:
Accepted for 5.5
Implementation:
Implemented
Milestone target:
milestone icon 5.5.41-37.0
Started by
Laurynas Biveinis
Completed by
Laurynas Biveinis

Whiteboard

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.