[8.4] MOD-14063: Fix FILTER bug with multiple indexes with the same field aliases#8596
[8.4] MOD-14063: Fix FILTER bug with multiple indexes with the same field aliases#8596
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.4 #8596 +/- ##
==========================================
- Coverage 85.54% 85.50% -0.05%
==========================================
Files 337 337
Lines 53353 53356 +3
Branches 11023 11023
==========================================
- Hits 45642 45620 -22
- Misses 7568 7593 +25
Partials 143 143
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… aliases (#8396) * Fix loaded document in rename flow * Address review * Add test * Fix FILTER bug with multiple indexes with the same field alias
a958943 to
a5f2838
Compare
|
|
Approved by me. |



Summary
Backport of commit 9c70952 from master to 8.4 branch.
This PR fixes a bug where the
FILTERexpression evaluation was incorrectly sharing field aliases between multiple indexes, causing incorrect indexing behavior.Related Jira: MOD-14334
Original PR: #8396
Conflicts Resolved
The following conflicts were encountered during the cherry-pick and resolved as follows:
1.
src/rlookup.c_head/_tailnaming convention for RLookup struct members while the 8.4 branch useshead/tail.head/tail) as this is consistent with the existing codebase in this branch. Also kept thememset(lk, 0, sizeof(*lk))from the incoming change (important for the fix).2.
tests/pytests/test_followhashes.pyPull Request opened by Augment Code with guidance from the PR author
Note
Medium Risk
Touches indexing-time
FILTERevaluation andRLookuplifecycle/reset logic; incorrect cleanup could cause missed/extra indexing or memory issues, though changes are localized and covered by new tests.Overview
Fixes a bug where
FILTERexpressions could reuse staleRLookup/row state across multiple index evaluations, leading to incorrect indexing when indexes share field aliases.The filter-evaluation loop now explicitly resets lookup/row state between indexes, and
RLookupcleanup/reset is hardened (clear struct to zero, nulldynafter free, add an assertion onndyn). Adds a dedicatedtest_filter.pysuite (and moves prior filter tests out oftest_followhashes.py) to cover multi-index/alias scenarios and related filter behavior.Written by Cursor Bugbot for commit 5fde59b. This will update automatically on new commits. Configure here.