Bug #59588 inaccurate description of INTO OUTFILE escaping
Submitted: 18 Jan 2011 17:06 Modified: 27 Aug 2012 15:45
Reporter: Stephen Dewey Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0, 5.1, all OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[18 Jan 2011 17:06] Stephen Dewey
Description:
The manual states:

"If the FIELDS ESCAPED BY character is not empty, it is used as a prefix that precedes following characters on output: ... The first character of the FIELDS TERMINATED BY and LINES TERMINATED BY values ..."

However, MySQL only performs the escaping of FIELDS TERMINATED BY if it would actually cause ambiguity. In other words, if you have:

FIELDS TERMINATED BY '|'
ENCLOSED BY '"'

The pipe will NOT be escaped within a field value because it doesn't have to be to prevent ambiguity. If you change it to remove the enclosing character, then pipes WILL be escaped within a field value.

So basically, the manual wrongly implies that the specified characters are always escaped, when there is actually additional logic determining whether or not they are escaped.

How to repeat:
see above

Suggested fix:
see above
[18 Jan 2011 17:07] Stephen Dewey
Link to manual page:

http://dev.mysql.com/doc/refman/5.0/en/select.html
[20 Jan 2011 10:47] Sveta Smirnova
Thank you for the report.

Verified as described.
[27 Aug 2012 15:45] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.