summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2015-02-03 16:12:50 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2015-02-03 15:21:52 +0000
commit954840d55ede990b368c5314bdb876ced56cfbe2 (patch)
treedc0771e91e6194556af88e89afaaeb7d5185d397
parentce1af2f54e06933b372f832cc110bdd4d9edfb8f (diff)
tdf#89048 Macab initialize record list even for never-match condition.
Change-Id: I323f6532d00f30cde50616e9399cad6bbe00cb8c Reviewed-on: https://gerrit.libreoffice.org/14310 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
-rw-r--r--connectivity/source/drivers/macab/MacabResultSet.cxx5
-rw-r--r--connectivity/source/drivers/macab/MacabStatement.cxx2
2 files changed, 6 insertions, 1 deletions
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
index d0206dfcbe23..934db874e956 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -86,6 +86,11 @@ void MacabResultSet::someMacabRecords(const MacabCondition *pCondition)
// maximum alloted size, which means that we'll never have to resize)
m_aMacabRecords = new MacabRecords(allRecords);
+ if(pCondition->isAlwaysFalse())
+ {
+ return;
+ }
+
MacabRecords::iterator iterator;
for (iterator = allRecords->begin();
diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx
index c5a0c3ec3d22..800acc127af7 100644
--- a/connectivity/source/drivers/macab/MacabStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabStatement.cxx
@@ -331,7 +331,7 @@ void MacabCommonStatement::selectRecords(MacabResultSet *pResult) const throw(SQ
MacabCondition *pCondition = analyseWhereClause(pParseNode);
if (pCondition->isAlwaysTrue())
pResult->allMacabRecords();
- else if (!pCondition->isAlwaysFalse())
+ else
pResult->someMacabRecords(pCondition);
delete pCondition;
return;