Details
-
Bug
-
Resolution: Incomplete
-
P4: Low
-
None
-
5.7.0
-
None
Description
This is related to the existing bug QTBUG-31468:
Per http://dev.mysql.com/doc/refman/5.7/en/mysql-library-init.html
You must either call mysql_library_init() prior to spawning any threads, or else use a mutex to protect the call, whether you invoke mysql_library_init() or indirectly through mysql_init(). Do this prior to any other client library call.
So in addition to not being thread-safe per QTBUG-31468, if an application calls addDatabase() for the first time on a thread, the init() can fail in a quite inscrutable way - see http://stackoverflow.com/q/38343945/1296734
Until the plugin can be fixed, can the docs be updated to warn about this gotcha?
Attachments
Issue Links
- relates to
-
QTBUG-31468 QSqlDatabase::addDatabase calls mysql api mysql_library_init(), which is not thread safe
- Closed