summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch')
-rw-r--r--kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch b/kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch
new file mode 100644
index 000000000000..c26d3d993b2b
--- /dev/null
+++ b/kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch
@@ -0,0 +1,44 @@
+From 8b8db29d10b2ef92deb2d87ff613f3d7f39af34e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
+Date: Fri, 26 Jul 2019 13:31:58 +0200
+Subject: Fix compatibility with QMYSQL driver after 74aed95
+
+Summary:
+QPSQL requires the table name passed to QSqlDatabase::record() to be lowercase
+since Qt 5.13, but doing that breaks QMYSQL, so only adjust the name when
+using QPSQL.
+
+CCBUG: 409234
+
+Reviewers: #kde_pim, vkrause
+
+Reviewed By: #kde_pim, vkrause
+
+Subscribers: kde-pim
+
+Tags: #kde_pim
+
+Differential Revision: https://phabricator.kde.org/D22677
+---
+ src/server/storage/dbintrospector.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/server/storage/dbintrospector.cpp b/src/server/storage/dbintrospector.cpp
+index 70d952a..932444c 100644
+--- a/src/server/storage/dbintrospector.cpp
++++ b/src/server/storage/dbintrospector.cpp
+@@ -76,7 +76,10 @@ bool DbIntrospector::hasColumn(const QString &tableName, const QString &columnNa
+ QStringList columns = m_columnCache.value(tableName);
+
+ if (columns.isEmpty()) {
+- const QSqlRecord table = m_database.record(tableName.toLower());
++ // QPSQL requires the name to be lower case, but it breaks compatibility with existing
++ // tables with other drivers (see BKO#409234). Yay for abstraction...
++ const auto name = (DbType::type(m_database) == DbType::PostgreSQL) ? tableName.toLower() : tableName;
++ const QSqlRecord table = m_database.record(name);
+ const int numTables = table.count();
+ columns.reserve(numTables);
+ for (int i = 0; i < numTables; ++i) {
+--
+cgit v1.1
+