User: vg      
Date: 06/03/31 03:54:35

Modified:
 /dba/connectivity/source/drivers/mozab/
  MResultSet.cxx

Log:
 INTEGRATION: CWS dba203b (1.23.52); FILE MERGED
 2006/03/27 08:09:36 fs 1.23.52.1: #i61611# initialize m_CurrentRowCount when 
building a sorted key set

File Changes:

Directory: /dba/connectivity/source/drivers/mozab/
==================================================

File [changed]: MResultSet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MResultSet.cxx?r1=1.24&r2=1.25
Delta lines:  +16 -18
---------------------
--- MResultSet.cxx      29 Mar 2006 12:18:03 -0000      1.24
+++ MResultSet.cxx      31 Mar 2006 11:54:33 -0000      1.25
@@ -142,9 +142,8 @@
        ,m_xStatement(*pStmt)
        ,m_nRowPos(0)
        ,m_xMetaData(NULL)
-    ,m_nIsAlwaysFalseQuery(sal_False)
+    ,m_bIsAlwaysFalseQuery(sal_False)
     ,m_nParamIndex(0)
-    ,m_nRowCountResult(-1)
        ,m_aQuery(pStmt->getOwnConnection()->getColumnAlias().getAliasMap())
        ,m_pKeySet(NULL)
        ,m_pStatement(pStmt)
@@ -363,8 +362,8 @@
 // -------------------------------------------------------------------------
 sal_uInt32  OResultSet::currentRowCount()
 {
-    if ( m_nRowCountResult != -1 )
-        return m_nRowCountResult;
+    if ( m_bIsAlwaysFalseQuery )
+        return 0;
     return m_aQuery.getRealRowCount() - deletedCount();
 }
 
@@ -916,7 +915,7 @@
         if ( columnName.compareToAscii("0") ==0 && op == MQueryOp::Is &&
              matchString.compareToAscii("1") == 0 ) {
             OSL_TRACE("Query always evaluates to FALSE");
-            m_nIsAlwaysFalseQuery = sal_True;
+            m_bIsAlwaysFalseQuery = sal_True;
         }
         queryExpression.getExpressions().push_back( new 
MQueryExpressionString( columnName, op, matchString ));
     }
@@ -1127,7 +1126,7 @@
 
     // const OSQLParseNode*  pParseTree = NULL;
 
-    m_nIsAlwaysFalseQuery = sal_False;
+    m_bIsAlwaysFalseQuery = sal_False;
     if ( pParseTree != NULL )
     {
         // Extract required info
@@ -1158,8 +1157,8 @@
     }
 
     // If the query is a 0=1 then set Row count to 0 and return
-    if ( m_nIsAlwaysFalseQuery ) {
-        m_nRowCountResult = 0;
+    if ( m_bIsAlwaysFalseQuery )
+    {
                m_bIsReadOnly = 1;
         return;
     }
@@ -1248,7 +1247,6 @@
     }
 
     m_nRowPos = 0;
-    m_nRowCountResult = -1;
 
     fillRowData();
 
@@ -1264,7 +1262,7 @@
     {
         case SQL_STATEMENT_SELECT:
         {
-            if(m_nIsAlwaysFalseQuery) {
+            if(m_bIsAlwaysFalseQuery) {
                 break;
             }
             else if(isCount())
@@ -1366,6 +1364,7 @@
                     }
 
                                        m_pKeySet = 
m_pSortIndex->CreateKeySet();
+                    m_CurrentRowCount = m_pKeySet->size();
 #if OSL_DEBUG_LEVEL > 0
                     for( OKeySet::size_type i = 0; i < m_pKeySet->size(); i++ )
                         OSL_TRACE("Sorted: %d -> %d", i, (*m_pKeySet)[i] );
@@ -1990,9 +1989,8 @@
 {
        if (m_bIsReadOnly == -1)
        {
-               //m_nRowCountResult == 0 mean user call with where case 0 = 1
                OConnection* xConnection = 
static_cast<OConnection*>(m_pStatement->getConnection().get());
-               m_bIsReadOnly = !m_aQuery.isWritable(xConnection) || 
(m_nRowCountResult == 0);
+               m_bIsReadOnly = !m_aQuery.isWritable(xConnection) || 
m_bIsAlwaysFalseQuery;
        }
 
        return m_bIsReadOnly != 0;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to