From 87bbcddb1d68142b3b8a21d20ec19e38c55a5e93 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 18 Apr 2025 21:16:41 +0200 Subject: [PATCH] SQL/OCI: Fix usage of QOCIResult::d_ptr The refactoring in 82681fd8a2af1113da5bd13875ba71c1efd45afb added a d_ptr of type QOCIResultPrivate. This shadowed the d_ptr from QSqlCachedResult and an unitialized QOCIResult::d_ptr variable which in the end made the whole plugin unusable. Fix it by removing the unneeded d_ptr member. Pick-to: 6.9 Fixes: QTBUG-136024 Change-Id: I5ecacba8079eadbfae25a32720b43b4465c096d8 Reviewed-by: Volker Hilsheimer --- src/plugins/sqldrivers/oci/qsql_oci.cpp | 3 ++- src/plugins/sqldrivers/oci/qsql_oci_p.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index a9e725af220..9ebead8bc3f 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -414,11 +414,12 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in SQLT_RDD, indPtr, 0, 0, 0, 0, OCI_DEFAULT); } else if (val.canConvert() && isOutValue(pos)) { QOCIResult *res = qvariant_cast(val); + QOCIResultPrivate *resPrivate = static_cast(res->d_ptr); if (res->internal_prepare()) { r = OCIBindByPos2(sql, hbnd, err, pos + 1, - const_cast(&res->d_ptr->sql), + &resPrivate->sql, (sb4)0, SQLT_RSET, indPtr, 0, 0, 0, 0, OCI_DEFAULT); diff --git a/src/plugins/sqldrivers/oci/qsql_oci_p.h b/src/plugins/sqldrivers/oci/qsql_oci_p.h index d5756c64fc6..8aa25c55285 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci_p.h +++ b/src/plugins/sqldrivers/oci/qsql_oci_p.h @@ -95,7 +95,6 @@ protected: bool internal_prepare(); private: - QOCIResultPrivate *d_ptr; Q_DECLARE_PRIVATE(QOCIResult) };