Bug 339746

Summary: Add support for hexadecimal numeric literals in queries
Product: [Frameworks and Libraries] KDb Reporter: Jarosław Staniek <staniek>
Component: GeneralAssignee: Jarosław Staniek <staniek>
Status: CONFIRMED ---    
Severity: wishlist Keywords: junior-jobs
Priority: NOR    
Version: 3.0.0   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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.