Fix E2E query

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-07-03 11:40:58 +02:00
parent 6c11c1aa73
commit 24efdd3b45
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -977,14 +977,19 @@ bool SyncJournalDb::getFileRecordByE2eMangledName(const QString &mangledName, Sy
rec->_path.clear();
Q_ASSERT(!rec->isValid());
if (_metadataTableIsEmpty)
if (_metadataTableIsEmpty) {
return true; // no error, yet nothing found (rec->isValid() == false)
}
if (!checkConnect())
if (!checkConnect()) {
return false;
}
if (!mangledName.isEmpty()) {
_getFileRecordQueryByMangledName.reset_and_clear_bindings();
if (!_getFileRecordQueryByMangledName.initOrReset(QByteArrayLiteral(GET_FILE_RECORD_QUERY " WHERE e2eMangledName=?1"), _db)) {
return false;
}
_getFileRecordQueryByMangledName.bindValue(1, mangledName);
if (!_getFileRecordQueryByMangledName.exec()) {