mirror of https://github.com/qTox/qTox
fix(test): Don't rely on row IDs after moving tables
Row ID's are not guaranteed to match those from the original peer table. New checking method is equally strict since we already verify the number of entries, and the SQL schema guarantees that entries are unique.reviewable/pr6611/r6
parent
265398a44e
commit
00119ff0d4
|
@ -54,8 +54,8 @@ RowId getValidPeerRow(RawDatabase& db, const ChatId& chatId)
|
|||
{
|
||||
bool validPeerExists{false};
|
||||
RowId validPeerRow;
|
||||
db.execNow(RawDatabase::Query(QStringLiteral("SELECT id FROM peers WHERE public_key='%1';")
|
||||
.arg(chatId.toString()),
|
||||
db.execNow(RawDatabase::Query(QStringLiteral("SELECT id FROM peers WHERE CAST(public_key AS BLOB)=?;"),
|
||||
{chatId.toString().toUtf8()},
|
||||
[&](const QVector<QVariant>& row) {
|
||||
validPeerRow = RowId{row[0].toLongLong()};
|
||||
validPeerExists = true;
|
||||
|
|
Loading…
Reference in New Issue