From 6eb29124916c3c18a89b701a370c200dcd445439 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Fri, 20 Sep 2024 10:55:08 +0100 Subject: [PATCH] need to sort keyFilter --- rtl/eclrtl/rtlnewkey.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtl/eclrtl/rtlnewkey.cpp b/rtl/eclrtl/rtlnewkey.cpp index 4656138976a..30ac0e98ae9 100644 --- a/rtl/eclrtl/rtlnewkey.cpp +++ b/rtl/eclrtl/rtlnewkey.cpp @@ -2251,15 +2251,19 @@ void RowFilter::splitIntoKeyFilter(const RtlRecord & record, RowFilter &keyFilte return; unsigned numKeyedFields = record.getNumKeyedFields(); + IConstArrayOf keyFilters; ForEachItemInRev(i, filters) { const IFieldFilter & cur = filters.item(i); if (cur.queryFieldIndex() < numKeyedFields) { - keyFilter.addFilter(OLINK(cur)); + keyFilters.append(OLINK(cur)); filters.remove(i); } } + keyFilters.sort(compareFieldFilters); // NB: need to be ordered ahead of keyFilter.createSegmentMonitors being used + ForEachItemIn(kf, keyFilters) + keyFilter.addFilter(OLINK(keyFilters.item(kf))); //There is either a payload filter, in which case numFieldsRequired will not change, or now no filter if (filters.ordinality() == 0) numFieldsRequired = 0;