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

Jarosław Staniek noreply at phabricator.kde.org
Mon Dec 31 20:20:50 GMT 2018


staniek added inline comments.

INLINE COMMENTS

> piggz wrote in KDbUtils.cpp:147
> whats this QDate(0,1,2) ?

It's not part of this patch but here's the answer: https://phabricator.kde.org/source/kdb/browse/master/src/tools/KDbUtils.h$57

From Qt docs:

  QTime::QTime()
  Constructs a null time object. A null time can be a QTime(0, 0, 0, 0) (i.e., midnight) object, except that isNull() returns true and isValid() returns false.

This commit describes the workaround: https://phabricator.kde.org/R15:21e8a3da84165d610c7ba472e43b60e1fc43b172

Otherwise in quite a few places we would have to check not only isNull but also isValid to know time valid is really null. That would be error-prone.

PS: (related to this entire Date patch): The new classes KDb(Date)(Time) go much further because they are part of the parse tree. They can properly store invalid date/time elements of any kind so there's no loosing of information. This e.g. allows the user to reopen SQL and edit it. With regular Qt classes invalid values, say, in "SELECT #2018-12-37#" would turn to "SELECT NULL" or "SELECT <INVALID_DATE>" when query text is reopened.

REPOSITORY
  R15 KDb

BRANCH
  393094-date-constants

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

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


More information about the Kexi-devel mailing list