Tag: cws_src680_dba24b
User: oj      
Date: 2007-08-23 12:10:29+0000
Modified:
   dba/connectivity/source/parse/sqlnode.cxx

Log:
 #i24079# check for boolean_term inside search_condition

File Changes:

Directory: /dba/connectivity/source/parse/
==========================================

File [changed]: sqlnode.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlnode.cxx?r1=1.47.26.2&r2=1.47.26.3
Delta lines:  +20 -17
---------------------
--- sqlnode.cxx 2007-08-23 11:01:57+0000        1.47.26.2
+++ sqlnode.cxx 2007-08-23 12:10:27+0000        1.47.26.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlnode.cxx,v $
  *
- *  $Revision: 1.47.26.2 $
+ *  $Revision: 1.47.26.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/08/23 11:01:57 $
+ *  last change: $Author: oj $ $Date: 2007/08/23 12:10:27 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1877,6 +1877,8 @@
         else if(pRight->count() == 3 && SQL_ISRULE(pRight,boolean_primary) && 
SQL_ISRULE(pRight->getChild(1),search_condition))
         {
             // and-or tree  on right side
+            if ( pRight->getChild(1)->getByRule(OSQLParseNode::boolean_term) )
+            {
             OSQLParseNode* pOr = pRight->getChild(1);
             OSQLParseNode* pNewLeft = NULL;
             OSQLParseNode* pNewRight = NULL;
@@ -1892,6 +1894,7 @@
             replaceAndReset(pSearchCondition,pNewNode);
             disjunctiveNormalForm(pSearchCondition);
         }
+        }
         else if(SQL_ISRULE(pLeft,boolean_primary) && 
(!SQL_ISRULE(pLeft->getChild(1),search_condition) || 
!SQL_ISRULE(pLeft->getChild(1),boolean_term)))
             pSearchCondition->replace(pLeft, pLeft->removeAt(1));
         else if(SQL_ISRULE(pRight,boolean_primary) && 
(!SQL_ISRULE(pRight->getChild(1),search_condition) || 
!SQL_ISRULE(pRight->getChild(1),boolean_term)))
@@ -2092,7 +2095,7 @@
             pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
             replaceAndReset(pSearchCondition,pNewNode);
         }
-        else
+        else if ( p2ndSearch->getByRule(OSQLParseNode::boolean_term) )
         {
             // a and ( b or c ) -> ( a and b ) or ( a and c )
             // ( b or c ) and a -> ( a and b ) or ( a and c )




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

Reply via email to