Tag: cws_src680_qiq
User: fs      
Date: 2006/06/28 01:40:43

Modified:
   dba/connectivity/inc/connectivity/sqliterator.hxx
   dba/connectivity/source/commontools/dbexception.cxx
   dba/connectivity/source/commontools/dbtools.cxx
   dba/connectivity/source/parse/sqliterator.cxx
   dba/connectivity/source/parse/sqlnode.cxx

Log:
 #i10000#

File Changes:

Directory: /dba/connectivity/inc/connectivity/
==============================================

File [changed]: sqliterator.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/sqliterator.hxx?r1=1.20.78.4&r2=1.20.78.5
Delta lines:  +4 -8
-------------------
--- sqliterator.hxx     27 Jun 2006 13:52:26 -0000      1.20.78.4
+++ sqliterator.hxx     28 Jun 2006 08:40:40 -0000      1.20.78.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqliterator.hxx,v $
  *
- *  $Revision: 1.20.78.4 $
+ *  $Revision: 1.20.78.5 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/27 13:52:26 $
+ *  last change: $Author: fs $ $Date: 2006/06/28 08:40:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -82,7 +82,6 @@
                SQL_STATEMENT_UPDATE,
                SQL_STATEMENT_DELETE,
                SQL_STATEMENT_ODBC_CALL,
-               SQL_STATEMENT_SELECT_COUNT,
                SQL_STATEMENT_CREATE_TABLE
        };
 
@@ -110,9 +109,7 @@
                void                            
traverseANDCriteria(OSQLParseNode * pSearchCondition);
                void                            traverseOnePredicate(
                                                                                
                OSQLParseNode * pColumnRef,
-                                                                               
                sal_Int32 ePredicateType,
                                                                                
                ::rtl::OUString& aValue,
-                                                                               
                sal_Bool bCompareNull,
                                                                                
                OSQLParseNode * pParameter);
                void traverseByColumnNames(const OSQLParseNode* 
pSelectNode,sal_Bool _bOrder);
 
@@ -310,8 +307,7 @@
         /** locates a record source (a table or query) with the given name
         */
         OSQLTable   impl_locateRecordSource(
-            const ::rtl::OUString& _rComposedName,
-            const ::rtl::OUString& _rAlias
+            const ::rtl::OUString& _rComposedName
         );
 
         void setOrderByColumnName(const ::rtl::OUString & rColumnName, const 
::rtl::OUString & rTableRange, sal_Bool bAscending);

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: dbexception.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbexception.cxx?r1=1.15.56.5&r2=1.15.56.6
Delta lines:  +4 -2
-------------------
--- dbexception.cxx     9 Jun 2006 11:54:22 -0000       1.15.56.5
+++ dbexception.cxx     28 Jun 2006 08:40:40 -0000      1.15.56.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbexception.cxx,v $
  *
- *  $Revision: 1.15.56.5 $
+ *  $Revision: 1.15.56.6 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/09 11:54:22 $
+ *  last change: $Author: fs $ $Date: 2006/06/28 08:40:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -515,6 +515,8 @@
         case SQL_FEATURE_NOT_IMPLEMENTED:   pAsciiState = "HYC00"; break;
         case SQL_FUNCTION_NOT_SUPPORTED:    pAsciiState = "IM001"; break;
         case SQL_CONNECTION_DOES_NOT_EXIST: pAsciiState = "08003"; break;
+        default:
+            break;
     }
     if ( !pAsciiState )
         throw RuntimeException();

File [changed]: dbtools.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools.cxx?r1=1.59.34.4&r2=1.59.34.5
Delta lines:  +6 -3
-------------------
--- dbtools.cxx 27 Jun 2006 13:58:09 -0000      1.59.34.4
+++ dbtools.cxx 28 Jun 2006 08:40:40 -0000      1.59.34.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtools.cxx,v $
  *
- *  $Revision: 1.59.34.4 $
+ *  $Revision: 1.59.34.5 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/27 13:58:09 $
+ *  last change: $Author: fs $ $Date: 2006/06/28 08:40:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -898,6 +898,9 @@
                        break;
         case eComplete:
             bIgnoreMetaData = true;
+            break;
+        case eInDataManipulation:
+            // already properly set above
             break;
        }
 

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.10&r2=1.46.78.11
Delta lines:  +15 -68
---------------------
--- sqliterator.cxx     28 Jun 2006 07:39:19 -0000      1.46.78.10
+++ sqliterator.cxx     28 Jun 2006 08:40:40 -0000      1.46.78.11
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqliterator.cxx,v $
  *
- *  $Revision: 1.46.78.10 $
+ *  $Revision: 1.46.78.11 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/28 07:39:19 $
+ *  last change: $Author: fs $ $Date: 2006/06/28 08:40:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -145,8 +145,8 @@
                                              const Reference< XNameAccess >& 
_rxTables,
                                                                                
         const OSQLParser& _rParser,
                                              const OSQLParseNode* pRoot )
