Subject: bug#4358: 23.1.50; Arithmetic overflow errors break imap

From: James Cloos <[email-masked]>
Date: Wed, 09 Sep 2009 10:34:43 -0400

Having patched the bug in the imapd¹ is use, imap.el no longer errors
out for me.

As such, fixing the imap.el bug is no longer critical for me.

I hope, however, that the bug can remain open, unless there is already
a big integer bug open for gnus with which this can merge.

1] The imapd uses a sql db to store the mail; it implements the imap
   status command by doing a union query to get the number of messages
   in the specified folder, how many are seen, etc.  It then does an
   unseen = exists - seen, using unsigned integers, to get the unseen
   count.  It also made an invalid assumption about how the query
   result set would be ordered; it assumed that, in the absence of an
   explicit order by clause, the results would be implicitly ordered
   by the first column, as if order by 1 had been specified.

   That happened to work with mysql and earlier version of postgres,
   but does not happen with postgresql 8.4.  Adding an explicit
   order by 1 to the query fixed that imapd bug.

-JimC
-- 
James Cloos <[email-masked]>         OpenPGP: 1024D/ED7DAEA6