Commit 273116ad authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent eca3c0d7
......@@ -1334,7 +1334,7 @@ QSqlQuery DataStore::retryLastTransaction(bool rollbackFirst)
if (!res) {
// Don't do another deadlock detection here, just give up.
qCCritical(AKONADISERVER_LOG) << "DATABASE ERROR:";
qCCritical(AKONADISERVER_LOG) << " Error code:" << query.lastError().number();
qCCritical(AKONADISERVER_LOG) << " Error code:" << query.lastError().nativeErrorCode();
qCCritical(AKONADISERVER_LOG) << " DB error: " << query.lastError().databaseText();
qCCritical(AKONADISERVER_LOG) << " Error text:" << query.lastError().text();
qCCritical(AKONADISERVER_LOG) << " Query:" << query.executedQuery();
......
......@@ -173,7 +173,7 @@ QString DbIntrospectorPostgreSql::hasIndexQuery(const QString &tableName, const
QString query = QStringLiteral("SELECT indexname FROM pg_catalog.pg_indexes");
query += QStringLiteral(" WHERE tablename ilike '%1'").arg(tableName);
query += QStringLiteral(" AND indexname ilike '%1'").arg(indexName);
query += QLatin1String(" UNION SELECT conname FROM pg_catalog.pg_constraint ");
query += QStringLiteral(" UNION SELECT conname FROM pg_catalog.pg_constraint ");
query += QStringLiteral(" WHERE conname ilike '%1'").arg(indexName);
return query;
}
......
......@@ -100,7 +100,7 @@ bool DbUpdater::run()
success = m_database.transaction();
if (success) {
hasTransaction = true;
Q_FOREACH (const QString &statement, it.value().statements) {
for (const QString &statement : qAsConst(it.value().statements)) {
QSqlQuery query(m_database);
success = query.exec(statement);
if (!success) {
......
Markdown is supported
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