Bug #49685 Unable to save simple record containing backslash \
Submitted: 14 Dec 2009 17:45 Modified: 21 Jan 2010 9:38
Reporter: Rogelio Prestrol Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.0, 6.1, 6.2 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[14 Dec 2009 17:45] Rogelio Prestrol
Description:
Unable to insert or update. Any insert or update that contains a backslash "\" at the end of the sentence will make the connector crash. Also, if the sentence contains any combination of \' will make the connector crash. There are some other combinations but they all seem to be related to the backslash. This has been reported before.

How to repeat:
INSERT INTO t_table (f_description) VALUES ('\');
INSERT INTO t_table (f_description) VALUES ('Nice''\');

I'm using NO_BACKSLASH_ESCAPES globally.

Suggested fix:
None, can't open the source code. It crashes. This has been reported before.
[14 Dec 2009 20:00] Peter Laursen
I tried with a C-client (SQLyog):

CREATE TABLE `t` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `txt` CHAR(5) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

SET sql_mode = 'NO_BACKSLASH_ESCAPES';
INSERT INTO t (txt) VALUES ('\'); -- success
INSERT INTO t (txt) VALUES ('Nice''\'); -- syntax error 1064

I do not understand what
INSERT INTO t (txt) VALUES ('Nice''\');
.. was supposed to insert really? "Nice'\" ??

Peter
(not a MySQL person)
[21 Dec 2009 9:34] Tonci Grgin
Peter, that's described in Bug#36391 and many other report.
[21 Dec 2009 9:38] Tonci Grgin
Rogelio, as per explanation in Bug#20103, please try using two back-slashes (\\) instead of one and inform me of result.
[21 Dec 2009 9:40] Tonci Grgin
Real problem could be what I described in Bug#49029 (I think it's rather important not to convert binary data to character representation especially when SQL_NO_BACKSLASHES mode is used. \0 converted to 0x00 byte just terminates the string.)
[22 Jan 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".