Restore support for date/time constants in KEXI SQL
Merge branch '393094-date-constants-3.2' into 3.2 - Add Date/Time classes for precise type support - Add autotests for the KDb date/time classes - Add support for the Date/Time constants in the SQL parser - improve lexer too - obsolete previous approach for SQL default date support - and for SQLite, add new APIs for converting date/times https://community.kde.org/Kexi/Plugins/Queries/SQL_Constants - Add autotests for date/time related KDBSQL statements BUG:393094 KDb VERSION -> 3.2.0 Beta 1 Test Plan: Precondition: KDb branch: 393094-date-constants against 3.2 branch, KEXI branch 393094-date-constants (D17847) 0. Run KDb autotests Expected: 100% passes 1. Open a new design in KEXI Query Designer. Note: Visual designer does not support these constants, use the SQL view. 2. Type a number of statements involving Date, Time and Date/Time constants You can use test cases from autotests/parser/data/statements.txt, sections: - Date Constants (KDbSQL EXTENSION) - Time Constants (KDbSQL EXTENSION) - Date/Time Constants (KDbSQL EXTENSION) Use the Check Query button to try both valid and invalid constants. For example "SELECT #12:13:01#" should work and "SELECT #2018-11-37#" should be rejected as invalid constant. Expected: Valid constants should be accepted and then data view should work, there should be warning for invalid constants. Expected: Saving of both valid and invalid statements should be possible in the SQL view. {F6453115} 3. Create table with columns of type date, time and date/time and add some records. 4. Open a new design in Query SQL Designer, create statements involving both constants and columns e.g. SELECT #12:13:01# AS expr1, timecolumn FROM table where table.timecolumn < #2018-11-37# Expected: valid statement, the Data view works. {F6453113} 5. Test all of the above for SQLite, pgsql, mysql. Differential Revision: https://phabricator.kde.org/D17336
Please register or sign in to comment