Tag: cws_src680_qiq
User: fs      
Date: 06/05/10 05:41:24

Modified:
 /dba/dbaccess/source/core/api/
  SingleSelectQueryComposer.cxx

Log:
 #i51143# getColumns should also use parseNoteToExecutableStatement

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: SingleSelectQueryComposer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/SingleSelectQueryComposer.cxx?r1=1.13.18.1&r2=1.13.18.2
Delta lines:  +12 -5
--------------------
--- SingleSelectQueryComposer.cxx       10 May 2006 10:55:55 -0000      
1.13.18.1
+++ SingleSelectQueryComposer.cxx       10 May 2006 12:41:21 -0000      
1.13.18.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SingleSelectQueryComposer.cxx,v $
  *
- *  $Revision: 1.13.18.1 $
+ *  $Revision: 1.13.18.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/10 10:55:55 $
+ *  last change: $Author: fs $ $Date: 2006/05/10 12:41:21 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -240,7 +240,7 @@
  , m_aSqlParser(_xServiceFactory)
  , m_aSqlIterator( _xConnection, _rxTables, NULL, &m_aSqlParser )
  , m_aAdditiveIterator( _xConnection, _rxTables, NULL, &m_aSqlParser )
- , m_xTables( _rxTables )
+ , m_xConnectionTables( _rxTables )
  ,m_xServiceFactory(_xServiceFactory)
  ,m_pTables(NULL)
  ,m_nBoolCompareMode(BOOL_COMPARISON_DEFAULT)
@@ -312,7 +312,7 @@
     resetIterator( m_aSqlIterator, true );
     resetIterator( m_aAdditiveIterator, true );
 
-       m_xTables       = NULL;
+       m_xConnectionTables     = NULL;
        m_xConnection           = NULL;
        m_xServiceFactory       = NULL;
 
@@ -573,7 +573,7 @@
        ::osl::MutexGuard aGuard( m_aMutex );
 
     // parse and verify the statement, building a temporary iterator
-    OSQLParseTreeIterator aElementaryIterator( m_xConnection, m_xTables, NULL, 
&m_aSqlParser );
+    OSQLParseTreeIterator aElementaryIterator( m_xConnection, 
m_xConnectionTables, NULL, &m_aSqlParser );
     parseAndCheck_throwError( m_aSqlParser, _rElementary, aElementaryIterator, 
*this );
 
     // remember the 4 current "additive" clauses
@@ -743,6 +743,13 @@
                                ::rtl::OUString sGroupBy = 
getSQLPart(Group,m_aSqlIterator,sal_True);
                                if ( sGroupBy.getLength() )
                                        sSql += sGroupBy;
+
+                // normalize the statement so that it doesn't contain any 
application-level features anymore
+                ::rtl::OUString sError;
+                const ::std::auto_ptr< OSQLParseNode > pStatementTree( 
m_aSqlParser.parseTree( sError, sSql, false ) );
+                DBG_ASSERT( pStatementTree.get(), 
"OSingleSelectQueryComposer::getColumns: could not parse the column retrieval 
statement!" );
+                if ( pStatementTree.get() )
+                    pStatementTree->parseNodeToExecutableStatement( sSql, 
m_xConnection );
 
                                Reference<XResultSetMetaDataSupplier> 
xResMetaDataSup;
                                xResMetaDataSup = 
Reference<XResultSetMetaDataSupplier>(xStmt->executeQuery(sSql),UNO_QUERY);




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

Reply via email to