From cf848323a3f35e7b66c1c7ec93bdbbd71f273eeb Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 16 Jan 2021 22:05:18 +0100 Subject: [PATCH] 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 Reviewed-by: Robert Szefner Reviewed-by: Andy Shaw (cherry picked from commit 4e2a94236998cd05753167953d9167793baf9942) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index b6b2174a01e..4c3d6ca13fc 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -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(data), int(len)); + unsigned char *data = PQunescapeBytea(reinterpret_cast(val), &len); + QByteArray ba(reinterpret_cast(data), len); qPQfreemem(data); return QVariant(ba); }