Fix one DB query which failed for MySQL storage and could lead to DB inconsistencies.
This commit is contained in:
parent
d0a40ab3a4
commit
9e66dc9f20
1 changed files with 2 additions and 2 deletions
|
@ -617,8 +617,8 @@ int DatabaseQueries::updateMessages(QSqlDatabase db,
|
|||
// Now, fixup custom IDS for messages which initially did not have them,
|
||||
// just to keep the data consistent.
|
||||
if (db.exec("UPDATE Messages "
|
||||
"SET custom_id = (SELECT id FROM Messages t WHERE t.id = Messages.id) "
|
||||
"WHERE Messages.custom_id IS NULL OR Messages.custom_id = '';").lastError().isValid()) {
|
||||
"SET custom_id = id "
|
||||
"WHERE custom_id IS NULL OR custom_id = '';").lastError().isValid()) {
|
||||
qWarning("Failed to set custom ID for all messages: '%s'.", qPrintable(db.lastError().text()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue