diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2020-05-09 13:55:23 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2020-05-09 21:17:58 +0200 |
commit | f185b070fd72112a7c4c4b843ee6156c1860ac94 (patch) | |
tree | b56cfecb56c3e0505d474fc72e84dc47ebdc9b7a /connectivity | |
parent | 57cdc7f309f0863e1d8eef4a1780c3e9e2daadb5 (diff) |
mysql-sdbc: statement: do not pointlessly keep pointer to result
in m_pMysqlResult since it is never actually used after being assigned,
except in the code block that assigned it.
Change-Id: Ic4341321b18b2c92eb93e59dd3b9e3035c69f293
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93852
Tested-by: Jenkins
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_statement.cxx | 7 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_statement.hxx | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx index 6b35b236361f..2301d040511b 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx @@ -57,7 +57,6 @@ void OCommonStatement::closeResultSet() css::uno::Reference<css::sdbc::XCloseable> xClose(m_xResultSet, UNO_QUERY_THROW); xClose->close(); m_xResultSet.clear(); - m_pMysqlResult = nullptr; // it is freed by XResultSet } } @@ -155,15 +154,15 @@ Reference<XResultSet> SAL_CALL OCommonStatement::executeQuery(const OUString& sq mysql_errno(pMySql), *this, m_xConnection->getConnectionEncoding()); - m_pMysqlResult = mysql_store_result(pMySql); - if (m_pMysqlResult == nullptr) + MYSQL_RES* pMysqlResult = mysql_store_result(pMySql); + if (pMysqlResult == nullptr) { mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(pMySql), mysql_sqlstate(pMySql), mysql_errno(pMySql), *this, m_xConnection->getConnectionEncoding()); } - m_xResultSet = new OResultSet(*getOwnConnection(), this, m_pMysqlResult, + m_xResultSet = new OResultSet(*getOwnConnection(), this, pMysqlResult, m_xConnection->getConnectionEncoding()); return m_xResultSet; } diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx index 9595c596401a..2ce417259b24 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx @@ -65,7 +65,6 @@ protected: rtl::Reference<OConnection> m_xConnection; // The owning Connection object css::uno::Reference<css::sdbc::XResultSet> m_xResultSet; - MYSQL_RES* m_pMysqlResult = nullptr; // number of rows affected by an UPDATE, DELETE or INSERT statement. sal_Int32 m_nAffectedRows = 0; |