Tag: cws_src680_qiq User: fs Date: 2006/06/30 07:55:38 Modified: dba/connectivity/source/parse/sqliterator.cxx
Log: corected parameter in sub query parsing File Changes: Directory: /dba/connectivity/source/parse/ ========================================== File [changed]: sqliterator.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqliterator.cxx?r1=1.46.78.15&r2=1.46.78.16 Delta lines: +17 -13 --------------------- --- sqliterator.cxx 30 Jun 2006 13:34:08 -0000 1.46.78.15 +++ sqliterator.cxx 30 Jun 2006 14:55:36 -0000 1.46.78.16 @@ -4,9 +4,9 @@ * * $RCSfile: sqliterator.cxx,v $ * - * $Revision: 1.46.78.15 $ + * $Revision: 1.46.78.16 $ * - * last change: $Author: fs $ $Date: 2006/06/30 13:34:08 $ + * last change: $Author: fs $ $Date: 2006/06/30 14:55:36 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -109,8 +109,8 @@ Reference< XNameAccess > m_xTableContainer; Reference< XNameAccess > m_xQueryContainer; - ::std::auto_ptr< OSQLTables > m_pTables; /// all tables which participate in the SQL statement - ::std::auto_ptr< OSQLTables > m_pSubTables; /// all tables from sub queries not the tables from the select tables + ::boost::shared_ptr< OSQLTables > m_pTables; /// all tables which participate in the SQL statement + ::boost::shared_ptr< OSQLTables > m_pSubTables; /// all tables from sub queries not the tables from the select tables ::boost::shared_ptr< QueryNameSet > m_pForbiddenQueryNames; sal_uInt32 m_nIncludeMask; @@ -173,7 +173,7 @@ ~ForbidQueryName() { - m_rpAllForbiddenNames->insert( m_sForbiddenQueryName ); + m_rpAllForbiddenNames->erase( m_sForbiddenQueryName ); } }; } @@ -349,7 +349,7 @@ //----------------------------------------------------------------------------- void OSQLParseTreeIterator::impl_getQueryParameterColumns( const OSQLTable& _rQuery ) { - if ( ( m_pImpl->m_nIncludeMask & Parameters ) == 0 ) + if ( ( m_pImpl->m_nIncludeMask & Parameters ) != Parameters ) // parameters not to be included in the traversal return; @@ -478,7 +478,7 @@ //----------------------------------------------------------------------------- void OSQLParseTreeIterator::traverseOneTableName( OSQLTables& _rTables,const OSQLParseNode * pTableName, const ::rtl::OUString & rTableRange ) { - if ( ( m_pImpl->m_nIncludeMask & TableNames ) == 0 ) + if ( ( m_pImpl->m_nIncludeMask & TableNames ) != TableNames ) // tables should not be included in the traversal return; @@ -891,6 +891,9 @@ //----------------------------------------------------------------------------- bool OSQLParseTreeIterator::traverseSelectColumnNames(const OSQLParseNode* pSelectNode) { + if ( ( m_pImpl->m_nIncludeMask & SelectColumns ) != SelectColumns ) + return true; + if (!pSelectNode || m_eStatementType != SQL_STATEMENT_SELECT || m_pImpl->m_pTables->empty()) { impl_appendError( IParseContext::ERROR_GENERAL ); @@ -1351,7 +1354,7 @@ if ( !SQL_ISRULE( _pParseNode, parameter ) ) return; - if ( ( m_pImpl->m_nIncludeMask & Parameters ) == 0) + if ( ( m_pImpl->m_nIncludeMask & Parameters ) != Parameters ) // parameters not to be included in the traversal return; @@ -1481,20 +1484,21 @@ //----------------------------------------------------------------------------- void OSQLParseTreeIterator::traverseSome( sal_uInt32 _nIncludeMask ) { - m_pImpl->m_nIncludeMask = _nIncludeMask; - impl_traverse(); + impl_traverse( _nIncludeMask ); } //----------------------------------------------------------------------------- void OSQLParseTreeIterator::traverseAll() { - m_pImpl->m_nIncludeMask = All; - impl_traverse(); + impl_traverse( All ); } //----------------------------------------------------------------------------- -void OSQLParseTreeIterator::impl_traverse() +void OSQLParseTreeIterator::impl_traverse( sal_uInt32 _nIncludeMask ) { + impl_resetErrors(); + m_pImpl->m_nIncludeMask = _nIncludeMask; + if ( !traverseTableNames( *m_pImpl->m_pTables ) ) return; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
