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

QSqlError::text() returns space for successfull SQLite query

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.14.0 Alpha
    • 5.9.7, 5.12.2
    • SQL Support
    • None
    • Debian 9 (stretch) amd64
      Windows 10 amd64
      Qt from Online Installer
    • Linux/X11, Windows
    • b58c723404594d04f0b31b425da77b4fcbeec3b9 (qt/qtbase/dev)

    Description

      Try this example application:

      #include <QDebug>
      #include <QSqlDatabase>
      #include <QSqlError>
      #include <QSqlQuery>
      #include <QString>
      
      int main()
      {
          QSqlDatabase db{QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"))};
          db.setDatabaseName(QStringLiteral(":memory:"));
          if (!db.open())
              qFatal("%s", qPrintable(db.lastError().text()));
      
          QSqlQuery q{db};
          q.exec(QStringLiteral("SELECT 1"));
          const QString error{q.lastError().text()};
          qDebug() << error;
      }
      
      

      It prints:

      " "
      

      Attachments

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

        Activity

          People

            talkless Vincas Dargis
            talkless Vincas Dargis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes