blob: fcd4d128823e4ffec61818a41ec151c7c46f0510 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
qt-bugs@ issue : N217716
Trolltech task ID : 217788
bugs.kde.org number : no report
applied: no
author: Tobias Koenig <tokoe@kde.org>
This patch will fix the handling of connections to
mysql server in a multithreaded environment
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -1252,6 +1252,10 @@ bool QMYSQLDriver::open(const QString& d
d->preparedQuerysEnabled = false;
#endif
+#ifndef QT_NO_THREAD
+ mysql_thread_init();
+#endif
+
setOpen(true);
setOpenError(false);
return true;
@@ -1260,6 +1264,9 @@ bool QMYSQLDriver::open(const QString& d
void QMYSQLDriver::close()
{
if (isOpen()) {
+#ifndef QT_NO_THREAD
+ mysql_thread_end();
+#endif
mysql_close(d->mysql);
d->mysql = NULL;
setOpen(false);
|