diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2017-12-09 13:38:39 +0100 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2017-12-09 13:58:52 +0100 |
commit | 032a3e3713af3e308229bd8e1ada17d6d24072f3 (patch) | |
tree | 70835ea23faf90610aedc0e6ea74e7f8a14bb333 /connectivity | |
parent | 95a72981e572a961a1c4c03f81fd365c1cb23e9f (diff) |
Firebird: Revert not closing cursor,..
..but suppress error of closing closed cursor
Change-Id: I58f96f02f3f600a089bde361ed3e46a03a4902d4
Reviewed-on: https://gerrit.libreoffice.org/46141
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Tested-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 30ed7f536630..7d06060c497e 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -250,6 +250,21 @@ sal_Bool SAL_CALL OPreparedStatement::execute() if (m_xResultSet.is()) // Checks whether we have already run the statement. { disposeResultSet(); + // Closes the cursor from the last run. + // This doesn't actually free the statement -- using DSQL_close closes + // the cursor and keeps the statement, using DSQL_drop frees the statement + // (and associated cursors). + aErr = isc_dsql_free_statement(m_statusVector, + &m_aStatementHandle, + DSQL_close); + if (aErr) + { + // Do not throw error. Trying to close a closed cursor is not a + // critical mistake. + OUString sErrMsg = StatusVectorToString(m_statusVector, + "isc_dsql_free_statement: close cursor"); + SAL_WARN("connectivity.firebird", sErrMsg); + } } aErr = isc_dsql_execute(m_statusVector, |