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

sqlite error codes when opening/closing databases are discarded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.11.1
    • SQL Support
    • None
    • 49efea26a5fae8c2275999c36c7c8d24cf4125de

    Description

      When an error happens while opening/closing a database, the QSqlError::nativeErrorCode() is always -1 because the return values from sqlite3_open_v2() and sqlite3_close() aren't passed to qMakeError() in qsql_sqlite.cpp.

      Additionally, the error string is read after d->access was already set to 0, so the error string returned from sqlite is always "out of memory" no matter what the error actually was.

      Looks like this has been that way since Qt 4.5 already (where git history ends), but I don't see a reason why it should be. I can follow up with a patch, but I just realized it's already 2am here

      Attachments

        For Gerrit Dashboard: QTBUG-70506
        # Subject Branch Project Status CR V

        Activity

          People

            the compiler Florian Bruhin
            the compiler Florian Bruhin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes