diff --git a/TightDB.vcxproj.filters b/TightDB.vcxproj.filters
index b5acc80cd7b..1232ee55e9c 100644
--- a/TightDB.vcxproj.filters
+++ b/TightDB.vcxproj.filters
@@ -109,9 +109,6 @@
src
-
- src
-
src
@@ -167,6 +164,9 @@
src
+
+ test
+
diff --git a/src/tightdb/query_engine.hpp b/src/tightdb/query_engine.hpp
index 10b7e6ddfda..a362043687c 100644
--- a/src/tightdb/query_engine.hpp
+++ b/src/tightdb/query_engine.hpp
@@ -509,7 +509,7 @@ template class NODE: public Pa
m_condition_column = column;
m_leaf_end = 0;
m_value = value;
- m_conds = 1;
+ m_conds = 0;
}
void Init(const Table& table)
@@ -607,6 +607,8 @@ template class NODE: public Pa
template
size_t aggregate_local(QueryStateParent* st, size_t start, size_t end, size_t local_limit,
SequentialGetterParent* source_column, size_t* matchcount) {
+
+
TConditionFunction f;
int c = f.condition();
@@ -630,8 +632,7 @@ template class NODE: public Pa
else
end2 = end - m_leaf_start;
- if (m_conds <= 1 && source_column == NULL) {
-
+ if (m_conds <= 1 && source_column != NULL && SameType::value && static_cast*>(source_column)->m_column == m_condition_column) {
m_array.find(c, TAction, m_value, s - m_leaf_start, end2, m_leaf_start, (QueryState*)st);
}
else {
@@ -805,7 +806,7 @@ template class BASICNODE: publ
m_condition_column.m_column = (ColType*)column;
m_condition_column.m_leaf_end = 0;
m_value = value;
- m_conds = 1;
+ m_conds = 0;
}
void Init(const Table& table)