summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity')
-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 0588b15a158f..eeaec1ff40f1 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 fdaad4cd81c1..84e9aa2532ff 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));