[Libreoffice-commits] core.git: 3 commits - dbaccess/source

Lionel Elie Mamane lionel at mamane.lu
Mon Jun 16 12:58:57 PDT 2014


 dbaccess/source/core/api/RowSet.cxx |   49 ++++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 21 deletions(-)

New commits:
commit db7042cdbaf94250cd76b6aafd75c10c4a5a6900
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Jun 16 13:20:36 2014 +0200

    janitorial: update function name in SAL_INFO output
    
    Change-Id: Ie01599c8f3ae465998113dd8bfd2a33b27d0a39d

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 4b5b5db..629ebf5 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1700,7 +1700,7 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw()
     if ( !m_aUpdateTableName.isEmpty() )
         aComposedUpdateTableName = composeTableName( m_xActiveConnection->getMetaData(), m_aUpdateCatalogName, m_aUpdateSchemaName, m_aUpdateTableName, false, ::dbtools::eInDataManipulation );
 
-    SAL_INFO("dbaccess", "ORowSet::execute_NoApprove_NoNewConn: creating cache" );
+    SAL_INFO("dbaccess", "ORowSet::impl_prepareAndExecute_throw: creating cache" );
     m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache,m_aFilter,m_nMaxRows );
     if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
     {
commit 21f2efbe5f2e8d86a027f04370f8100c4194ee16
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Jun 16 12:22:39 2014 +0200

    dbaccess::ORowSet: separate impl_rebuild_throw
    
    Used by two different callers that wanted different things.
    Also, freeResources now always positions on BeforeFirst.
    It is only called with _bComplete==false by execute()-related code.
    
    Change-Id: I3e34f77ce37c239d8d3d6a8cd7514b125b049de6

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 9820287..4b5b5db 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -560,6 +560,15 @@ void ORowSet::freeResources( bool _bComplete )
     }
     m_aClones.clear();
 
+    m_aBookmark     = Any();
+    m_bBeforeFirst  = true;
+    m_bAfterLast    = false;
+    m_bNew          = false;
+    m_bModified     = false;
+    m_bIsInsertRow  = false;
+    m_bLastKnownRowCountFinal = false;
+    m_nLastKnownRowCount      = 0;
+
     if ( _bComplete )
     {
         // the columns must be disposed before the querycomposer is disposed because
@@ -588,14 +597,6 @@ void ORowSet::freeResources( bool _bComplete )
         m_xStatement    = NULL;
         m_xTypeMap      = NULL;
 
-        m_aBookmark     = Any();
-        m_bBeforeFirst  = true;
-        m_bAfterLast    = false;
-        m_bNew          = false;
-        m_bModified     = false;
-        m_bIsInsertRow  = false;
-        m_bLastKnownRowCountFinal = false;
-        m_nLastKnownRowCount      = 0;
         if ( m_aOldRow.is() )
             m_aOldRow->clearRow();
 
@@ -2006,8 +2007,22 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
     }
     else // !m_bCommandFacetsDirty
     {
-        impl_rebuild_throw(_rClearForNotification);
-        beforeFirst();
+        Reference< XResultSet > xResultSet;
+        if(m_bParametersDirty)
+        {
+            xResultSet = impl_prepareAndExecute_throw();
+        }
+        else
+        {
+            xResultSet = m_xStatement->executeQuery();
+            m_pCache->reset(xResultSet);
+        }
+        // let our warnings container forget the reference to the (possibly disposed) old result set
+        m_aWarnings.setExternalWarnings( NULL );
+        // clear all current warnings
+        m_aWarnings.clearWarnings();
+        // let the warnings container know about the new "external warnings"
+        m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) );
     }
     checkCache();
     // notify the rowset listeners
@@ -2732,16 +2747,8 @@ void SAL_CALL ORowSet::refreshRow(  ) throw(SQLException, RuntimeException, std:
 
 void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard)
 {
-    Reference< XResultSet > xResultSet;
-    if(m_bParametersDirty)
-    {
-        xResultSet = impl_prepareAndExecute_throw();
-    }
-    else
-    {
-        xResultSet = m_xStatement->executeQuery();
-        m_pCache->reset(xResultSet);
-    }
+    Reference< XResultSet > xResultSet(m_xStatement->executeQuery());
+    m_pCache->reset(xResultSet);
     m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) );
     notifyAllListeners(_rGuard);
 }
commit 767e15343fdedffce513fd26ce17ee6003936117
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Jun 16 10:46:41 2014 +0200

    clean up fdo#79427 fix: force BeforeFirst only at execute(), not updateRow()
    
    Change-Id: Iaa881d055923702acbb96862d187af41a6ded730

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index d5e6411..9820287 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2007,6 +2007,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
     else // !m_bCommandFacetsDirty
     {
         impl_rebuild_throw(_rClearForNotification);
+        beforeFirst();
     }
     checkCache();
     // notify the rowset listeners
@@ -2740,7 +2741,6 @@ void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard)
     {
         xResultSet = m_xStatement->executeQuery();
         m_pCache->reset(xResultSet);
-        beforeFirst();
     }
     m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) );
     notifyAllListeners(_rGuard);


More information about the Libreoffice-commits mailing list