Tag: cws_src680_qiq
User: fs      
Date: 2006/06/30 06:27:03

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

Log:
 during #i51143#: PROPERTY_ID_HY0000 superseded by 
StandardSQLState.SQL_GENERAL_ERROR

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.10&r2=1.13.18.11
Delta lines:  +17 -11
---------------------
--- SingleSelectQueryComposer.cxx       28 Jun 2006 10:31:07 -0000      
1.13.18.10
+++ SingleSelectQueryComposer.cxx       30 Jun 2006 13:27:00 -0000      
1.13.18.11
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SingleSelectQueryComposer.cxx,v $
  *
- *  $Revision: 1.13.18.10 $
+ *  $Revision: 1.13.18.11 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/28 10:31:07 $
+ *  last change: $Author: fs $ $Date: 2006/06/30 13:27:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -162,9 +162,10 @@
            const OSQLParseNode* pNewSqlParseNode = _rParser.parseTree( 
aErrorMsg, _rStatement );
            if ( !pNewSqlParseNode )
            {
-                   SQLException 
aError2(aErrorMsg,_rxContext,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HY000")),1000,Any());
-                   SQLException 
aError1(_rStatement,_rxContext,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HY000")),1000,makeAny(aError2));
-                   throw 
SQLException(_rParser.getContext().getErrorMessage(OParseContext::ERROR_GENERAL),_rxContext,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HY000")),1000,makeAny(aError1));
+            ::rtl::OUString sSQLStateGeneralError( getStandardSQLState( 
SQL_GENERAL_ERROR ) );
+                   SQLException aError2( aErrorMsg, _rxContext, 
sSQLStateGeneralError, 1000, Any() );
+                   SQLException aError1( _rStatement, _rxContext, 
sSQLStateGeneralError, 1000, makeAny( aError2 ) );
+                   throw 
SQLException(_rParser.getContext().getErrorMessage(OParseContext::ERROR_GENERAL),_rxContext,sSQLStateGeneralError,1000,makeAny(aError1));
            }
         return pNewSqlParseNode;
     }
@@ -189,9 +190,9 @@
             // restore the old node before throwing the exception
             _rIterator.setParseTree( pOldNode );
             // and now really ...
-                   SQLException aError1( _rOriginatingCommand, _rxContext, 
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HY000" ) ), 1000, Any() );
+                   SQLException aError1( _rOriginatingCommand, _rxContext, 
getStandardSQLState( SQL_GENERAL_ERROR ), 1000, Any() );
                    throw SQLException( DBACORE_RESSTRING( RID_STR_ONLY_QUERY 
), _rxContext,
-                           ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"HY000" ) ), 1000, makeAny( aError1 ) );
+                           getStandardSQLState( SQL_GENERAL_ERROR ), 1000, 
makeAny( aError1 ) );
            }
 
         delete pOldNode;
@@ -757,7 +758,8 @@
         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, m_aSqlParser );
+            if ( !pStatementTree->parseNodeToExecutableStatement( sSql, 
m_xConnection, m_aSqlParser, NULL ) )
+                break;
 
                Reference< XResultSetMetaData > xResultSetMeta;
         try
@@ -881,7 +883,7 @@
     if ( aNames.empty() )
         m_aCurrentColumns[ SelectColumns ] = 
OPrivateColumns::createWithIntrinsicNames( aSelectColumns, bCase, *this, 
m_aMutex );
     else
-        m_aCurrentColumns[SelectColumns] = new OPrivateColumns( 
aSelectColumns, bCase, *this, m_aMutex, aNames );
+        m_aCurrentColumns[ SelectColumns ] = new OPrivateColumns( 
aSelectColumns, bCase, *this, m_aMutex, aNames );
 
        return m_aCurrentColumns[SelectColumns];
 }
@@ -1349,7 +1351,7 @@
        return setCurrentColumns( OrderColumns, 
m_aAdditiveIterator.getOrderColumns() );
 }
 // 
-----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getQueryWithSubstitution( 
 ) throw (::com::sun::star::uno::RuntimeException)
+::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getQueryWithSubstitution( 
 ) throw (SQLException, RuntimeException)
 {
        ::osl::MutexGuard aGuard( m_aMutex );
        ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
@@ -1358,7 +1360,11 @@
 
     const OSQLParseNode* pStatementNode = m_aSqlIterator.getParseTree();
     if ( pStatementNode )
-        pStatementNode->parseNodeToExecutableStatement( sSqlStatement, 
m_xConnection, m_aSqlParser );
+    {
+        SQLException aError;
+        if ( !pStatementNode->parseNodeToExecutableStatement( sSqlStatement, 
m_xConnection, m_aSqlParser, &aError ) )
+            throw SQLException( aError );
+    }
 
     return sSqlStatement;
 }




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

Reply via email to