Bug 364950

Summary: SQL: Handle escape sequences in string literals
Product: [Frameworks and Libraries] KDb Reporter: Jarosław Staniek <staniek>
Component: GeneralAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 3.0.0   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jarosław Staniek 2016-06-30 22:53:33 UTC
Handle escape sequences in string literals: \" \' \n \r \0 etc.

Also:
- \xhh -> character
- \uxxxx -> 16-bit unicode character
- \u{xxxxxx} -> 24-bit unicode "code point"  character, known from JavaScript (ECMAScript 6)

Reproducible: Always
Comment 1 Jarosław Staniek 2016-06-30 22:56:00 UTC
Example: "SELECT \x49\x20\u2665\x20\x53\x51\x4c" returns "I ♥ SQL" :)
Comment 2 Jarosław Staniek 2016-06-30 22:56:30 UTC
(In reply to Jarosław Staniek from comment #1)
> Example: "SELECT \x49\x20\u2665\x20\x53\x51\x4c" returns "I ♥ SQL" :)

Should be: SELECT "\x49\x20\u2665\x20\x53\x51\x4c"
Comment 3 Jarosław Staniek 2016-07-01 09:57:37 UTC
Git commit 75d1b25be0ec92bfee6693fad153d4eb6fa525d9 by Jaroslaw Staniek.
Committed on 01/07/2016 at 09:12.
Pushed by staniek into branch 'escape-sequences-staniek'.

KDbSQL: Handle escape sequences in string literals

Handle escape sequences in string literals: \" \' \n \r \0 etc.

Also:
- \xhh -> character
- \uxxxx -> 16-bit unicode character
- \u{xxxxxx} -> 24-bit unicode "code point" character, known from JavaScript (ECMAScript 6)
- Add autotests

M  +165  -0    autotests/KDbTest.cpp
M  +4    -0    autotests/KDbTest.h
M  +203  -1    src/KDb.cpp
M  +65   -3    src/KDb.h
M  +15   -4    src/parser/KDbSqlScanner.l

http://commits.kde.org/kdb/75d1b25be0ec92bfee6693fad153d4eb6fa525d9
Comment 4 Jarosław Staniek 2016-07-01 09:57:38 UTC
Git commit 172580d30f59f8a14fa9837dab567a257ad2a94f by Jaroslaw Staniek.
Committed on 01/07/2016 at 09:13.
Pushed by staniek into branch 'escape-sequences-staniek'.

GIT_SILENT Update generated scanner code

M  +240  -224  src/parser/generated/sqlscanner.cpp

http://commits.kde.org/kdb/172580d30f59f8a14fa9837dab567a257ad2a94f
Comment 5 Jarosław Staniek 2016-07-18 08:26:28 UTC
Git commit af59e5798139cb917371fa3394146d395a067ea4 by Jaroslaw Staniek.
Committed on 14/07/2016 at 22:17.
Pushed by staniek into branch 'master'.

GIT_SILENT Update generated scanner code

M  +240  -224  src/parser/generated/sqlscanner.cpp

http://commits.kde.org/kdb/af59e5798139cb917371fa3394146d395a067ea4
Comment 6 Jarosław Staniek 2016-07-18 08:28:07 UTC
Git commit f4371019f27be94a28390ffb2b9ef4f0199f1abe by Jaroslaw Staniek.
Committed on 14/07/2016 at 22:17.
Pushed by staniek into branch 'master'.

KDbSQL: Handle escape sequences in string literals

Handle escape sequences in string literals: \" \' \n \r \0 etc.

Also:
- \xhh -> character
- \uxxxx -> 16-bit unicode character
- \u{xxxxxx} -> 24-bit unicode "code point" character, known from JavaScript (ECMAScript 6)
- Add autotests

M  +165  -0    autotests/KDbTest.cpp
M  +4    -0    autotests/KDbTest.h
M  +203  -1    src/KDb.cpp
M  +65   -3    src/KDb.h
M  +15   -4    src/parser/KDbSqlScanner.l

http://commits.kde.org/kdb/f4371019f27be94a28390ffb2b9ef4f0199f1abe