[Libreoffice-commits] core.git: connectivity/source

Tamas Bunth tamas.bunth at collabora.co.uk
Sat Dec 9 13:00:57 UTC 2017


 connectivity/source/drivers/firebird/PreparedStatement.cxx |   15 +++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 032a3e3713af3e308229bd8e1ada17d6d24072f3
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Sat Dec 9 13:38:39 2017 +0100

    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 at gmail.com>
    Tested-by: Tamás Bunth <btomi96 at gmail.com>

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,


More information about the Libreoffice-commits mailing list