diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2012-06-04 17:31:25 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2012-06-04 19:22:45 +0200 |
commit | df31ed33b7eab6e2e2950358a82bde1cccdbd683 (patch) | |
tree | 8b33b8758e1c420c737265ab9932c395e2a5f42a | |
parent | d51af3a62a640783993e83566c3a86d62f24637b (diff) |
Remove wrong optimisation
fixup of d4ae29a37873843c20fe7d5f5f071f8fb201fed9
after the call to m_pCacheSet->absolute_checked, the data *is* used,
so we cannot anymore exempt m_pCacheSet from giving correct data.
Change-Id: I7d3644ca08ce43cb030a80984605a1f8a8a64211
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 63850ddd3040..940618a5dd43 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -79,6 +79,14 @@ using namespace ::osl; #define CHECK_MATRIX_POS(M) OSL_ENSURE(((M) >= static_cast<ORowSetMatrix::difference_type>(0)) && ((M) < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!") +// This class calls m_pCacheSet->FOO_checked(..., sal_False) +// (where FOO is absolute, last, previous) +// when it does not immediately care about the values in the row's columns. +// As a corollary, m_pCacheSet may be left in an inconsistent state, +// and all ->fillFOO calls (and ->getFOO) may fail or give wrong results, +// until m_pCacheSet is moved (or refreshed) again. +// So always make sure m_pCacheSet is moved or refreshed before accessing column values. + DBG_NAME(ORowSetCache) ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, @@ -1075,7 +1083,7 @@ sal_Bool ORowSetCache::moveWindow() aIter = m_pMatrix->begin(); nPos = m_nStartPos + 1; - bCheck = m_pCacheSet->absolute_checked(nPos, sal_False); + bCheck = m_pCacheSet->absolute_checked(nPos, sal_True); for(; !aIter->is() && bCheck;++aIter, ++nPos) { OSL_ENSURE(aIter != m_pMatrix->end(),"Invalid iterator"); |