-    :m_pImpl( new OSQLParseTreeIteratorImpl( _rxConnection, _rxTables ) )
-       ,m_rParser( _rParser )
+    :m_rParser( _rParser )
+    ,m_pImpl( new OSQLParseTreeIteratorImpl( _rxConnection, _rxTables ) )
 {
        setParseTree(pRoot);
 }
@@ -263,10 +263,6 @@
                static const ::rtl::OUString 
s_sTableTypeTable(RTL_CONSTASCII_USTRINGPARAM("TABLE"));
                static const ::rtl::OUString s_sWildcard = 
::rtl::OUString::createFromAscii("%");
 
-        ::rtl::OUString sSchema( _rSchema );
-               if ( !sSchema.getLength() )
-                       sSchema = s_sWildcard;
-               
                // we want all catalogues, all schemas, all tables
                Sequence< ::rtl::OUString > sTableTypes(3);
                sTableTypes[0] = s_sTableTypeView;
@@ -278,7 +274,7 @@
                        sComposedName = ::rtl::OUString();
 
             Reference< XResultSet> xRes = _rxDBMeta->getTables(
-                _rCatalog.getLength() ? makeAny( _rCatalog ) : Any(), sSchema, 
_rTableName, sTableTypes );
+                _rCatalog.getLength() ? makeAny( _rCatalog ) : Any(), 
_rSchema.getLength() ? _rSchema : s_sWildcard, _rTableName, sTableTypes );
 
                        Reference< XRow > xCurrentRow( xRes, UNO_QUERY );
             if ( xCurrentRow.is() && xRes->next() )
@@ -345,7 +341,7 @@
 }
 
 //-----------------------------------------------------------------------------
-OSQLTable OSQLParseTreeIterator::impl_locateRecordSource( const 
::rtl::OUString& _rComposedName, const ::rtl::OUString& _rAlias )
+OSQLTable OSQLParseTreeIterator::impl_locateRecordSource( const 
::rtl::OUString& _rComposedName )
 {
     if ( !_rComposedName.getLength() )
     {
@@ -444,7 +440,7 @@
                aTableRange = aComposedName;
 
     // get the object representing this table/query
-    OSQLTable aTable = impl_locateRecordSource( aComposedName, aTableRange );
+    OSQLTable aTable = impl_locateRecordSource( aComposedName );
     if ( aTable.is() )
         _rTables[ aTableRange ] = aTable;
 }
@@ -600,12 +596,6 @@
        }
 
        OSQLParseNode* pTableName = NULL;
-    bool           bIsCreateTable = false;
-
-       // pTableName auf den (einzigen) Tabellennamen im Statement setzen.
-       // Je nach Statement (SELECT, INSERT, UPDATE, DELETE) an anderer 
Position.
-       // Bei Select koennen mehrere Tabellennamen auftreten, bei den uebrigen 
Statements
-       // ist ohnehin immer nur einer moeglich.
 
     switch ( m_eStatementType )
     {
@@ -622,6 +612,8 @@
         case SQL_STATEMENT_UPDATE:
                    pTableName = m_pParseTree->getChild(1);
             break;
+        default:
+            break;
     }
 
     if ( pTableName )
@@ -1216,43 +1208,14 @@
         // Sonst einzelne Suchkriterien wie =, !=, ..., LIKE, IS NULL usw. 
