diff options
Diffstat (limited to 'connectivity/source/drivers/file')
21 files changed, 118 insertions, 97 deletions
diff --git a/connectivity/source/drivers/file/FCatalog.cxx b/connectivity/source/drivers/file/FCatalog.cxx index df810c291704..df810c291704 100644..100755 --- a/connectivity/source/drivers/file/FCatalog.cxx +++ b/connectivity/source/drivers/file/FCatalog.cxx diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx index b1f08c38db98..9c67f48bd6a6 100644..100755 --- a/connectivity/source/drivers/file/FColumns.cxx +++ b/connectivity/source/drivers/file/FColumns.cxx @@ -73,7 +73,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) sal_False, sal_False, sal_False, - m_pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers()); + m_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()); xRet = pRet; break; } diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index 2626c1d29a30..2626c1d29a30 100644..100755 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index cd738291e1a5..cd738291e1a5 100644..100755 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx diff --git a/connectivity/source/drivers/file/FDateFunctions.cxx b/connectivity/source/drivers/file/FDateFunctions.cxx index 792cb2d8bddb..792cb2d8bddb 100644..100755 --- a/connectivity/source/drivers/file/FDateFunctions.cxx +++ b/connectivity/source/drivers/file/FDateFunctions.cxx diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx index 708a85ce1b56..708a85ce1b56 100644..100755 --- a/connectivity/source/drivers/file/FDriver.cxx +++ b/connectivity/source/drivers/file/FDriver.cxx diff --git a/connectivity/source/drivers/file/FNoException.cxx b/connectivity/source/drivers/file/FNoException.cxx index e4bd959d3577..b06cda7c5a49 100644..100755 --- a/connectivity/source/drivers/file/FNoException.cxx +++ b/connectivity/source/drivers/file/FNoException.cxx @@ -101,16 +101,16 @@ void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,::std::vector< } // Further descend in Parse Tree - for (UINT32 i = 0; i < pParseNode->count(); i++) + for (sal_uInt32 i = 0; i < pParseNode->count(); i++) scanParameter(pParseNode->getChild(i),_rParaNodes); } // ----------------------------------------------------------------------------- OKeyValue* OResultSet::GetOrderbyKeyValue(OValueRefRow& _rRow) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::GetOrderbyKeyValue" ); - UINT32 nBookmarkValue = Abs((sal_Int32)(_rRow->get())[0]->getValue()); + sal_uInt32 nBookmarkValue = Abs((sal_Int32)(_rRow->get())[0]->getValue()); - OKeyValue* pKeyValue = OKeyValue::createKeyValue((UINT32)nBookmarkValue); + OKeyValue* pKeyValue = OKeyValue::createKeyValue((sal_uInt32)nBookmarkValue); ::std::vector<sal_Int32>::iterator aIter = m_aOrderbyColumnNumber.begin(); for (;aIter != m_aOrderbyColumnNumber.end(); ++aIter) diff --git a/connectivity/source/drivers/file/FNumericFunctions.cxx b/connectivity/source/drivers/file/FNumericFunctions.cxx index 031905a01999..031905a01999 100644..100755 --- a/connectivity/source/drivers/file/FNumericFunctions.cxx +++ b/connectivity/source/drivers/file/FNumericFunctions.cxx diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index 75325a6e077c..170dc1c5494c 100644..100755 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -479,7 +479,7 @@ void OPreparedStatement::setParameter(sal_Int32 parameterIndex, const ORowSetVal *((m_aParameterRow->get())[parameterIndex]) = x; } // ----------------------------------------------------------------------------- -UINT32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol) +sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OPreparedStatement::AddParameter" ); OSL_UNUSED( pParameter ); @@ -493,7 +493,7 @@ UINT32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Refere ::rtl::OUString sParameterName; // set up Parameter-Column: sal_Int32 eType = DataType::VARCHAR; - UINT32 nPrecision = 255; + sal_uInt32 nPrecision = 255; sal_Int32 nScale = 0; sal_Int32 nNullable = ColumnValue::NULLABLE; @@ -577,13 +577,13 @@ void OPreparedStatement::initializeResultSet(OResultSet* _pResult) if (!m_xParamColumns->get().empty()) { // begin with AssignValues - USHORT nParaCount=0; // gives the current number of previously set Parameters + sal_uInt16 nParaCount=0; // gives the current number of previously set Parameters // search for parameters to be substituted: size_t nCount = m_aAssignValues.is() ? m_aAssignValues->get().size() : 1; // 1 is important for the Criteria for (size_t j = 1; j < nCount; j++) { - UINT32 nParameter = (*m_aAssignValues).getParameterIndex(j); + sal_uInt32 nParameter = (*m_aAssignValues).getParameterIndex(j); if (nParameter == SQL_NO_PARAMETER) continue; // this AssignValue is no Parameter @@ -627,7 +627,7 @@ void OPreparedStatement::parseParamterElem(const String& _sColumnName,OSQLParseN if(nParameter == -1) nParameter = AddParameter(pRow_Value_Constructor_Elem,xCol); // Save number of parameter in the variable: - SetAssignValue(_sColumnName, String(), TRUE, nParameter); + SetAssignValue(_sColumnName, String(), sal_True, nParameter); } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index b9f60f63b076..d0056768663e 100644..100755 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -76,11 +76,7 @@ using namespace com::sun::star::sdbcx; using namespace com::sun::star::container; // Maximal number of Rows, that can be processed being sorted with ORDER BY: -#if defined (WIN) -#define MAX_KEYSET_SIZE 0x3ff0 // Somewhat less than a Segment, so there is still room for Memory-Debug-Information -#else #define MAX_KEYSET_SIZE 0x40000 // 256K -#endif namespace { @@ -143,7 +139,7 @@ OResultSet::OResultSet(OStatement_Base* pStmt,OSQLParseTreeIterator& _aSQLIte m_nResultSetConcurrency = isCount() ? ResultSetConcurrency::READ_ONLY : ResultSetConcurrency::UPDATABLE; construct(); - m_aSkipDeletedSet.SetDeleted(m_bShowDeleted); + m_aSkipDeletedSet.SetDeletedVisible(m_bShowDeleted); osl_decrementInterlockedCount( &m_refCount ); } @@ -648,7 +644,7 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException) // we know that we append new rows at the end // so we have to know where the end is m_aSkipDeletedSet.skipDeleted(IResultSetHelper::LAST,1,sal_False); - m_bRowInserted = m_pTable->InsertRow(*m_aInsertRow, TRUE, m_xColsIdx); + m_bRowInserted = m_pTable->InsertRow(*m_aInsertRow, sal_True, m_xColsIdx); if(m_bRowInserted && m_pFileSet.is()) { sal_Int32 nPos = (m_aInsertRow->get())[0]->getValue(); @@ -904,20 +900,20 @@ IPropertyArrayHelper & OResultSet::getInfoHelper() } //------------------------------------------------------------------ -BOOL OResultSet::ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition, - INT32 nFirstOffset, - BOOL bEvaluate, - BOOL bRetrieveData) +sal_Bool OResultSet::ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition, + sal_Int32 nFirstOffset, + sal_Bool bEvaluate, + sal_Bool bRetrieveData) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::ExecuteRow" ); OSL_ENSURE(m_pSQLAnalyzer,"OResultSet::ExecuteRow: Analyzer isn't set!"); // For further Fetch-Operations this information may possibly be changed ... IResultSetHelper::Movement eCursorPosition = eFirstCursorPosition; - INT32 nOffset = nFirstOffset; + sal_Int32 nOffset = nFirstOffset; const OSQLColumns & rTableCols = *(m_pTable->getTableColumns()); - BOOL bHasRestriction = m_pSQLAnalyzer->hasRestriction(); + sal_Bool bHasRestriction = m_pSQLAnalyzer->hasRestriction(); again: // protect from reading over the end when someboby is inserting while we are reading @@ -940,8 +936,13 @@ again: { m_pTable->fetchRow(m_aEvaluateRow, rTableCols, sal_True,bRetrieveData || bHasRestriction); - if ((!m_bShowDeleted && m_aEvaluateRow->isDeleted()) - || (bHasRestriction && !m_pSQLAnalyzer->evaluateRestriction())) + if ( ( !m_bShowDeleted + && m_aEvaluateRow->isDeleted() + ) + || ( bHasRestriction + && !m_pSQLAnalyzer->evaluateRestriction() + ) + ) { // Evaluate the next record // delete current row in Keyset if (m_pEvaluationKeySet) @@ -988,12 +989,14 @@ again: // Evaluate may only be set, // if the Keyset will be constructed further - if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && !isCount() && - (m_pFileSet.is() || m_pSortIndex) && bEvaluate) + if ( ( m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT ) + && !isCount() + && bEvaluate + ) { if (m_pSortIndex) { - OKeyValue* pKeyValue = GetOrderbyKeyValue(m_aEvaluateRow); + OKeyValue* pKeyValue = GetOrderbyKeyValue( m_aSelectRow ); m_pSortIndex->AddKeyValue(pKeyValue); } else if (m_pFileSet.is()) @@ -1008,7 +1011,7 @@ again: if (bEvaluate) { // read the actual result-row - bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,TRUE); + bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,sal_True); } if (bOK) @@ -1023,7 +1026,7 @@ again: sal_Bool bOK = sal_True; if (bEvaluate) { - bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,TRUE); + bOK = m_pTable->fetchRow(m_aEvaluateRow, *(m_pTable->getTableColumns()), sal_True,sal_True); } if (bOK) { @@ -1035,13 +1038,13 @@ again: } //------------------------------------------------------------------- -BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, BOOL bRetrieveData) +sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Bool bRetrieveData) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::Move" ); //IgnoreDeletedRows: // - INT32 nTempPos = m_nRowPos; + sal_Int32 nTempPos = m_nRowPos; if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && !isCount()) @@ -1049,7 +1052,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, if (!m_pFileSet.is()) //no Index available { // Normal FETCH - ExecuteRow(eCursorPosition,nOffset,FALSE,bRetrieveData); + ExecuteRow(eCursorPosition,nOffset,sal_False,bRetrieveData); // now set the bookmark for outside this is the logical pos and not the file pos *(*m_aRow->get().begin()) = sal_Int32(m_nRowPos + 1); @@ -1086,16 +1089,16 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, // The FileCursor is outside of the valid range, if: // a.) m_nRowPos < 1 // b.) a KeySet exists and m_nRowPos > m_pFileSet->size() - if (m_nRowPos < 0 || (m_pFileSet->isFrozen() && eCursorPosition != IResultSetHelper::BOOKMARK && m_nRowPos >= (INT32)m_pFileSet->get().size() )) + if (m_nRowPos < 0 || (m_pFileSet->isFrozen() && eCursorPosition != IResultSetHelper::BOOKMARK && m_nRowPos >= (sal_Int32)m_pFileSet->get().size() )) // && m_pFileSet->IsFrozen() { goto Error; } else { - if (m_nRowPos < (INT32)m_pFileSet->get().size()) + if (m_nRowPos < (sal_Int32)m_pFileSet->get().size()) { // Fetch via Index - ExecuteRow(IResultSetHelper::BOOKMARK,(m_pFileSet->get())[m_nRowPos],FALSE,bRetrieveData); + ExecuteRow(IResultSetHelper::BOOKMARK,(m_pFileSet->get())[m_nRowPos],sal_False,bRetrieveData); // now set the bookmark for outside *(*m_aRow->get().begin()) = sal_Int32(m_nRowPos + 1); @@ -1114,25 +1117,25 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, } sal_Bool bOK = sal_True; // Determine the number of further Fetches - while (bOK && m_nRowPos >= (INT32)m_pFileSet->get().size()) + while (bOK && m_nRowPos >= (sal_Int32)m_pFileSet->get().size()) { if (m_pEvaluationKeySet) { - if (m_nRowPos >= (INT32)m_pEvaluationKeySet->size()) + if (m_nRowPos >= (sal_Int32)m_pEvaluationKeySet->size()) return sal_False; else if (m_nRowPos == 0) { m_aEvaluateIter = m_pEvaluationKeySet->begin(); - bOK = ExecuteRow(IResultSetHelper::BOOKMARK,*m_aEvaluateIter,TRUE, bRetrieveData); + bOK = ExecuteRow(IResultSetHelper::BOOKMARK,*m_aEvaluateIter,sal_True, bRetrieveData); } else { ++m_aEvaluateIter; - bOK = ExecuteRow(IResultSetHelper::BOOKMARK,*m_aEvaluateIter,TRUE, bRetrieveData); + bOK = ExecuteRow(IResultSetHelper::BOOKMARK,*m_aEvaluateIter,sal_True, bRetrieveData); } } else - bOK = ExecuteRow(IResultSetHelper::NEXT,1,TRUE, FALSE);//bRetrieveData); + bOK = ExecuteRow(IResultSetHelper::NEXT,1,sal_True, sal_False);//bRetrieveData); } if (bOK) @@ -1280,8 +1283,8 @@ void OResultSet::sortRows() ::std::vector<sal_Int32>::iterator aOrderByIter = m_aOrderbyColumnNumber.begin(); for (::std::vector<sal_Int16>::size_type i=0;aOrderByIter != m_aOrderbyColumnNumber.end(); ++aOrderByIter,++i) { - OSL_ENSURE((sal_Int32)m_aRow->get().size() > *aOrderByIter,"Invalid Index"); - switch ((*(m_aRow->get().begin()+*aOrderByIter))->getValue().getTypeKind()) + OSL_ENSURE((sal_Int32)m_aSelectRow->get().size() > *aOrderByIter,"Invalid Index"); + switch ((*(m_aSelectRow->get().begin()+*aOrderByIter))->getValue().getTypeKind()) { case DataType::CHAR: case DataType::VARCHAR: @@ -1310,7 +1313,7 @@ void OResultSet::sortRows() OSL_FAIL("OFILECursor::Execute: Datentyp nicht implementiert"); break; } - (m_aEvaluateRow->get())[*aOrderByIter]->setBound(sal_True); + (m_aSelectRow->get())[*aOrderByIter]->setBound(sal_True); } m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending); @@ -1321,14 +1324,19 @@ void OResultSet::sortRows() while (m_aEvaluateIter != m_pEvaluationKeySet->end()) { - ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),TRUE); + ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),sal_True); ++m_aEvaluateIter; } } else { - while (ExecuteRow(IResultSetHelper::NEXT,1,TRUE)) + while ( ExecuteRow( IResultSetHelper::NEXT, 1, sal_False, sal_True ) ) { + m_aSelectRow->get()[0]->setValue( m_aRow->get()[0]->getValue() ); + if ( m_pSQLAnalyzer->hasFunctions() ) + m_pSQLAnalyzer->setSelectionEvaluationResult( m_aSelectRow, m_aColMapping ); + const sal_Int32 nBookmark = (*m_aRow->get().begin())->getValue(); + ExecuteRow( IResultSetHelper::BOOKMARK, nBookmark, sal_True, sal_False ); } } @@ -1342,7 +1350,7 @@ void OResultSet::sortRows() // ------------------------------------------------------------------------- -BOOL OResultSet::OpenImpl() +sal_Bool OResultSet::OpenImpl() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::OpenImpl" ); OSL_ENSURE(m_pSQLAnalyzer,"No analyzer set with setSqlAnalyzer!"); @@ -1410,9 +1418,9 @@ BOOL OResultSet::OpenImpl() while (bOK) { if (m_pEvaluationKeySet) - ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),TRUE); + ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),sal_True); else - bOK = ExecuteRow(IResultSetHelper::NEXT,1,TRUE); + bOK = ExecuteRow(IResultSetHelper::NEXT,1,sal_True); if (bOK) { @@ -1432,8 +1440,8 @@ BOOL OResultSet::OpenImpl() } else { - BOOL bDistinct = FALSE; - BOOL bWasSorted = FALSE; + sal_Bool bDistinct = sal_False; + sal_Bool bWasSorted = sal_False; OSQLParseNode *pDistinct = m_pParseTree->getChild(1); ::std::vector<sal_Int32> aOrderbyColumnNumberSave; ::std::vector<TAscendingOrder> aOrderbyAscendingSave; @@ -1446,14 +1454,14 @@ BOOL OResultSet::OpenImpl() aOrderbyColumnNumberSave = m_aOrderbyColumnNumber; m_aOrderbyColumnNumber.clear(); aOrderbyAscendingSave.assign(m_aOrderbyAscending.begin(), m_aOrderbyAscending.end()); - bWasSorted = TRUE; + bWasSorted = sal_True; } // the first column is the bookmark column ::std::vector<sal_Int32>::iterator aColStart = (m_aColMapping.begin()+1); ::std::copy(aColStart, m_aColMapping.end(),::std::back_inserter(m_aOrderbyColumnNumber)); m_aOrderbyAscending.assign(m_aColMapping.size()-1, SQL_ASC); - bDistinct = TRUE; + bDistinct = sal_True; } if (IsSorted()) @@ -1490,15 +1498,15 @@ BOOL OResultSet::OpenImpl() if (nMaxRow) { #if OSL_DEBUG_LEVEL > 1 - INT32 nFound=0; + sal_Int32 nFound=0; #endif - INT32 nPos; - INT32 nKey; + sal_Int32 nPos; + sal_Int32 nKey; for( size_t j = nMaxRow-1; j > 0; --j) { nPos = (m_pFileSet->get())[j]; - ExecuteRow(IResultSetHelper::BOOKMARK,nPos,FALSE); + ExecuteRow(IResultSetHelper::BOOKMARK,nPos,sal_False); m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping); { // copy row values OValueRefVector::Vector::iterator copyFrom = m_aSelectRow->get().begin(); @@ -1511,7 +1519,7 @@ BOOL OResultSet::OpenImpl() // compare with next row nKey = (m_pFileSet->get())[j-1]; - ExecuteRow(IResultSetHelper::BOOKMARK,nKey,FALSE); + ExecuteRow(IResultSetHelper::BOOKMARK,nKey,sal_False); m_pSQLAnalyzer->setSelectionEvaluationResult(m_aSelectRow,m_aColMapping); OValueRefVector::Vector::iterator loopInRow = m_aSelectRow->get().begin(); OValueVector::Vector::iterator existentInSearchRow = aSearchRow->get().begin(); @@ -1574,9 +1582,9 @@ BOOL OResultSet::OpenImpl() while (bOK) { if (m_pEvaluationKeySet) - ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),TRUE); + ExecuteRow(IResultSetHelper::BOOKMARK,(*m_aEvaluateIter),sal_True); else - bOK = ExecuteRow(IResultSetHelper::NEXT,1,TRUE); + bOK = ExecuteRow(IResultSetHelper::NEXT,1,sal_True); if (bOK) { @@ -1598,7 +1606,7 @@ BOOL OResultSet::OpenImpl() m_nRowCountResult = 0; OSL_ENSURE(m_aAssignValues.is(),"No assign values set!"); - if(!m_pTable->InsertRow(*m_aAssignValues, TRUE,m_xColsIdx)) + if(!m_pTable->InsertRow(*m_aAssignValues, sal_True,m_xColsIdx)) { m_nFilePos = 0; return sal_False; @@ -1652,7 +1660,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow, ::std::vector<sal_Int32>& _rColMapping) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::setBoundedColumns" ); - ::comphelper::UStringMixEqual aCase(_xMetaData->storesMixedCaseQuotedIdentifiers()); + ::comphelper::UStringMixEqual aCase(_xMetaData->supportsMixedCaseQuotedIdentifiers()); Reference<XPropertySet> xTableColumn; ::rtl::OUString sTableColumnName, sSelectColumnRealName; diff --git a/connectivity/source/drivers/file/FResultSetMetaData.cxx b/connectivity/source/drivers/file/FResultSetMetaData.cxx index 6d75d6f67357..6d75d6f67357 100644..100755 --- a/connectivity/source/drivers/file/FResultSetMetaData.cxx +++ b/connectivity/source/drivers/file/FResultSetMetaData.cxx diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index c470b1b2c927..63584d0a194b 100644..100755 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -442,19 +442,12 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef, return; // Everything tested and we have the name of the Column. // What number is the Column? - try - { - m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName)); - } - catch(Exception) - { - ::rtl::Reference<OSQLColumns> aSelectColumns = m_aSQLIterator.getSelectColumns(); - ::comphelper::UStringMixEqual aCase; - OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),aColumnName,aCase); - if ( aFind == aSelectColumns->get().end() ) - throw SQLException(); - m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1); - } + ::rtl::Reference<OSQLColumns> aSelectColumns = m_aSQLIterator.getSelectColumns(); + ::comphelper::UStringMixEqual aCase; + OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),aColumnName,aCase); + if ( aFind == aSelectColumns->get().end() ) + throw SQLException(); + m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1); // Ascending or Descending? m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC); @@ -740,7 +733,7 @@ void OStatement_Base::ParseAssignValues(const ::std::vector< String>& aColumnNam else if (SQL_ISTOKEN(pRow_Value_Constructor_Elem,NULL)) { // set NULL - SetAssignValue(aColumnName, String(), TRUE); + SetAssignValue(aColumnName, String(), sal_True); } else if (SQL_ISRULE(pRow_Value_Constructor_Elem,parameter)) parseParamterElem(aColumnName,pRow_Value_Constructor_Elem); @@ -752,8 +745,8 @@ void OStatement_Base::ParseAssignValues(const ::std::vector< String>& aColumnNam //------------------------------------------------------------------ void OStatement_Base::SetAssignValue(const String& aColumnName, const String& aValue, - BOOL bSetNull, - UINT32 nParameter) + sal_Bool bSetNull, + sal_uInt32 nParameter) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OStatement_Base::SetAssignValue" ); Reference<XPropertySet> xCol; diff --git a/connectivity/source/drivers/file/FStringFunctions.cxx b/connectivity/source/drivers/file/FStringFunctions.cxx index d5a9eea0407b..d5a9eea0407b 100644..100755 --- a/connectivity/source/drivers/file/FStringFunctions.cxx +++ b/connectivity/source/drivers/file/FStringFunctions.cxx diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx index 1aadb836fbac..2d31ff691e17 100644..100755 --- a/connectivity/source/drivers/file/FTable.cxx +++ b/connectivity/source/drivers/file/FTable.cxx @@ -51,7 +51,7 @@ using namespace ::com::sun::star::container; DBG_NAME( file_OFileTable ) OFileTable::OFileTable(sdbcx::OCollection* _pTables,OConnection* _pConnection) -: OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers()) +: OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) ,m_pConnection(_pConnection) ,m_pFileStream(NULL) ,m_nFilePos(0) @@ -73,7 +73,7 @@ OFileTable::OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection, const ::rtl::OUString& _Description , const ::rtl::OUString& _SchemaName, const ::rtl::OUString& _CatalogName - ) : OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers(), + ) : OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers(), _Name, _Type, _Description, @@ -205,19 +205,19 @@ void SAL_CALL OFileTable::release() throw() OTable_TYPEDEF::release(); } // ----------------------------------------------------------------------------- -BOOL OFileTable::InsertRow(OValueRefVector& /*rRow*/, BOOL /*bFlush*/,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& /*_xCols*/) +sal_Bool OFileTable::InsertRow(OValueRefVector& /*rRow*/, sal_Bool /*bFlush*/,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& /*_xCols*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::InsertRow" ); return sal_False; } // ----------------------------------------------------------------------------- -BOOL OFileTable::DeleteRow(const OSQLColumns& /*_rCols*/) +sal_Bool OFileTable::DeleteRow(const OSQLColumns& /*_rCols*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::DeleteRow" ); return sal_False; } // ----------------------------------------------------------------------------- -BOOL OFileTable::UpdateRow(OValueRefVector& /*rRow*/, OValueRefRow& /*pOrgRow*/,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& /*_xCols*/) +sal_Bool OFileTable::UpdateRow(OValueRefVector& /*rRow*/, OValueRefRow& /*pOrgRow*/,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& /*_xCols*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OFileTable::UpdateRow" ); return sal_False; diff --git a/connectivity/source/drivers/file/FTables.cxx b/connectivity/source/drivers/file/FTables.cxx index b5d918f1f0d9..b5d918f1f0d9 100644..100755 --- a/connectivity/source/drivers/file/FTables.cxx +++ b/connectivity/source/drivers/file/FTables.cxx diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx index f0683987eaa9..a69f521aff67 100644..100755 --- a/connectivity/source/drivers/file/fanalyzer.cxx +++ b/connectivity/source/drivers/file/fanalyzer.cxx @@ -104,7 +104,26 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode) m_pConnection->throwGenericSQLException(STR_QUERY_COMPLEX_COUNT,NULL); } else - m_aSelectionEvaluations.push_back( TPredicates() ); + { + if ( SQL_ISPUNCTUATION( pColumnRef, "*" ) + || ( SQL_ISRULE( pColumnRef, column_ref ) + && ( pColumnRef->count() == 3 ) + && ( pColumnRef->getChild(0)->getNodeType() == SQL_NODE_NAME ) + && SQL_ISPUNCTUATION( pColumnRef->getChild(1), "." ) + && SQL_ISRULE( pColumnRef->getChild(2), column_val ) + && SQL_ISPUNCTUATION( pColumnRef->getChild(2)->getChild(0), "*" ) + ) + ) + { + // push one element for each column of our table + const Reference< XNameAccess > xColumnNames( m_aCompiler->getOrigColumns() ); + const Sequence< ::rtl::OUString > aColumnNames( xColumnNames->getElementNames() ); + for ( sal_Int32 j=0; j<aColumnNames.getLength(); ++j ) + m_aSelectionEvaluations.push_back( TPredicates() ); + } + else + m_aSelectionEvaluations.push_back( TPredicates() ); + } } } } @@ -264,12 +283,12 @@ OOperandAttr* OSQLAnalyzer::createOperandAttr(sal_Int32 _nPos, return new OOperandAttr(static_cast<sal_uInt16>(_nPos),_xCol); } // ----------------------------------------------------------------------------- -BOOL OSQLAnalyzer::hasRestriction() const +sal_Bool OSQLAnalyzer::hasRestriction() const { return m_aCompiler->hasCode(); } // ----------------------------------------------------------------------------- -BOOL OSQLAnalyzer::hasFunctions() const +sal_Bool OSQLAnalyzer::hasFunctions() const { if ( m_bSelectionFirstTime ) { @@ -290,11 +309,12 @@ void OSQLAnalyzer::setSelectionEvaluationResult(OValueRefRow& _pRow,const ::std: { if ( aIter->second.is() ) { - sal_Int32 map = nPos; // the first column (index 0) is for convenience only. The first real select column is no 1. - if ( (nPos > 0) && (nPos < static_cast<sal_Int32>(_rColumnMapping.size())) ) + sal_Int32 map = nPos; + if ( nPos < static_cast< sal_Int32 >( _rColumnMapping.size() ) ) map = _rColumnMapping[nPos]; - aIter->second->startSelection((_pRow->get())[map]); + if ( map > 0 ) + aIter->second->startSelection( (_pRow->get())[map] ); } } } diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index 5bc61b64ccc8..bd408cd28c29 100644..100755 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -349,7 +349,7 @@ sal_Bool OOp_COMPARE::operate(const OOperand* pLeft, const OOperand* pRight) con case DataType::LONGVARCHAR: { rtl::OUString sLH = aLH, sRH = aRH; - INT32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength + sal_Int32 nRes = rtl_ustr_compareIgnoreAsciiCase_WithLength ( sLH.pData->buffer, sLH.pData->length, diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index d008cedfba08..e8464c4740d7 100644..100755 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -60,7 +60,7 @@ DBG_NAME(OPredicateCompiler) OPredicateCompiler::OPredicateCompiler(OSQLAnalyzer* pAnalyzer)//,OCursor& rCurs) : m_pAnalyzer(pAnalyzer) , m_nParamCounter(0) - , m_bORCondition(FALSE) + , m_bORCondition(sal_False) { DBG_CTOR(OPredicateCompiler,NULL); } diff --git a/connectivity/source/drivers/file/file.xml b/connectivity/source/drivers/file/file.xml index 2d8281bca957..2d8281bca957 100644..100755 --- a/connectivity/source/drivers/file/file.xml +++ b/connectivity/source/drivers/file/file.xml diff --git a/connectivity/source/drivers/file/makefile.mk b/connectivity/source/drivers/file/makefile.mk index 41f061de80ca..41f061de80ca 100644..100755 --- a/connectivity/source/drivers/file/makefile.mk +++ b/connectivity/source/drivers/file/makefile.mk diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx index 2d7d5337739d..2469169a6963 100644..100755 --- a/connectivity/source/drivers/file/quotedstring.cxx +++ b/connectivity/source/drivers/file/quotedstring.cxx @@ -45,8 +45,8 @@ namespace connectivity return 0; xub_StrLen nTokCount = 1; - BOOL bStart = TRUE; // Are we on the first character in the Token? - BOOL bInString = FALSE; // Are we WITHIN a (cStrDel delimited) String? + sal_Bool bStart = sal_True; // Are we on the first character in the Token? + sal_Bool bInString = sal_False; // Are we WITHIN a (cStrDel delimited) String? // Search for String-end after the first not matching character for( xub_StrLen i = 0; i < nLen; ++i ) @@ -54,11 +54,11 @@ namespace connectivity const sal_Unicode cChar = m_sString.GetChar(i); if (bStart) { - bStart = FALSE; + bStart = sal_False; // First character a String-Delimiter? if ( cChar == cStrDel ) { - bInString = TRUE; // then we are now WITHIN the string! + bInString = sal_True; // then we are now WITHIN the string! continue; // skip this character! } } @@ -76,7 +76,7 @@ namespace connectivity else { // String-End - bInString = FALSE; + bInString = sal_False; } } } // if (bInString) @@ -86,7 +86,7 @@ namespace connectivity if ( cChar == cTok ) { ++nTokCount; - bStart = TRUE; + bStart = sal_True; } } } @@ -103,7 +103,7 @@ namespace connectivity const xub_StrLen nLen = m_sString.Len(); if ( nLen ) { - BOOL bInString = (nStartPos < nLen) && (m_sString.GetChar(nStartPos) == cStrDel); // are we WITHIN a (cStrDel delimited) String? + sal_Bool bInString = (nStartPos < nLen) && (m_sString.GetChar(nStartPos) == cStrDel); // are we WITHIN a (cStrDel delimited) String? // First character a String-Delimiter? if (bInString ) @@ -132,7 +132,7 @@ namespace connectivity else { //end of String - bInString = FALSE; + bInString = sal_False; *pData = 0; } } |