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

QOCI: QSqlQuery::bindValue(QDate) fails to selected a previously inserted value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.12, 6.8.3
    • SQL Support
    • Linux/X11

      When running Qt6.8.or Qt5.15.12 in germany, QSqlQuery::bindValue handles QDate differently for insert and select (or delete) queries.
      (The issue might be restricted to the Oracle QOCI plugin. Using sqlite the code works.)

      Consider the dates
         QDate date_summer(2025,10,24);
      and
         QDate date_winter(2025,10,28);

      Inserting those works fine.
      But selecting for those dates does not work for date_summer.
      Qt selects 2025-10-23 23:00:00 instead of 2025-10-24.

      The reason seems to be that on 2025-10-26 Germany switched to
      winter time (i.e. UTC+1 instead of UTC+2).

      The attached code illustrates the issue:
      the first find does not find a record for 2025-10-24, after
      inserting 2025-10-23 23:00:00 the find for 2025-10-24 finds the record for 2025-10 23:00:00.

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

            chehrlic Christian Ehrlicher
            caduel74 Christoph Duelli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes