connectivity/source/drivers/mysqlc/mysqlc_statement.cxx | 11 ++++------- connectivity/source/drivers/mysqlc/mysqlc_statement.hxx | 1 - 2 files changed, 4 insertions(+), 8 deletions(-)
New commits: commit 7c64b92665e13c1a09ee197bd36dac015989f00e Author: Lionel Elie Mamane <lio...@mamane.lu> AuthorDate: Sat May 9 13:59:45 2020 +0200 Commit: Lionel Elie Mamane <lio...@mamane.lu> CommitDate: Sat May 9 21:18:13 2020 +0200 mysql-sdbc: statement::execute do not handle parameters this is not a PreparedStatement, it is not allowed to have parameters Change-Id: I15cd493b89824e4e68eff5a59ac255bf05db0190 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93853 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu> diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx index 2301d040511b..c6dab15c4b53 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx @@ -117,10 +117,8 @@ sal_Bool SAL_CALL OCommonStatement::execute(const OUString& sql) { MutexGuard aGuard(m_aMutex); checkDisposed(rBHelper.bDisposed); - const OUString sSqlStatement = m_xConnection->transFormPreparedStatement(sql); - OString toExec - = OUStringToOString(sSqlStatement, m_xConnection->getConnectionSettings().encoding); + OString toExec = OUStringToOString(sql, m_xConnection->getConnectionSettings().encoding); MYSQL* pMySql = m_xConnection->getMysqlConnection(); commit f185b070fd72112a7c4c4b843ee6156c1860ac94 Author: Lionel Elie Mamane <lio...@mamane.lu> AuthorDate: Sat May 9 13:55:23 2020 +0200 Commit: Lionel Elie Mamane <lio...@mamane.lu> CommitDate: Sat May 9 21:17:58 2020 +0200 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 <lio...@mamane.lu> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits