Commit 74aed954 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Adapt DBInitializer to behavior change of QPSQL driver in Qt 5.13

Summary:
Since Qt 5.13 the QPSQL driver escapes table names, which makes them
case-sensitive, therefore QSqlDatabase::record() must be called with
a lower-case table name, otherwise it won't match.

BUG: 409234
FIXED-IN: 5.11.3

Test Plan:
Akonadi doesn't attempt to re-initialize all tables on each start when
using Qt 5.13

Reviewers: vkrause

Reviewed By: vkrause

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D22133
parent 565700f7
......@@ -76,7 +76,7 @@ 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);
const QSqlRecord table = m_database.record(tableName.toLower());
const int numTables = table.count();
columns.reserve(numTables);
for (int i = 0; i < numTables; ++i) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment