This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 235646 - SQL Editor incorrectly handles escaped \"
Summary: SQL Editor incorrectly handles escaped \"
Status: RESOLVED INVALID
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-08 02:14 UTC by Emmentaler
Modified: 2013-09-09 09:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmentaler 2013-09-08 02:14:59 UTC
The following SQL does not display properly though it is legitimate SQL

INSERT INTO USER_SETTING (USER_ID, SETTINGS)
SELECT ID,"{\"nutrientOrdering\":[{\"text_id\":\"201\", \"order\":1, \"group\":1}]" FROM USER WHERE NAME="GUEST";
Comment 1 matthias42 2013-09-09 09:37:47 UTC
Not is not valid SQL - it is "MySQL-SQL". Standard SQL quotes the quoting sign by repeating it. So this is an example with correct SQL (from "Corrected INSERT" onwards):

-- Prepare example
create table USER (ID integer primary key auto_increment, name varchar(255));
create table USER_SETTING(USER_ID integer, SETTINGS TEXT);

insert into USER VALUES (1, 'GUEST');

-- Corrected INSERT
INSERT INTO USER_SETTING (USER_ID, SETTINGS)
SELECT ID,"{""nutrientOrdering"":[{""text_id"":""201"", ""order"":1, ""group"":1}]" FROM USER WHERE NAME="GUEST";