Bug 511429

Summary: libmysql.dll Crash in Windows 10
Product: [Applications] digikam Reporter: Peter <benedekppeter>
Component: Database-MysqlAssignee: Digikam Developers <digikam-bugs-null>
Status: REPORTED ---    
Severity: crash CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.8.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: DebugView log
Windows 10 Pro Event Log
New debug log
After deleted digikamface database

Description Peter 2025-10-31 13:38:53 UTC
Environment:
One Linux server (samba AD)  and mysql server
Five client, operation system: Windows 10 22H2

Networked clients, the digiKam database is stored on a MySQL server. Clients use the same operating system and the same version.
On one of the clients, the Qt6 version of digiKam 8.8.0 crashes. The Qt5 version works flawlessly on the same client. An error appears in the Windows event log indicating a crash due to libmysql.dll (Windows10_Event_log.jpg). I have attached the DebugView log.
On all other clients, digiKam 8.8.0 Qt6 works flawlessly.
I apologize if I am wasting your time with this, but I don't know how unique this problem is.
Comment 1 Peter 2025-10-31 13:39:28 UTC
Created attachment 186362 [details]
DebugView log
Comment 2 Peter 2025-10-31 13:39:52 UTC
Created attachment 186363 [details]
Windows 10 Pro Event Log
Comment 3 Maik Qualmann 2025-10-31 14:53:59 UTC
Is your MySQL server a MySQL or MariaDB server? Which version are you using?

For a debug log, the Qt debug variable must be set; otherwise, we'll only see warnings. It's best to enable the option for internal debugging in the digiKam setup under Miscellaneous -> System (restart digiKam). Although, I don't think we'll see anything more in the log with this problem.

Maik
Comment 4 Maik Qualmann 2025-10-31 15:01:12 UTC
@Gilles, Qt already has both the QMYSQL and QMARIADB drivers. We will likely need to enable this choice in the setup process in the future. The two projects are drifting further and further apart, although access to MariaDB via the MySQL Connector should still be ensured for now.

Maik
Comment 5 Peter 2025-10-31 15:14:07 UTC
(In reply to Maik Qualmann from comment #3)
> Is your MySQL server a MySQL or MariaDB server? Which version are you using?
> 
> For a debug log, the Qt debug variable must be set; otherwise, we'll only
> see warnings. It's best to enable the option for internal debugging in the
> digiKam setup under Miscellaneous -> System (restart digiKam). Although, I
> don't think we'll see anything more in the log with this problem.
> 
> Maik

Thank you Maik for the reply...
This is a old Ubuntu 18 server and mysql  Ver 14.14 Distrib 5.7.42, for Linux (x86_64)
New debug log is added.
Comment 6 Peter 2025-10-31 15:14:44 UTC
Created attachment 186364 [details]
New debug log
Comment 7 Maik Qualmann 2025-10-31 15:30:43 UTC
The face database cannot be updated because the "context" column no longer exists. This is because the next update step was once incompatible with MySQL (this has since been fixed). Since you have all the databases individually, the best solution is to delete all tables in "digikamface"; digiKam will recreate them.

Maik
Comment 8 caulier.gilles 2025-10-31 16:51:40 UTC
Maik,

I suppose that bot mariadb and mysql QtSql driver are only available for Qt6. Right ?

In all cases i will need to patch AppImage, macOS, and Windows bundles in this way.

Best

Gilles
Comment 9 Peter 2025-10-31 17:04:08 UTC
(In reply to Maik Qualmann from comment #7)
> The face database cannot be updated because the "context" column no longer
> exists. This is because the next update step was once incompatible with
> MySQL (this has since been fixed). Since you have all the databases
> individually, the best solution is to delete all tables in "digikamface";
> digiKam will recreate them.
> 
> Maik

I deleted the entire "digikamface" database and recreated it. Unfortunately, digiKam still crashes. It's possible that there's some issue on this particular computer, as digiKam runs without any Qt6 problems on the other four computers, and using the same MySQL server database.
Comment 10 Peter 2025-10-31 17:16:47 UTC
Created attachment 186365 [details]
After deleted digikamface database
Comment 11 Maik Qualmann 2025-11-01 06:53:18 UTC
At least your face database is now clean.
We probably won't be able to resolve the crash any further at the moment.
Do you have the MySQL client installed? If so, you could try temporarily replacing the digiKam libmysql.dll file.

Maik
Comment 12 caulier.gilles 2025-11-02 11:54:24 UTC
Maik,

From you comment 4, you said that Mysql and Mariadb QtSql driver are split. I don't see this info in the Qt doc :

https://doc.qt.io/qt-6/sql-driver.html#qmysql-for-mysql-or-mariadb-5-6-and-higher

The Qt base config script do not have both backend separated :

https://code.qt.io/cgit/qt/qtbase.git/tree/config_help.txt

Database options:

  -sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
                         db2 ibase mysql oci odbc psql sqlite mimer
                         [all auto]
  -sqlite .............. Select used sqlite [system/qt]  

And it's true that only one driver name "mysql" exists for both :

https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/sqldrivers

So we have 2 solutions : 

1/ Create 2 bundles each time to support both separately, depending of the dependencies passed at Qt configuration.
2/ Create one dedicated sql driver for Mariadb (or Mysql) based on the current one from Qt and make it available in digiKam with the relevant settings adds to the Setup/Database. 

1/ I'm not favorable as it will increase the complexity for the packaging. 
2/ This will require more work but it will safe i think for the future.

Best

Gilles
Comment 13 caulier.gilles 2025-11-02 12:01:59 UTC
Another possibility is to report to the Qt bugzilla a request to have a new QtSql driver for Mariadb, and not just one for both Mysql and MariaDb.

Gilles
Comment 14 Maik Qualmann 2025-11-02 12:38:34 UTC
QSqlDatabase::drivers() includes the MariaDB driver. However, I think that QMYSQL and QMARIADB are currently the same thing.

QList("QMARIADB", "QMYSQL", "QSQLITE")

We shouldn't do anything further at the moment.

Maik
Comment 15 caulier.gilles 2025-12-10 16:52:02 UTC
During Christmas time, i will rebuild the whole digiKam installer from scratch with VCPKG packages updated (opencv, qt, ffmpeg). We will see if the problem remain.

Gilles Caulier
Comment 16 Peter 2025-12-10 17:46:41 UTC
(In reply to caulier.gilles from comment #15)
> During Christmas time, i will rebuild the whole digiKam installer from
> scratch with VCPKG packages updated (opencv, qt, ffmpeg). We will see if the
> problem remain.
> 
> Gilles Caulier

Thank you Gilles! I will test it.