Changeset View
Changeset View
Standalone View
Standalone View
src/engine/documentdb.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 82 | { | |||
---|---|---|---|---|---|
91 | if (rc == MDB_NOTFOUND) { | 91 | if (rc == MDB_NOTFOUND) { | ||
92 | return QVector<QByteArray>(); | 92 | return QVector<QByteArray>(); | ||
93 | } | 93 | } | ||
94 | Q_ASSERT_X(rc == 0, "DocumentDB::get", mdb_strerror(rc)); | 94 | Q_ASSERT_X(rc == 0, "DocumentDB::get", mdb_strerror(rc)); | ||
95 | 95 | | |||
96 | QByteArray arr = QByteArray::fromRawData(static_cast<char*>(val.mv_data), val.mv_size); | 96 | QByteArray arr = QByteArray::fromRawData(static_cast<char*>(val.mv_data), val.mv_size); | ||
97 | 97 | | |||
98 | DocTermsCodec codec; | 98 | DocTermsCodec codec; | ||
99 | return codec.decode(arr); | 99 | auto result = codec.decode(arr); | ||
100 | if (result.isEmpty()) { | ||||
101 | qDebug() << "Document Terms DB contains corrupt data for " << docId; | ||||
dhaumann: Ah, maybe this should be a qWarning()? Feel free to decide as you wish. | |||||
102 | } | ||||
103 | return result; | ||||
100 | } | 104 | } | ||
101 | 105 | | |||
102 | void DocumentDB::del(quint64 docId) | 106 | void DocumentDB::del(quint64 docId) | ||
103 | { | 107 | { | ||
104 | Q_ASSERT(docId > 0); | 108 | Q_ASSERT(docId > 0); | ||
105 | 109 | | |||
106 | MDB_val key; | 110 | MDB_val key; | ||
107 | key.mv_size = sizeof(quint64); | 111 | key.mv_size = sizeof(quint64); | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
Ah, maybe this should be a qWarning()? Feel free to decide as you wish.