The following issue has been SUBMITTED. ====================================================================== http://dbmail.org/mantis/view.php?id=767 ====================================================================== Reported By: zmi Assigned To: ====================================================================== Project: DBMail Issue ID: 767 Category: Database layer Reproducibility: always Severity: major Priority: normal Status: new target: ====================================================================== Date Submitted: 13-Feb-09 11:23 CET Last Modified: 13-Feb-09 11:23 CET ====================================================================== Summary: search for "Full Message" via IMAP generates wrong SELECT Description: In Kmail, I start a search for "Full message" (that's "Vollständige Nachricht" in german) with content ZMI_FullMessage on an IMAP Folder. The IMAP command generated is: 104860 UID SEARCH TEXT "ZMI_FullMessage"
And the resulting SELECT is: SELECT m.message_idnr, v.headervalue, k.messageblk FROM dbmail_messageblks k JOIN dbmail_physmessage p ON k.physmessage_id=p.id JOIN dbmail_messages m ON m.physmessage_id=p.id JOIN dbmail_headervalue v ON v.physmessage_id=p.id WHERE m.mailbox_idnr=3324 AND m.status in (0,1) HAVING SUBSTRING(v.headervalue,0,255) ILIKE '%ZMI_FullMessage%' OR k.messageblk ILIKE '%ZMI_FullMessage%' This SELECT produced an error on PostgreSQL 8.3: ERROR: operator does not exist: bytea ~~* unknown ZEILE 1: ...,0,255) ILIKE '%ZMI_FullMessage%' OR k.messageblk ILIKE '%ZM... TIP: No operator matches the given name and argument type(s). You might need to add explicit type casts. After changing that to "OR k.messageblk::Text ILIKE '%ZMI_FullMessage%';" (you see, I only casted k.messageblk to a Text field, and tried with varchar also for the same result) I got the error: ERROR: column "m.message_idnr" must appear in the GROUP BY clause or be used in an aggregate function Still dbmail returns several messages: * SEARCH 3635587 (and about 20 other numbers) 104860 OK SEARCH completed And those messages for sure do not contain what I searched for. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 13-Feb-09 11:23 zmi New Issue ====================================================================== _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://twister.fastxs.net/mailman/listinfo/dbmail-dev