Bug 339746 - Add support for hexadecimal numeric literals in queries
Summary: Add support for hexadecimal numeric literals in queries
Status: CONFIRMED
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: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-10-07 11:02 UTC by Jarosław Staniek
Modified: 2016-11-01 21:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarosław Staniek 2014-10-07 11:02:15 UTC
Add support for hexadecimal numeric literals in queries, like this: http://www.sqlite.org/lang_expr.html#hexint



Reproducible: Always




Notes:
The task consists of 3 parts at least:
1. Alter KexiDB parser to accept the hex notation
2. Alter respective *Expression class so the integer constant keeps the information that the hex notation should be used.
3. Ported the code to Predicate as well (http://community.kde.org/Predicate) with suitable unit test.

When SQL statement is generated (from the abstract syntax tree - *Expression objects), decimal constant should be generated instead of hex. The reason is: avoid depending on hex number support when it's unnecessary. For example SQLite supports the constants in 3.8.6+ so there is no point in risking breakage for older SQLite's by sending the numbers as hex.