Bug #28932 | the quote function does not seem to return a string compatible with INSERT | ||
---|---|---|---|
Submitted: | 6 Jun 2007 19:02 | Modified: | 30 Jan 2008 15:36 |
Reporter: | mike breuner | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.0.27/5.0BK/5.1BK | OS: | Any (example below) |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
Tags: | sql insert quote string function |
[6 Jun 2007 19:02]
mike breuner
[12 Jun 2007 15:35]
MySQL Verification Team
Thank you for the bug report. Verified as described.
[29 Jan 2008 18:48]
Timothy Smith
Hi, Mike, thank you for your bug report. This is not a bug in MySQL, but rather the intended behavior of the QUOTE() function. It returns a quoted string - including the enclosing quotes. It is not useful directly in an INSERT statement. It may be useful to keep the returned value in your *application*, and splice it into a string there which will be sent as an SQL command. For example, you might select a QUOTE()ed value from one server, and then insert it into a table on another server. I am setting this as a documentation bug, in case the documentation team may find a way to clarify this here: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_quote Regards, Timothy
[30 Jan 2008 15:36]
Paul DuBois
I see nothing to do here. The QUOTE() description already indicates that the return value includes enclosing single quotes, unless the argument is NULL.