summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-08-31 11:11:02 +0200
committerTamás Bunth <btomi96@gmail.com>2018-08-31 15:32:44 +0200
commit9b75c54aa5b619c704536df2912cdab7e2241443 (patch)
tree44044650b4649a68697ef8a4a0a679de7a9d0f50 /connectivity
parentd2a1ca79e50f191e20688345c4d78e82477342be (diff)
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@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx4
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx7
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx2
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx2
4 files changed, 7 insertions, 8 deletions
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;