FS#48778 - [qt5-base] QMYSQL driver is not available
Attached to Project:
Arch Linux
Opened by Jonathan Courtois (johnlamericain) - Thursday, 31 March 2016, 21:50 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 14 June 2016, 16:14 GMT
Opened by Jonathan Courtois (johnlamericain) - Thursday, 31 March 2016, 21:50 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 14 June 2016, 16:14 GMT
|
Details
Description:
Since I updated to qt5-base in 5.6.0, my application compiled with that version stop working because the QMYSQL driver can't be found/loaded properly. It's possibly that a mysqldriver was updated with pacman at the same time of 5.6.0 though (there was a mariadb update). This was working correctly with qt5-base 5.5.1 so I wonder if something went wrong during the build? Additional info: * qt5-base 5.6.0-2 * I can't see anything wrong with the .so: 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) Steps to reproduce: QSqlDatabase::isDriverAvailable("QMYSQL") <- return false |
This task depends upon
Closed by Antonio Rojas (arojas)
Tuesday, 14 June 2016, 16:14 GMT
Reason for closing: Fixed
Additional comments about closing: qt5-base 5.6.1-2
Tuesday, 14 June 2016, 16:14 GMT
Reason for closing: Fixed
Additional comments about closing: qt5-base 5.6.1-2
lrwxrwxrwx 1 root root 24 Mar 24 11:27 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 3507712 Mar 24 11:27 libmysqlclient.so.18.0.0
lrwxrwxrwx 1 root root 17 Mar 24 11:27 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx 1 root root 17 Mar 24 11:27 libmysqlclient_r.so.18 -> libmysqlclient.so
lrwxrwxrwx 1 root root 17 Mar 24 11:27 libmysqlclient_r.so.18.0.0 -> libmysqlclient.so
lrwxrwxrwx 1 root root 15 Mar 24 11:27 libmysqld.so -> libmysqld.so.18
-rwxr-xr-x 1 root root 15904536 Mar 24 11:27 libmysqld.so.18
Any advice of where I should look at?
Thanks
Thanks for your reply, I gave another look at it tonight. Basically code working with Qt 5.5.1 doesn't work with Qt 5.6.0.
It's hard to give you some code, but if I don't get anywhere I will try to reproduce this in a small example.
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.
Also notice the QMYSQL3 on the last query error!!!
Any idea? I will keep looking on my side.
Thanks for help.
Could it be that qt5-base 5.6.0 use MySQL driver instead of MariaDB driver like in the past?
I updated to qt5-base 5.6.0-4 but I still can't get MySQL driver working with complex queries as it seems to use QMYSQL3...
https://bugreports.qt.io/browse/QTBUG-53237
https://bugreports.qt.io/browse/QTBUG-53969
The error reported "QMYSQL3: Unable to fetch data" is confusing as I was using QMYSQL plugin.
Thanks for your help, this can be closed.
Apparently there could be a binary intolerance of libmysqlclient 1.8 and 1.6. Qt used version 1.6 to compile but Archlinux has version 1.8 installed.
Thanks for your answer
Yes you are right about libmadiadbclient: https://www.archlinux.org/packages/extra/x86_64/libmariadbclient/:
I'm talking about this plugins in the content of that lib:
usr/lib/libmysqlclient.so
usr/lib/libmysqlclient.so.18
usr/lib/libmysqlclient.so.18.0.0
usr/lib/libmysqlclient_r.so
usr/lib/libmysqlclient_r.so.18
usr/lib/libmysqlclient_r.so.18.0.0
When I do:
ldd /usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so
...
libmysqlclient.so.18 => /usr/lib/libmysqlclient.so.18 (0x00007f24d5eb8000)
...
That's what it was suggested to me in Qt Forum: https://forum.qt.io/topic/66160/unable-to-use-qmysql-driver-on-archlinux-after-migrating-to-qt-5-6-0/16
Thanks
But if you said that Qt is recompiled and linked with libmysqlclient.so.18 on Arch, then it's probably not the problem.
Thank you for this precious information.