From 987583074f05e39a5173bf78692019f1e8357c8f Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 13 Sep 2016 06:55:22 +0200 Subject: [PATCH] Added more warnings in DB when updating msgs. --- src/miscellaneous/databasequeries.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/miscellaneous/databasequeries.cpp b/src/miscellaneous/databasequeries.cpp index ee7dec759..cf7b20e31 100755 --- a/src/miscellaneous/databasequeries.cpp +++ b/src/miscellaneous/databasequeries.cpp @@ -529,6 +529,9 @@ int DatabaseQueries::updateMessages(QSqlDatabase db, is_read_existing_message = query_select_with_url.value(2).toBool(); is_important_existing_message = query_select_with_url.value(3).toBool(); } + else if (query_select_with_url.lastError().isValid()) { + qDebug("Failed to check for existing message in DB via URL: '%s'.", qPrintable(query_select_with_url.lastError().text())); + } query_select_with_url.finish(); } @@ -544,6 +547,9 @@ int DatabaseQueries::updateMessages(QSqlDatabase db, is_read_existing_message = query_select_with_id.value(2).toBool(); is_important_existing_message = query_select_with_id.value(3).toBool(); } + else if (query_select_with_id.lastError().isValid()) { + qDebug("Failed to check for existing message in DB via ID: '%s'.", qPrintable(query_select_with_id.lastError().text())); + } query_select_with_id.finish(); } @@ -573,6 +579,9 @@ int DatabaseQueries::updateMessages(QSqlDatabase db, if (query_update.exec() && !message.m_isRead) { updated_messages++; } + else if (query_update.lastError().isValid()) { + qDebug("Failed to update message in DB: '%s'.", qPrintable(query_update.lastError().text())); + } query_update.finish(); qDebug("Updating message '%s' in DB.", qPrintable(message.m_title)); @@ -596,6 +605,9 @@ int DatabaseQueries::updateMessages(QSqlDatabase db, if (query_insert.exec() && query_insert.numRowsAffected() == 1) { updated_messages++; } + else if (query_insert.lastError().isValid()) { + qDebug("Failed to insert message to DB: '%s'.", qPrintable(query_insert.lastError().text())); + } query_insert.finish(); qDebug("Adding new message '%s' to DB.", qPrintable(message.m_title));