D17336: Restore support for date/time constants in KEXI SQL

Jarosław Staniek noreply at phabricator.kde.org
Mon Dec 3 16:12:59 GMT 2018


staniek created this revision.
staniek added a reviewer: piggz.
Herald added a project: KDb.
Herald added a subscriber: Kexi-Devel-list.
staniek requested review of this revision.

REVISION SUMMARY
  KDb VERSION -> 3.1.1
  
  - 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

TEST PLAN
  Precondition: Only the KDb patch needed, no changes in KEXI.
  
  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.
  
  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.

REPOSITORY
  R15 KDb

BRANCH
  393094-date-constants

REVISION DETAIL
  https://phabricator.kde.org/D17336

AFFECTED FILES
  CMakeLists.txt
  autotests/CMakeLists.txt
  autotests/DateTimeTest.cpp
  autotests/DateTimeTest.h
  autotests/ExpressionsTest.cpp
  autotests/parser/data/statements.txt
  src/CMakeLists.txt
  src/KDb.cpp
  src/KDb.h
  src/KDbDateTime.cpp
  src/KDbDateTime.h
  src/KDbDriver.cpp
  src/KDbDriver.h
  src/KDbField.cpp
  src/KDbQuerySchema.cpp
  src/KDb_p.h
  src/drivers/postgresql/PostgresqlCursor.cpp
  src/drivers/sqlite/SqliteCursor.cpp
  src/drivers/sqlite/SqlitePreparedStatement.cpp
  src/expression/KDbConstExpression.cpp
  src/parser/KDbParser.cpp
  src/parser/KDbParser.h
  src/parser/KDbSqlParser.y
  src/parser/KDbSqlScanner.l
  src/parser/generate_parser_code.sh
  src/parser/generated/KDbToken.cpp
  src/parser/generated/KDbToken.h
  src/parser/generated/sqlparser.cpp
  src/parser/generated/sqlparser.h
  src/parser/generated/sqlscanner.cpp
  src/tools/KDbUtils.cpp

To: staniek, piggz
Cc: Kexi-Devel-list, barman, wicik, staniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kexi-devel/attachments/20181203/17fbb7a0/attachment.html>


More information about the Kexi-devel mailing list