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

numericalPrecisionPolicy not copied in QSqlDatabase::cloneDatabase()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.0
    • 4.6.2, 5.5.0
    • SQL Support
    • None
    • > qmake --version
      QMake version 2.01a
      Using Qt version 4.6.2 in /home/development/64-bit/qt-4.6.2/install/lib
    • c4ba2b1c70218f76366575ee7e6d90eb99efbb08

    Description

      As in the summary above: QSqlDatabase::cloneDatabase does not copy numericalPrecisionPolicy. I attach a sample code, which leads to:

      > ./numericalPrecisionPolicy_during_cloning
      db numericalPrecisionPolicy:  0
      driver numericalPrecisionPolicy:  0
      db2 numericalPrecisionPolicy:  4
      driver2 numericalPrecisionPolicy:  4
      

      It's kind of OK in a sense that docs do not promise explicitly that the new connection will have the same precision policy, but I think it is not an expected behaviour (one would expect that the cloned database will have as many connection features the same as the old db as possible).

      In my opinion - low priority, because one can add herself/himself a call:

      	_db2.setNumericalPrecisionPolicy(_database.numericalPrecisionPolicy());
      

      (where _db2 is the cloned db, and _database is the original database) just after cloning the db connection, but still it would make more sense to have this as a part of standard cloneDatabase(), I think (and if someone does not notice this, she/he will have hard time trying to figure out why the cloned connection leads to results seemingly different from the results from the original connection to the same database...).

      Attachments

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

        Activity

          People

            andysh Andy Shaw
            wiecko Marek Wieckowski
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes