[Libreoffice-commits] core.git: connectivity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Aug 31 13:33:15 UTC 2018
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(-)
New commits:
commit 9b75c54aa5b619c704536df2912cdab7e2241443
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Fri Aug 31 11:11:02 2018 +0200
Commit: Tamás Bunth <btomi96 at gmail.com>
CommitDate: Fri Aug 31 15:32:44 2018 +0200
tdf#119615 Ownership of m_aFields is..
.. on Mariadb side
Change-Id: Id65487191c29f7af1a171c06345034d1dc5b20ec
Reviewed-on: https://gerrit.libreoffice.org/59856
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
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<css::sdbc::XResultSetMetaData> 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<MYSQL_BIND[]> m_aData;
- std::unique_ptr<MYSQL_FIELD[]> m_aFields;
std::unique_ptr<BindMetaData[]> 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;
More information about the Libreoffice-commits
mailing list