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

sqlite error codes when opening/closing databases are discarded

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.11.1
    • Fix Version/s: None
    • Component/s: SQL Support
    • Labels:
      None
    • Commits:
      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

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

          Activity

            People

            Assignee:
            the compiler Florian Bruhin
            Reporter:
            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