From 9b75c54aa5b619c704536df2912cdab7e2241443 Mon Sep 17 00:00:00 2001 From: Tamas Bunth Date: Fri, 31 Aug 2018 11:11:02 +0200 Subject: tdf#119615 Ownership of m_aFields is.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .. on Mariadb side Change-Id: Id65487191c29f7af1a171c06345034d1dc5b20ec Reviewed-on: https://gerrit.libreoffice.org/59856 Tested-by: Jenkins Reviewed-by: Tamás Bunth --- connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx | 4 +--- connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx | 7 +++++-- connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx | 2 -- connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx index eeafad75621b..f54ded42d5e9 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx @@ -81,11 +81,9 @@ OPreparedResultSet::OPreparedResultSet(OConnection& rConn, OPreparedStatement* p { m_nFieldCount = mysql_stmt_field_count(pStmt); m_pResult = mysql_stmt_result_metadata(m_pStmt); - m_aFields.reset(mysql_fetch_fields(m_pResult)); + m_aFields = mysql_fetch_fields(m_pResult); } -OPreparedResultSet::~OPreparedResultSet() {} - void OPreparedResultSet::disposing() { OPropertySetHelper::disposing(); diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx index fab11284540d..a164bceedb8c 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx @@ -62,8 +62,12 @@ class OPreparedResultSet final : public OBase_Mutex, OConnection& m_rConnection; css::uno::WeakReferenceHelper m_aStatement; css::uno::Reference m_xMetaData; + + // non-owning pointers MYSQL_RES* m_pResult; MYSQL_STMT* m_pStmt; + MYSQL_FIELD* m_aFields; + rtl_TextEncoding m_encoding; sal_Int32 m_nCurrentField = 0; sal_Int32 m_nFieldCount; @@ -71,7 +75,6 @@ class OPreparedResultSet final : public OBase_Mutex, // Use c style arrays, because we have to work with pointers // on these. std::unique_ptr m_aData; - std::unique_ptr m_aFields; std::unique_ptr m_aMetaData; bool m_bWasNull = false; @@ -90,7 +93,7 @@ class OPreparedResultSet final : public OBase_Mutex, void SAL_CALL getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const SAL_OVERRIDE; // you can't delete objects of this type - virtual ~OPreparedResultSet() override; + virtual ~OPreparedResultSet() override = default; public: virtual rtl::OUString SAL_CALL getImplementationName() SAL_OVERRIDE; diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx index 7d98cb0bd4a4..f6c41e182a01 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx @@ -109,8 +109,6 @@ OResultSet::OResultSet(OConnection& rConn, OCommonStatement* pStmt, MYSQL_RES* p fieldCount = mysql_num_fields(pResult); } -OResultSet::~OResultSet() {} - void OResultSet::disposing() { OPropertySetHelper::disposing(); diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx index c4a203cda91e..9bfd8ecc1aef 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx @@ -87,7 +87,7 @@ class OResultSet final : public OBase_Mutex, void SAL_CALL getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const SAL_OVERRIDE; // you can't delete objects of this type - virtual ~OResultSet() override; + virtual ~OResultSet() override = default; public: virtual rtl::OUString SAL_CALL getImplementationName() SAL_OVERRIDE; -- cgit