QSql/PostgreSQL: allow blobs with more than 2^30 bytes

Due to limitations of QByteArray it was not possible to store more than
2^31 bytes. This was fixed in Qt6 so throw away the casts to int in the
postgres plugin

Fixes: QTBUG-79059
Change-Id: I8ae7276a04d4936bcf5ba6c413e3412f6c342ff5
Pick-to: 6.0
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Christian Ehrlicher 2021-01-16 22:05:18 +01:00
parent d79a9b1a4f
commit 4e2a942369

View File

@ -696,8 +696,8 @@ QVariant QPSQLResult::data(int i)
#endif
case QMetaType::QByteArray: {
size_t len;
unsigned char *data = PQunescapeBytea((const unsigned char*)val, &len);
QByteArray ba(reinterpret_cast<const char *>(data), int(len));
unsigned char *data = PQunescapeBytea(reinterpret_cast<const unsigned char *>(val), &len);
QByteArray ba(reinterpret_cast<const char *>(data), len);
qPQfreemem(data);
return QVariant(ba);
}