summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-05-28 11:37:27 +0200
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-05-28 11:37:27 +0200
commit9ddc3b8742845a1498d5d5ce44b33d0026c62e3a (patch)
tree3ac4a12a618626b6635dc2744a0d22296d244487
parentb7f00fd5aee03677894553980e8fe07a81bfd37b (diff)
dba33f: #i111900# fix between
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx4
-rw-r--r--connectivity/source/parse/sqlbison.y12
2 files changed, 11 insertions, 5 deletions
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index cfb679ac98..1216cf5409 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -333,8 +333,8 @@ OOperand* OPredicateCompiler::execute_BETWEEN(OSQLParseNode* pPredicateNode) thr
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))
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index fdaad4cd81..84e9aa2532 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -1193,12 +1193,18 @@ between_predicate_part_2:
{
$$ = 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;
}
@@ -4253,7 +4259,7 @@ sal_Int16 OSQLParser::buildNode(OSQLParseNode*& pAppend,OSQLParseNode* pCompare,
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));