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

With MySQL version > 50000 the QMYSQLDriver::tables() returns tables in all databases on the server

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.4
    • 4.6.2
    • SQL Support
    • None
    • c0ca29efdeb442a6b88ccadff409e3f7ef828ce8

    Description

      Expected would be that only tables in the database we are currently connected to are listed.


      Example reproducing the problem
      #include <QtCore>
      #include <QtSql>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication app(argc, argv);
      
          QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
          db.setHostName("localhost");
          db.setDatabaseName("nic");
          db.open("", "");
      
          if (db.isOpen())
              foreach(QString str, db.tables())
                  qDebug() << str;
          else
              qDebug() << db.lastError().text();
      
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            charles Charles Yin (closed Nokia identity) (Inactive)
            mpejcoch Martin Pejcoch (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes