mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
ownsql: handle QByteArray without converting to QString (#5097)
QByteArray is used for checksum
This commit is contained in:
parent
88e5a9411a
commit
73a6939b70
1 changed files with 6 additions and 1 deletions
|
@ -303,6 +303,11 @@ void SqlQuery::bindValue(int pos, const QVariant& value)
|
|||
res = sqlite3_bind_null(_stmt, pos);
|
||||
}
|
||||
break; }
|
||||
case QVariant::ByteArray: {
|
||||
auto ba = value.toByteArray();
|
||||
res = sqlite3_bind_text(_stmt, pos, ba.constData(), ba.size(), SQLITE_TRANSIENT);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
QString str = value.toString();
|
||||
// SQLITE_TRANSIENT makes sure that sqlite buffers the data
|
||||
|
@ -312,7 +317,7 @@ void SqlQuery::bindValue(int pos, const QVariant& value)
|
|||
}
|
||||
}
|
||||
if (res != SQLITE_OK) {
|
||||
qDebug() << Q_FUNC_INFO << "ERROR" << value.toString() << res;
|
||||
qDebug() << Q_FUNC_INFO << "ERROR" << value << res;
|
||||
}
|
||||
Q_ASSERT( res == SQLITE_OK );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue