diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2021-01-16 22:05:18 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-03 15:51:34 +0000 |
commit | cf848323a3f35e7b66c1c7ec93bdbbd71f273eeb (patch) | |
tree | cb17f9e1ff02eb52d0bbfb9a035efb957638252e | |
parent | ab669173f83e8bc74b13662d3501f13adcb30a5f (diff) |
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 <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 4e2a94236998cd05753167953d9167793baf9942)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/sqldrivers/psql/qsql_psql.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index b6b2174a01..4c3d6ca13f 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<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); } |