slackware-current/source/l/akonadi/akonadi-mariadb-10.2.patch
Patrick J Volkerding 646a5c1cbf Mon May 28 19:12:29 UTC 2018
a/pkgtools-15.0-noarch-13.txz:  Rebuilt.
  installpkg: default line length for --terselength is the number of columns.
  removepkg: added --terse mode.
  upgradepkg: default line length for --terselength is the number of columns.
  upgradepkg: accept -option in addition to --option.
ap/vim-8.1.0026-x86_64-1.txz:  Upgraded.
d/bison-3.0.5-x86_64-1.txz:  Upgraded.
e/emacs-26.1-x86_64-1.txz:  Upgraded.
kde/kopete-4.14.3-x86_64-8.txz:  Rebuilt.
  Recompiled against libidn-1.35.
n/conntrack-tools-1.4.5-x86_64-1.txz:  Upgraded.
n/libnetfilter_conntrack-1.0.7-x86_64-1.txz:  Upgraded.
n/libnftnl-1.1.0-x86_64-1.txz:  Upgraded.
n/links-2.16-x86_64-2.txz:  Rebuilt.
  Rebuilt to enable X driver for -g mode.
n/lynx-2.8.9dev.19-x86_64-1.txz:  Upgraded.
n/nftables-0.8.5-x86_64-1.txz:  Upgraded.
n/p11-kit-0.23.11-x86_64-1.txz:  Upgraded.
n/ulogd-2.0.7-x86_64-1.txz:  Upgraded.
n/whois-5.3.1-x86_64-1.txz:  Upgraded.
xap/network-manager-applet-1.8.12-x86_64-1.txz:  Upgraded.
xap/vim-gvim-8.1.0026-x86_64-1.txz:  Upgraded.
2018-05-31 23:39:35 +02:00

65 lines
2.3 KiB
Diff

commit 22c53fa2aa97c7f0b5d7a1947821c5b3aef9de0f
Author: Heinz Wiesinger <pprkut@liwjatan.at>
Date: Sun Sep 17 15:55:48 2017 +0200
Only remove init connections to the database on server shutdown.
With MariaDB 10.2 libmysqlclient was replaced with libmariadb that
changed how establishing database connections behaves. The MySQL
QSQL driver calls mysql_server_end() on QSqlDatabase::removeDatabase()
if the overall connection count dropped to 0 (which it does when
the init connection is removed).
A future QSqlDatabase:addDatabase() would call mysql_server_init()
again, but this no longer works with libmariadb as that one only
allows calling mysql_server_init() once. Future calls are simply
ignored.
In order to prevent this from happening we have to keep the
init connection open until the server shuts down, so the connection
count only drops to 0 at shutdown and mysql_server_end() isn't
called before.
This is a workaround for QTBUG-63108
diff --git a/server/src/akonadi.cpp b/server/src/akonadi.cpp
index 5369320c8..6d31f6ff4 100644
--- a/server/src/akonadi.cpp
+++ b/server/src/akonadi.cpp
@@ -370,12 +370,13 @@ void AkonadiServer::createDatabase()
db.close();
}
}
- QSqlDatabase::removeDatabase( initCon );
}
void AkonadiServer::stopDatabaseProcess()
{
if ( !DbConfig::configuredDatabase()->useInternalServer() ) {
+ // closing initConnection this late to work around QTBUG-63108
+ QSqlDatabase::removeDatabase(QLatin1String("initConnection"));
return;
}
diff --git a/server/src/storage/dbconfigmysql.cpp b/server/src/storage/dbconfigmysql.cpp
index 10f99db70..36f1f3a42 100644
--- a/server/src/storage/dbconfigmysql.cpp
+++ b/server/src/storage/dbconfigmysql.cpp
@@ -395,8 +395,6 @@ void DbConfigMysql::startInternalServer()
db.close();
}
}
-
- QSqlDatabase::removeDatabase( initCon );
}
void DbConfigMysql::stopInternalServer()
@@ -405,6 +403,9 @@ void DbConfigMysql::stopInternalServer()
return;
}
+ // closing initConnection this late to work around QTBUG-63108
+ QSqlDatabase::removeDatabase(QLatin1String("initConnection"));
+
// first, try the nicest approach
if ( !mCleanServerShutdownCommand.isEmpty() ) {
QProcess::execute( mCleanServerShutdownCommand );