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. Unable to use QMYSQL driver on ArchLinux after migrating to Qt 5.6.0
Forum Updated to NodeBB v4.3 + New Features

Unable to use QMYSQL driver on ArchLinux after migrating to Qt 5.6.0

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
17 Posts 3 Posters 5.0k Views 2 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.
  • J Offline
    J Offline
    johnlamericain
    wrote on 17 Apr 2016, 22:11 last edited by
    #1

    Hi everyone,

    I updated the packages of Archlinux (qt5-base) from Qt 5.5.1 to Qt 5.6.0 and since then I can't use SQL request with UNION, it looks like my server doesn't load properly QMYSQL but instead use QMYSQL3.

    A similar issue was reported years ago: Project is using QMYSQL3 instead of QMYSQL?

    The function QSqlDatabase::drivers() return when starting the server:
    ("QIBASE", "QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7", "QTDS", "QTDS7")

    I create a my database this way:

    m_mainDatabase = new QSqlDatabase(QSqlDatabase::addDatabase("QMYSQL", m_mainDBName));
    dsInitLog(QString("Driver name for main database: %1").arg(m_mainDatabase->driverName()));
    

    This return: "Driver name for main database: QMYSQL"

    But then when I do when of the select that try to access query.next(), it fails (when previous select worked strangely):

    Here is my code and my logs, maybe you could see something wrong. This works fine with Qt 5.5.1 on ArchLinux

    // Code

    dsLog(getLastExecutedQuery(query));
    if (query.size() == 1)
    {
    dsLog(QString("query select: %1").arg(query.isSelect()));
    int resultNext = query.next();
    dsLog(QString("query next: %1").arg(resultNext));
    dsLog(QString("query valid: %1").arg(query.isValid()));
    dsLog(QString("Last query error: %1").arg(query.lastError().text()));
    DSConnection::UserInfo currentUserInfo;
    currentUserInfo.idPackage = query.value(0).toULongLong();
    currentUserInfo.beginOfServices = query.value(1).toDate();
    [...]
    }
    

    // Logs

    virtual DSBaseMessage* DSServerStartupMessage::exec(DSSocket&)
    "SELECT `id_package`, `begin_of_services`, `new_month`, `end_of_services`, `space_max`, `bandwidth_used`, `bandwidth_max`, `enable_authentication`, `id_disk` FROM `USERS_INFOS` WHERE `id_user` = 1"
    virtual DSBaseMessage* DSServerStartupMessage::exec(DSSocket&)
    "query select: 1"
    virtual DSBaseMessage* DSServerStartupMessage::exec(DSSocket&)
    "query next: 0"
    virtual DSBaseMessage* DSServerStartupMessage::exec(DSSocket&)
    "query valid: 0"
    virtual DSBaseMessage* DSServerStartupMessage::exec(DSSocket&)
    "Last query error: QMYSQL3: Unable to fetch data"
    QSqlQuery::value: not positioned on a valid record
    QSqlQuery::value: not positioned on a valid record
    
    

    This query return a result on phpMyAdmin.

    Any help appreciated, thanks a lot.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 17 Apr 2016, 22:17 last edited by
      #2

      Hi,

      You should run ldd on the MySQL plugin to see if you don't have a library mismatch there.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply 18 Apr 2016, 08:11
      0
      • S SGaist
        17 Apr 2016, 22:17

        Hi,

        You should run ldd on the MySQL plugin to see if you don't have a library mismatch there.

        J Offline
        J Offline
        johnlamericain
        wrote on 18 Apr 2016, 08:11 last edited by
        #3

        @SGaist I did but no obvious error there:

        ldd /usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so
        linux-vdso.so.1 (0x00007fffb9fff000)
        libmysqlclient.so.18 => /usr/lib/libmysqlclient.so.18 (0x00007f24d5eb8000)
        libQt5Sql.so.5 => /usr/lib/libQt5Sql.so.5 (0x00007f24d5c71000)
        libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007f24d55a7000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f24d5224000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f24d4e83000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f24d4c6d000)
        libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007f24d49fb000)
        libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f24d4584000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f24d4380000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f24d4162000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007f24d3e5d000)
        libicui18n.so.56 => /usr/lib/libicui18n.so.56 (0x00007f24d39e1000)
        libicuuc.so.56 => /usr/lib/libicuuc.so.56 (0x00007f24d3649000)
        libpcre16.so.0 => /usr/lib/libpcre16.so.0 (0x00007f24d33e3000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f24d30d5000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007f24d2ecc000)
        libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f24d2e46000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f24d2c30000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007f24d6640000)
        libicudata.so.56 => /usr/lib/libicudata.so.56 (0x00007f24d124c000)
        libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f24d0fdc000)
        libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f24d0dd7000)
        libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f24d0bc0000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f24d099a000)
        liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f24d0787000)
        libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f24d04a5000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f24d0291000)
        
        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 18 Apr 2016, 21:08 last edited by
          #4

          Which version of MySQL are you running ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply 19 Apr 2016, 12:13
          0
          • S SGaist
            18 Apr 2016, 21:08

            Which version of MySQL are you running ?

            J Offline
            J Offline
            johnlamericain
            wrote on 19 Apr 2016, 12:13 last edited by
            #5

            @SGaist Is it this you are referring to: libmariadbclient 10.1.13-1 (https://www.archlinux.org/packages/extra/i686/libmariadbclient/)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 19 Apr 2016, 20:00 last edited by
              #6

              Did that part also change when you updated your Qt version ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply 19 Apr 2016, 21:35
              0
              • S SGaist
                19 Apr 2016, 20:00

                Did that part also change when you updated your Qt version ?

                J Offline
                J Offline
                johnlamericain
                wrote on 19 Apr 2016, 21:35 last edited by
                #7

                @SGaist Yes it did the first time from 10.1.12 to 10.1.13.

                But strangely when I rollback only qt5 packages to Qt 5.5.1, then it works again.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 19 Apr 2016, 21:52 last edited by
                  #8

                  Can you check the output you get from your application when running it with QT_DEBUG_PLUGINS=1 defined ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  J 1 Reply Last reply 19 Apr 2016, 22:00
                  0
                  • S SGaist
                    19 Apr 2016, 21:52

                    Can you check the output you get from your application when running it with QT_DEBUG_PLUGINS=1 defined ?

                    J Offline
                    J Offline
                    johnlamericain
                    wrote on 19 Apr 2016, 22:00 last edited by
                    #9

                    @SGaist Here is the result:

                    [dev@preprod binserver]$ export QT_DEBUG_PLUGINS=1
                    [dev@preprod binserver]$ ./DSServer
                    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/sqldrivers" ...
                    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlibase.so"
                    Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlibase.so, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QIBASE"
                            ]
                        },
                        "className": "QIBaseDriverPlugin",
                        "debug": false,
                        "version": 329216
                    }
                    
                    
                    Got keys from plugin meta data ("QIBASE")
                    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlite.so"
                    Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlite.so, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QSQLITE"
                            ]
                        },
                        "className": "QSQLiteDriverPlugin",
                        "debug": false,
                        "version": 329216
                    }
                    
                    
                    Got keys from plugin meta data ("QSQLITE")
                    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so"
                    Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QMYSQL3",
                                "QMYSQL"
                            ]
                        },
                        "className": "QMYSQLDriverPlugin",
                        "debug": false,
                        "version": 329216
                    }
                    
                    
                    Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
                    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlodbc.so"
                    Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlodbc.so, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QODBC3",
                                "QODBC"
                            ]
                        },
                        "className": "QODBCDriverPlugin",
                        "debug": false,
                        "version": 329216
                    }
                    
                    
                    Got keys from plugin meta data ("QODBC3", "QODBC")
                    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlpsql.so"
                    Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlpsql.so, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QPSQL7",
                                "QPSQL"
                            ]
                        },
                        "className": "QPSQLDriverPlugin",
                        "debug": false,
                        "version": 329216
                    }
                    
                    
                    Got keys from plugin meta data ("QPSQL7", "QPSQL")
                    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqltds.so"
                    Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqltds.so, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QTDS7",
                                "QTDS"
                            ]
                        },
                        "className": "QTDSDriverPlugin",
                        "debug": false,
                        "version": 329216
                    }
                    
                    
                    Got keys from plugin meta data ("QTDS7", "QTDS")
                    QFactoryLoader::QFactoryLoader() checking directory path "/home/dev/binserver/sqldrivers" ...
                    loaded library "/usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so"
                    Found metadata in lib /home/dev/binserver/plugins/libdscommunityserver.so, metadata=
                    {
                        "IID": "com.dsbrowser.DSPluginLoaderInterface",
                        "MetaData": {
                        },
                        "className": "DSPluginCommunityServer",
                        "debug": false,
                        "version": 329216
                    }
                    
                    J 1 Reply Last reply 20 Apr 2016, 21:48
                    0
                    • J johnlamericain
                      19 Apr 2016, 22:00

                      @SGaist Here is the result:

                      [dev@preprod binserver]$ export QT_DEBUG_PLUGINS=1
                      [dev@preprod binserver]$ ./DSServer
                      QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/sqldrivers" ...
                      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlibase.so"
                      Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlibase.so, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QIBASE"
                              ]
                          },
                          "className": "QIBaseDriverPlugin",
                          "debug": false,
                          "version": 329216
                      }
                      
                      
                      Got keys from plugin meta data ("QIBASE")
                      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlite.so"
                      Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlite.so, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QSQLITE"
                              ]
                          },
                          "className": "QSQLiteDriverPlugin",
                          "debug": false,
                          "version": 329216
                      }
                      
                      
                      Got keys from plugin meta data ("QSQLITE")
                      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so"
                      Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QMYSQL3",
                                  "QMYSQL"
                              ]
                          },
                          "className": "QMYSQLDriverPlugin",
                          "debug": false,
                          "version": 329216
                      }
                      
                      
                      Got keys from plugin meta data ("QMYSQL3", "QMYSQL")
                      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlodbc.so"
                      Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlodbc.so, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QODBC3",
                                  "QODBC"
                              ]
                          },
                          "className": "QODBCDriverPlugin",
                          "debug": false,
                          "version": 329216
                      }
                      
                      
                      Got keys from plugin meta data ("QODBC3", "QODBC")
                      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqlpsql.so"
                      Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqlpsql.so, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QPSQL7",
                                  "QPSQL"
                              ]
                          },
                          "className": "QPSQLDriverPlugin",
                          "debug": false,
                          "version": 329216
                      }
                      
                      
                      Got keys from plugin meta data ("QPSQL7", "QPSQL")
                      QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/sqldrivers/libqsqltds.so"
                      Found metadata in lib /usr/lib/qt/plugins/sqldrivers/libqsqltds.so, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QTDS7",
                                  "QTDS"
                              ]
                          },
                          "className": "QTDSDriverPlugin",
                          "debug": false,
                          "version": 329216
                      }
                      
                      
                      Got keys from plugin meta data ("QTDS7", "QTDS")
                      QFactoryLoader::QFactoryLoader() checking directory path "/home/dev/binserver/sqldrivers" ...
                      loaded library "/usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so"
                      Found metadata in lib /home/dev/binserver/plugins/libdscommunityserver.so, metadata=
                      {
                          "IID": "com.dsbrowser.DSPluginLoaderInterface",
                          "MetaData": {
                          },
                          "className": "DSPluginCommunityServer",
                          "debug": false,
                          "version": 329216
                      }
                      
                      J Offline
                      J Offline
                      johnlamericain
                      wrote on 20 Apr 2016, 21:48 last edited by
                      #10

                      @SGaist Does that seems correct?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 20 Apr 2016, 22:13 last edited by
                        #11

                        At first sight nothing wrong there.

                        Can you do some test building your own version of the MySQL plugin ?

                        The plugin hasn't had many commits recently so it might be easy to determine if something broke there between 5.5.1 and 5.6.0

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        J 2 Replies Last reply 20 Apr 2016, 22:15
                        0
                        • S SGaist
                          20 Apr 2016, 22:13

                          At first sight nothing wrong there.

                          Can you do some test building your own version of the MySQL plugin ?

                          The plugin hasn't had many commits recently so it might be easy to determine if something broke there between 5.5.1 and 5.6.0

                          J Offline
                          J Offline
                          johnlamericain
                          wrote on 20 Apr 2016, 22:15 last edited by
                          #12

                          @SGaist Well I never done it so I don't know where to start?

                          1 Reply Last reply
                          0
                          • S SGaist
                            20 Apr 2016, 22:13

                            At first sight nothing wrong there.

                            Can you do some test building your own version of the MySQL plugin ?

                            The plugin hasn't had many commits recently so it might be easy to determine if something broke there between 5.5.1 and 5.6.0

                            J Offline
                            J Offline
                            johnlamericain
                            wrote on 20 Apr 2016, 22:17 last edited by
                            #13

                            @SGaist I also posted on Archlinux without much reply, but the maintainer said it works for him on another project: https://bugs.archlinux.org/task/48778

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 21 Apr 2016, 21:07 last edited by
                              #14

                              You have to clone the qtbase module and from there you can either use git bisect or since there's only handful of commits, checkout the commit before any that changed the plugin code.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • J Offline
                                J Offline
                                johnlamericain
                                wrote on 11 Jun 2016, 10:49 last edited by
                                #15

                                After further investigation today, this appears to be a bug in Qt, QSqlQuery doesn't work with UNSIGNED values: https://bugreports.qt.io/browse/QTBUG-53237

                                1 Reply Last reply
                                0
                                • Hamed.MasafiH Offline
                                  Hamed.MasafiH Offline
                                  Hamed.Masafi
                                  wrote on 12 Jun 2016, 05:48 last edited by
                                  #16

                                  This error occurs due to binary intolerance of libmysqlclient version 1.8 and 1.6. Qt used version 1.6 to compile but you have version 1.6 installed.
                                  Solution: make MySql plugin manually.

                                  Remote object sharing (OO RPC)
                                  http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

                                  Advanced, Powerful and easy to use ORM for Qt5
                                  https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

                                  J 1 Reply Last reply 12 Jun 2016, 10:58
                                  0
                                  • Hamed.MasafiH Hamed.Masafi
                                    12 Jun 2016, 05:48

                                    This error occurs due to binary intolerance of libmysqlclient version 1.8 and 1.6. Qt used version 1.6 to compile but you have version 1.6 installed.
                                    Solution: make MySql plugin manually.

                                    J Offline
                                    J Offline
                                    johnlamericain
                                    wrote on 12 Jun 2016, 10:58 last edited by
                                    #17

                                    @Hamed.Masafi I'm on Archlinux which is a Rolling release, so indeed the version of libmysqlclient update quickly, but I would assume that the people that package qt5-base are compiling Qt with the current version available: https://www.archlinux.org/packages/extra/x86_64/qt5-base/ & https://www.archlinux.org/packages/extra/x86_64/libmariadbclient/

                                    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