diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2021-01-16 22:05:18 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2021-01-25 16:37:25 +0100 |
commit | 4e2a94236998cd05753167953d9167793baf9942 (patch) | |
tree | c27fae8866fc0015a650332acfcabbf5649a9115 /src/plugins/sqldrivers/psql/qsql_psql.cpp | |
parent | d79a9b1a4f694a227ce62ccab9b44685a9755916 (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
Pick-to: 6.0
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/psql/qsql_psql.cpp')
-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); } |