diff options
Diffstat (limited to 'connectivity/source/drivers/file/fanalyzer.cxx')
-rwxr-xr-x[-rw-r--r--] | connectivity/source/drivers/file/fanalyzer.cxx | 32 |
1 files changed, 26 insertions, 6 deletions
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] ); } } } |