Juergen Raschke
2016-Dec-14 10:18 UTC
unexpected behaviour of search queries with mixed AND and OR
Hello, I found out an unexpected behaviour of search queries with mixed "AND" and "OR". With search query "\( condA OR condB condC \)" I get an error: Fatal: Use parenthesis when mixing ANDs and ORs if I switch left and right OR-part and use the query "\( condB condC OR condA \)" I get a result, but it is not the expected result of the query "\( \( condB condC \) OR condA \)" I get the result of the query "\( condB OR condC OR condA \)" which is more then suprising. The query "\( condB condC OR condA \)" should either throw an error like "\( condA OR condB condC \)" or deliever the result of "\( \( condB condC \) OR condA \)" Example: doveadm -f flow fetch -u USER guid \( savedbefore 21d OR seen savedbefore 5d \) | wc -l Fatal: Use parenthesis when mixing ANDs and ORs 0 doveadm -f flow fetch -u USER guid \( seen savedbefore 5d OR savedbefore 21d \) | wc -l 63690 doveadm -f flow fetch -u USER guid \( seen OR savedbefore 5d OR savedbefore 21d \) | wc -l 63690 doveadm -f flow fetch -u USER guid \( \( seen savedbefore 5d \) OR savedbefore 21d \) |wc -l 63247 doveadm -f flow fetch -u USER guid \( savedbefore 21d OR \( seen savedbefore 5d \) \) |wc -l 63247 doveconf -n # 2.2.24 (a82c823): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.9 (357ac0a0e68b+) # OS: Linux 3.16.0-0.bpo.4-amd64 x86_64 Debian 7.9 Mit freundlichen Gruessen, Juergen Raschke -- Mittwald CM Service GmbH & Co. KG Koenigsberger Strasse 6 Tel: +49-5772-293-100 32339 Espelkamp Fax: +49-5772-293-333 Geschaeftsfuehrer: Robert Meyer, HRA 6640, AG Bad Oeynhausen Komplementaerin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
Aki Tuomi
2016-Dec-14 10:50 UTC
unexpected behaviour of search queries with mixed AND and OR
On 14.12.2016 12:18, Juergen Raschke wrote:> Hello, > > > I found out an unexpected behaviour of search queries with mixed > "AND" and "OR". > > > With search query "\( condA OR condB condC \)" I get an error: > Fatal: Use parenthesis when mixing ANDs and ORs > > if I switch left and right OR-part and use the query > "\( condB condC OR condA \)" > > I get a result, but it is not the expected result of the query > "\( \( condB condC \) OR condA \)" > > I get the result of the query > "\( condB OR condC OR condA \)" > which is more then suprising. > > > The query "\( condB condC OR condA \)" should either throw an > error like "\( condA OR condB condC \)" or deliever the result > of "\( \( condB condC \) OR condA \)" > > > > > Example: > > doveadm -f flow fetch -u USER guid \( savedbefore 21d OR seen savedbefore 5d \) | wc -l > Fatal: Use parenthesis when mixing ANDs and ORs > 0 > > doveadm -f flow fetch -u USER guid \( seen savedbefore 5d OR savedbefore 21d \) | wc -l > 63690 > > doveadm -f flow fetch -u USER guid \( seen OR savedbefore 5d OR savedbefore 21d \) | wc -l > 63690 > > doveadm -f flow fetch -u USER guid \( \( seen savedbefore 5d \) OR savedbefore 21d \) |wc -l > 63247 > > doveadm -f flow fetch -u USER guid \( savedbefore 21d OR \( seen savedbefore 5d \) \) |wc -l > 63247 > > > > doveconf -n > # 2.2.24 (a82c823): /etc/dovecot/dovecot.conf > # Pigeonhole version 0.4.9 (357ac0a0e68b+) > # OS: Linux 3.16.0-0.bpo.4-amd64 x86_64 Debian 7.9 > > > > > > Mit freundlichen Gruessen, > > Juergen Raschke >Hi! We believe this has been fixed in https://github.com/dovecot/core/commit/df8046c9a4f6bc2a478ad1e74504d50f3110c906 Aki Tuomi Dovecot oy
Juergen Raschke
2016-Dec-20 12:45 UTC
unexpected behaviour of search queries with mixed AND and OR
Hello, On 14.12.2016 11:50, Aki Tuomi wrote:> > > On 14.12.2016 12:18, Juergen Raschke wrote: >> Hello, >> >> >> I found out an unexpected behaviour of search queries with mixed >> "AND" and "OR". >>>> >> >> doveconf -n >> # 2.2.24 (a82c823): /etc/dovecot/dovecot.conf >> # Pigeonhole version 0.4.9 (357ac0a0e68b+) >> # OS: Linux 3.16.0-0.bpo.4-amd64 x86_64 Debian 7.9> We believe this has been fixed in > > https://github.com/dovecot/core/commit/df8046c9a4f6bc2a478ad1e74504d50f3110c906 >Same behaviour with dovecot 2.2.27 # 2.2.27 () [XI:2:2.2.27-1~auto+1]: /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.16 () # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.11 root at maildev:~ > doveadm -f flow fetch -u USER "date.saved flags" \( seen savedbefore 3d OR savedbefore 21d \) date.saved=2016-09-27 15:39:25 flags=\Seen date.saved=2016-09-27 15:39:25 flags=\Seen date.saved=2016-09-27 15:39:26 flags=\Seen date.saved=2016-09-27 15:39:26 flagsdate.saved=2016-09-27 15:39:26 flagsdate.saved=2016-09-27 15:39:27 flagsdate.saved=2016-09-27 15:39:27 flagsdate.saved=2016-09-27 15:39:38 flagsdate.saved=2016-09-27 15:39:51 flagsdate.saved=2016-12-16 15:36:00 flags=\Recent root at maildev4:~ > date Tue Dec 20 11:54:41 CET 2016 The last email "date.saved=2016-12-16 15:36:00 flags=\Recent" should not be found. Let me know if you need further information. Mit freundlichen Gruessen, Juergen Raschke -- Mittwald CM Service GmbH & Co. KG Koenigsberger Strasse 6 Tel: +49-5772-293-100 32339 Espelkamp Fax: +49-5772-293-333 Geschaeftsfuehrer: Robert Meyer, HRA 6640, AG Bad Oeynhausen Komplementaerin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen