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

QSqlTableModel.submitAll() problems with milliseconds and PostgreSQL time field

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.1
    • 4.5.3
    • SQL Support
    • None
    • 91c09562ed9c6eb1bd3a4dbd84a8cc64647751ee

    Description

      If I create a PostgreSQL database 'test' and execute the following:
      CREATE TABLE timetest ( t time );
      INSERT INTO timetest VALUES ('0:0:0');

      then run the attached test program (derived from qt demo) the output is:

      Model value: "00:00:00.000"
      Post setData: "00:12:34.500"
      Post submitAll: "00:12:34.000"

      The database doesn't get the 500 milliseconds.

      Even worse if I execute on the database:
      UPDATE timetest SET t = '0:11:22.33';

      and run the test program:
      Model value: "00:11:22.330"
      Post setData: "00:12:34.500"
      Post submitAll: "00:11:22.330"

      the value from the model doesn't make it into the database at all if the
      time field already has milliseconds.

      Linux amd64, postgresql-8.4.1

      Attachments

        1. connection.h
          3 kB
        2. cppdbdev.cpp
          0.8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            cjm Chris Mayo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes