Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Project is using QMYSQL3 instead of QMYSQL?

Project is using QMYSQL3 instead of QMYSQL?

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dafky2000
    wrote on last edited by
    #1

    I am having troubles retrieving results from a UNION query, it appears that someone else has had this issue in the past (http://permalink.gmane.org/gmane.comp.lib.qt.general/31200). I am not sure why it is loading QMYSQL3 but the link suggested that unions are not supported in QMYSQL3, is this true? I can substitute my query with any non-union query and it works fine, so the rest of the prepare/bind/execute code must be fine.. I have tried building from source as well as using the binary repositories, but neither fix my issue...

    @ QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL", "connection1");
    db.setHostName("-----");
    db.setUserName("-----");
    db.setPassword("-----");
    db.setPort(3306);
    db.setDatabaseName("-----");
    QSqlQuery query = QSqlQuery(db);
    query.prepare("large query with 1 UNION ALL)");
    query.addBindValue(98);
    query.exec();
    query.size(); // == 1
    query.first(); // == false
    query.next(); // == false
    query.lastError(); // == "QMYSQL3: Unable to fetch data"@

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dafky2000
      wrote on last edited by
      #2

      This was fixed by using the MariaDB driver instead of the MySQL... Not sure why this would fix it but it did!

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dafky2000
        wrote on last edited by
        #3

        This was fixed by using the MariaDB driver instead of the MySQL... Not sure why this would fix it but it did!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved