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

QSqlDatabase::open always returns true with QMYSQL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.1
    • 5.5.1
    • SQL Support
    • None
    • OS X 10.8
    • 0de6c52bfe2433eca768a5f6fe9d5f08a545c254

    Description

      While using the QMYSQL plugin, open always returns true even if the server is unreachable (e.g. not running)

      QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
      db.setHostName("unreachable");
      db.setPort(3306);
      db.setDatabaseName("test");
      db.setUserName("username");
      db.setPassword("password");
      if (!db.open()) {
          qDebug() << "Failed to open database" << db.lastError().databaseText();
      } else {
          qDebug() << "Success";
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              sgaist Samuel Gaist
              sgaist Samuel Gaist
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes