On Mon, 2006-09-18 at 11:34 -0700, Aaron Stone wrote:
> On Mon, 2006-09-18 at 14:01 -0400, Geo Carncross wrote:
> 
> > > SELECT pm.messagesize, msg.message_idnr, msg.status, msg.unique_id
> > > FROM dbmail_messages msg, dbmail_physmessage pm WHERE msg.mailbox_idnr = 
> > > '81'
> > > AND msg.status < '2' AND msg.physmessage_id = pm.id order by status ASC
> 
> In SVN, the query code now reads:
> 
>         snprintf(query, DEF_QUERYSIZE,
>                  "SELECT pm.messagesize, msg.message_idnr, msg.status, "
>                  "msg.unique_id FROM %smessages msg, %sphysmessage pm "
>                  "WHERE msg.mailbox_idnr = '%llu' "
>                  "AND msg.status < '%d' "
>                  "AND msg.physmessage_id = pm.id "
>                  "ORDER BY status, message_idnr ASC",DBPFX,DBPFX,
>                  inbox_mailbox_idnr, MESSAGE_STATUS_DELETE);
> 
> Please let me know if I've added message_idnr in a logical way. I could
> set myself up for POP3 and mess with it, but I'm hoping that the squeeky
> wheel will test the changes ;-)

Put message_idnr ASC first. Don't order by status; Consider what happens
if another client changes the status after UIDL but before TOP?

If they exclusively use POP3 clients, they'll see it "ordered by status"
anyway (because new messages will be at the bottom).

-- 
Internet Connection High Quality Web Hosting
http://www.internetconnection.net/

Reply via email to