Bug 364950 - SQL: Handle escape sequences in string literals
Summary: SQL: Handle escape sequences in string literals
Status: CLOSED FIXED
Alias: None
Product: KDb
Classification: Frameworks and Libraries
Component: General (show other bugs)
Version: 3.0.0
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: Jarosław Staniek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-30 22:53 UTC by Jarosław Staniek
Modified: 2023-09-03 20:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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