Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32858

Bug in QIBASE (always returns 00:00:00.000 as time part of TIMESTAMP)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 5.1.0
    • SQL Support
    • None
    • Win 7 64-bit, Qt 5.1, Firebird 2.5 (x32).

    Description

      Ibase driver returns wrong value as time part of TIMESTAMP.

      Issue reported in:
      https://bugreports.qt-project.org/browse/QTBUG-29261

      This patch (from https://bugreports.qt-project.org/browse/QTBUG-29261):
      --------------------
      static QDateTime fromTimeStamp(char *buffer)
      {
      static const QDate bd(1858, 11, 17);
      QTime t(0, 0, 0);//########## should be fixed like this to pass on isValid()
      QDate d;

      // have to demangle the structure ourselves because isc_decode_time
      // strips the msecs
      t = t.addMSecs(int(((ISC_TIMESTAMP*)buffer)->timestamp_time / 10));
      d = bd.addDays(int(((ISC_TIMESTAMP*)buffer)->timestamp_date));

      return QDateTime(d, t);
      }
      --------------------

      is fully correct.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mabrand Mark Brand
            kittyhawk Bohdan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes