1. mst
  2. ooo340

Commits

Ocke Janssen [oj]  committed a484eeb

dba33f: #i111900# fix between

  • Participants
  • Parent commits 1ade644
  • Branches default

Comments (0)

Files changed (2)

File connectivity/source/drivers/file/fcomp.cxx

View file
 
 	OSQLParseNode* pColumn = pPredicateNode->getChild(0);
     const OSQLParseNode* pPart2 = pPredicateNode->getChild(1);
-	OSQLParseNode* p1stValue = pPart2->getChild(3);
-	OSQLParseNode* p2ndtValue = pPart2->getChild(5);
+	OSQLParseNode* p1stValue = pPart2->getChild(2);
+	OSQLParseNode* p2ndtValue = pPart2->getChild(4);
 
 	if (
 			!(p1stValue->getNodeType() == SQL_NODE_STRING || SQL_ISRULE(p1stValue,parameter))

File connectivity/source/parse/sqlbison.y

View file
 			{
 				$$ = SQL_NEW_RULE;
 				
-				sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildPredicateRule($$,$2,$1,$4);
+				sal_Int16 nErg = xxx_pGLOBAL_SQLPARSER->buildPredicateRule($$,$3,$2,$5);
 				if(nErg == 1)
 				{
 					OSQLParseNode* pTemp = $$;
 					$$ = pTemp->removeAt((sal_uInt32)0);
-					$$->insert(1,$1);
+					OSQLParseNode* pColumnRef = $$->removeAt((sal_uInt32)0);
+					$$->insert(0,$1);
+					OSQLParseNode* pBetween_predicate = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate));
+					pBetween_predicate->append(pColumnRef);
+					pBetween_predicate->append($$);
+					$$ = pBetween_predicate;
+					
 					delete pTemp;
 					delete $4;
 				}
 	pColumnRef->append(new OSQLInternalNode(m_sFieldName,SQL_NODE_NAME));
 	OSQLParseNode* pComp = NULL;
 	if ( SQL_ISTOKEN( pCompare, BETWEEN) && pLiteral2 )
-		pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate));
+		pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::between_predicate_part_2));
 	else
 		pComp = new OSQLInternalNode(aEmptyString, SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::comparison_predicate));