SyncJournal: Use the NOCASE Collate for blacklist query.

This commit is contained in:
Klaas Freitag 2014-10-06 18:37:53 +02:00
parent 425d0d77c5
commit 04558beabe

View file

@ -272,9 +272,15 @@ bool SyncJournalDb::checkConnect()
_deleteFileRecordRecursively.reset(new QSqlQuery(_db));
_deleteFileRecordRecursively->prepare("DELETE FROM metadata WHERE path LIKE(?||'/%')");
_blacklistQuery.reset(new QSqlQuery(_db));
_blacklistQuery->prepare("SELECT lastTryEtag, lastTryModtime, retrycount, errorstring "
QString sql( "SELECT lastTryEtag, lastTryModtime, retrycount, errorstring "
"FROM blacklist WHERE path=:path");
if( Utility::fsCasePreserving() ) {
// if the file system is case preserving we have to check the blacklist
// case insensitively
sql += QLatin1String(" COLLATE NOCASE");
}
_blacklistQuery.reset(new QSqlQuery(_db));
_blacklistQuery->prepare(sql);
return rc;
}