Tag: cws_src680_warnings01 User: sb Date: 06/05/23 16:34:16 Modified: /dba/connectivity/source/drivers/mozab/ MResultSet.cxx
Log: RESYNC: (1.24-1.25); FILE MERGED 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.22.30.6&r2=1.22.30.7 Delta lines: +10 -12 --------------------- --- MResultSet.cxx 7 Apr 2006 20:22:46 -0000 1.22.30.6 +++ MResultSet.cxx 23 May 2006 23:34:13 -0000 1.22.30.7 @@ -154,8 +154,7 @@ ,m_pTable(NULL) ,m_CurrentRowCount(0) ,m_nParamIndex(0) - ,m_nRowCountResult(-1) - ,m_nIsAlwaysFalseQuery(sal_False) + ,m_bIsAlwaysFalseQuery(sal_False) ,m_pKeySet(NULL) ,m_nNewRow(0) ,m_nUpdatedRow(0) @@ -364,8 +363,8 @@ // ------------------------------------------------------------------------- sal_uInt32 OResultSet::currentRowCount() { - if ( m_nRowCountResult != -1 ) - return m_nRowCountResult; + if ( m_bIsAlwaysFalseQuery ) + return 0; return m_aQuery.getRealRowCount() - deletedCount(); } @@ -918,7 +917,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 )); } @@ -1129,7 +1128,7 @@ // const OSQLParseNode* pParseTree = NULL; - m_nIsAlwaysFalseQuery = sal_False; + m_bIsAlwaysFalseQuery = sal_False; if ( pParseTree != NULL ) { // Extract required info @@ -1160,8 +1159,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; } @@ -1250,7 +1249,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()) @@ -1365,6 +1363,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] ); @@ -1992,9 +1991,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]