behandeln:
        else if (SQL_ISRULE(pSearchCondition,comparison_predicate) )
        {
-        sal_Int32 ePredicateType( SQLFilterOperator::EQUAL );
-               OSQLParseNode *pPrec = pSearchCondition->getChild(1);
-        switch ( pPrec->getNodeType() )
-        {
-        case SQL_NODE_EQUAL:
-                       ePredicateType = SQLFilterOperator::EQUAL;
-            break;
-        case SQL_NODE_NOTEQUAL:
-                       ePredicateType = SQLFilterOperator::NOT_EQUAL;
-            break;
-        case SQL_NODE_LESS:
-                       ePredicateType = SQLFilterOperator::LESS;
-            break;
-        case SQL_NODE_LESSEQ:
-                       ePredicateType = SQLFilterOperator::LESS_EQUAL;
-            break;
-        case SQL_NODE_GREATEQ:
-                       ePredicateType = SQLFilterOperator::GREATER_EQUAL;
-            break;
-        case SQL_NODE_GREAT:
-                       ePredicateType = SQLFilterOperator::GREATER;
-            break;
-        default:
-            OSL_ENSURE( false, "OSQLParseTreeIterator::traverseANDCriteria: 
unexpected comparison predicate type!" );
-            break;
-        }
-
                ::rtl::OUString aValue;
                pSearchCondition->getChild(2)->parseNodeToStr( aValue, 
m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False );
-               
traverseOnePredicate(pSearchCondition->getChild(0),ePredicateType,aValue,sal_False,pSearchCondition->getChild(2));
+               
traverseOnePredicate(pSearchCondition->getChild(0),aValue,pSearchCondition->getChild(2));
 //             if (! aIteratorStatus.IsSuccessful())
 //                     return;
        }
        else if (SQL_ISRULE(pSearchCondition,like_predicate) /*&& 
SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
        {
-               sal_Int32 ePredicateType;
-
                OSL_ENSURE(pSearchCondition->count() >= 
4,"OSQLParseTreeIterator: error in parse tree!");
 
                sal_Int32 nCurentPos = pSearchCondition->count()-2;
@@ -1260,11 +1223,6 @@
                OSQLParseNode * pNum_value_exp  = 
pSearchCondition->getChild(nCurentPos);
                OSQLParseNode * pOptEscape              = 
pSearchCondition->getChild(nCurentPos+1);
 
-               if (pSearchCondition->getChild(1)->getTokenID() == 
SQL_TOKEN_NOT)
-                       ePredicateType = SQLFilterOperator::NOT_LIKE;
-               else
-                       ePredicateType = SQLFilterOperator::LIKE;
-
                OSL_ENSURE(pNum_value_exp != NULL,"OSQLParseTreeIterator: error 
in parse tree!");
                OSL_ENSURE(pOptEscape != NULL,"OSQLParseTreeIterator: error in 
parse tree!");
 
@@ -1287,7 +1245,7 @@
                        pParam = pNum_value_exp;
                }
 
-               
traverseOnePredicate(pSearchCondition->getChild(0),ePredicateType,aValue,sal_False,pParam);
+               
traverseOnePredicate(pSearchCondition->getChild(0),aValue,pParam);
 //             if (! aIteratorStatus.IsSuccessful())
 //                     return;
        }
@@ -1316,26 +1274,18 @@
        }
        else if (SQL_ISRULE(pSearchCondition,test_for_null) /*&& 
SQL_ISRULE(pSearchCondition->getChild(0),column_ref)*/)
        {
-               sal_Int32 ePredicateType;
-
                OSL_ENSURE(pSearchCondition->count() >= 
3,"OSQLParseTreeIterator: error in parse tree!");
                
OSL_ENSURE(SQL_ISTOKEN(pSearchCondition->getChild(1),IS),"OSQLParseTreeIterator:
 error in parse tree!");
 
-               if (SQL_ISTOKEN(pSearchCondition->getChild(2),NOT) )
-                       ePredicateType = SQLFilterOperator::NOT_SQLNULL;
-               else
-                       ePredicateType = SQLFilterOperator::SQLNULL;
-
                ::rtl::OUString aString;
-               
traverseOnePredicate(pSearchCondition->getChild(0),ePredicateType,aString,sal_True,NULL);
+               
traverseOnePredicate(pSearchCondition->getChild(0),aString,NULL);
                //      if (! aIteratorStatus.IsSuccessful()) return;
        } 
        else if (SQL_ISRULE(pSearchCondition,num_value_exp) || 
SQL_ISRULE(pSearchCondition,term))
        {
-               sal_Int32 ePredicateType = SQLFilterOperator::EQUAL;
                ::rtl::OUString aString;
-               
traverseOnePredicate(pSearchCondition->getChild(0),ePredicateType,aString,sal_False,pSearchCondition->getChild(0));
-               
traverseOnePredicate(pSearchCondition->getChild(2),ePredicateType,aString,sal_False,pSearchCondition->getChild(2));
+               
traverseOnePredicate(pSearchCondition->getChild(0),aString,pSearchCondition->getChild(0));
+               
traverseOnePredicate(pSearchCondition->getChild(2),aString,pSearchCondition->getChild(2));
        }
        // Fehler einfach weiterreichen.
 }
@@ -1448,9 +1398,7 @@
 //-----------------------------------------------------------------------------
 void OSQLParseTreeIterator::traverseOnePredicate(
                                                                OSQLParseNode * 
pColumnRef,
-                                                               sal_Int32 
ePredicateType,
                                                                
::rtl::OUString& rValue,
-                                                               sal_Bool 
bCompareNull,
                                                                OSQLParseNode * 
pParseNode)
 {
        if ( !pParseNode )
@@ -1505,8 +1453,7 @@
        }
     break;
 
-    case SQL_STATEMENT_INSERT:
-    case SQL_STATEMENT_UPDATE:
+    default:
         OSL_ENSURE( false, "OSQLParseTreeIterator::traverseAll: not yet 
implemented for this statement type!" );
         break;
     }

File [changed]: sqlnode.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlnode.cxx?r1=1.38.62.9&r2=1.38.62.10
Delta lines:  +3 -3
-------------------
--- sqlnode.cxx 28 Jun 2006 07:39:19 -0000      1.38.62.9
+++ sqlnode.cxx 28 Jun 2006 08:40:41 -0000      1.38.62.10
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlnode.cxx,v $
  *
- *  $Revision: 1.38.62.9 $
+ *  $Revision: 1.38.62.10 $
  *
- *  last change: $Author: fs $ $Date: 2006/06/28 07:39:19 $
+ *  last change: $Author: fs $ $Date: 2006/06/28 08:40:41 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.




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

Reply via email to