-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assert-crash due to excessive scores length
For searches that hit multiple mailboxes (virtual mailboxes is an easy way to force a multisearch), an assert-crash will happen if a message matches both the main query and internal "maybe" queries. Fix by ensuring that scores are only added once per UID. This was broken in single mailbox search as well, but it was ignored there as there was no assert check on scores length (the extra entries were ignored during processing). In order to calcuate scores correctly (now that we are only adding them once), refactor result iteration to only run the maybe query once for all maybe queries. Add the main query to this query for score calculation purposes. This is a bit of an optimization, so nice. Fixes GitHub Issue #61
- Loading branch information
Showing
3 changed files
with
66 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
messages: 1 | ||
|
||
ok search or from user body body | ||
* search 1 | ||
ok search or header reply-to user body body | ||
* search 1 | ||
ok search or header reply-to foo body bar | ||
* search | ||
ok search or header reply-to user or header reply-to domain body body | ||
* search 1 | ||
|
||
ok examine Virtual/All | ||
|
||
# From header works | ||
ok search or from user body body | ||
* search 1 | ||
|
||
# Panic: file fts-search.c: line 87 (level_scores_add_vuids): assertion failed: (array_count(&vuids_arr) == array_count(&br->scores)) | ||
ok search or header reply-to user body body | ||
* search 1 | ||
ok search or header reply-to foo body bar | ||
* search | ||
ok search or header reply-to user or header reply-to domain body body | ||
* search 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters