After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564954 - "Match All" search folder shows no messages
"Match All" search folder shows no messages
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.24.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[vfolders] evolution[disk-su...
Depends on:
Blocks: 543389
 
 
Reported: 2008-12-18 03:58 UTC by Matt McCutchen
Modified: 2009-01-12 05:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Fix SQL-ization of booleans and immediate-function confusion (1.71 KB, patch)
2008-12-18 06:16 UTC, Matt McCutchen
committed Details | Review

Description Matt McCutchen 2008-12-18 03:58:47 UTC
Please describe the problem:
A search folder with the single criterion "Match All" and "Include threads" set to "None" shows no messages.  It should show all messages from its source folders.

I'm using the latest code from the 2.24 branch.

Steps to reproduce:
1. Run Evolution in a new user account and complete the email setup wizard.
2. Create a search folder with source "All local folders", single criterion "Match All", and "Include threads" set to "None".
3. Restart Evolution so the search folder appears (bug 564953).
4. If the Inbox does not already contain the "Welcome to Evolution" message, add a message to it via "Message" -> "Post New Message to Folder".
5. Open the search folder.


Actual results:
No messages appear in the search folder.

Expected results:
All local messages appear in the search folder.

Does this happen every time?
Yes.

Other information:
Setting CAMEL_DEBUG=search reveals that Evolution is converting the search folder expression to a corrupt SQL query:

sexp is : [ (and
  
       (match-all #t)
      
  )
]
Equivalent sql SELECT uid FROM 'Templates' WHERE 

I imagine this causes an exception, but Evolution ignores the exception and just shows an empty folder (those "FIXME[disk-summary]"s bite!).

A workaround is to set "Include threads" to "All related".  This doesn't change the set of matching messages, but the use of match-threads forces Evolution to do the search in memory instead of using the broken DB query.
Comment 1 Matt McCutchen 2008-12-18 06:16:42 UTC
Created attachment 124909 [details] [review]
Fix SQL-ization of booleans and immediate-function confusion

For a reason beyond me, the code in match_all in camel-search-sql-sexp.c converted a boolean literal to the empty string.  I changed it to generate "1" or "0" as appropriate.

I also noticed that match_all and match_threads had the signature of an immediate function but were added to the sexp evaluator as normal functions.  That means the evaluator was passing them _ESExpResults, which they treated as _ESExpTerms.  I guess the two structures happen to be similar enough that this totally bogus interfacing did not cause crashes, though it did require the weird-looking use of ESEXP_TERM_TIME (which has the same value as ESEXP_RES_BOOL) in match_all to test whether the result was a boolean.  My patch straightens this out by adding match_all and match_threads as immediate functions, as their bodies expect.
Comment 2 Akhil Laddha 2008-12-31 06:40:06 UTC
see bug 565483 also
Comment 3 Srinivasa Ragavan 2009-01-08 09:07:36 UTC
Looks good to commit to stable/trunk
Comment 4 Suman Manjunath 2009-01-12 03:58:18 UTC
Patch committed stable (gnome-2-24) branch as r9914
http://svn.gnome.org/viewvc/evolution-data-server?view=revision&revision=9914

Patch committed to SVN trunk as r9915
http://svn.gnome.org/viewvc/evolution-data-server?view=revision&revision=9915
Comment 5 Matt McCutchen 2009-01-12 05:13:59 UTC
It works, thanks!