dbmail2 is a refactoring of the dbmail1 codebase. Not a total rewrite. So there's a lot of code from dbmail1 in there. This looks to me like a piece of code that was overlooked by Ilja when he refactored the db layer by introducing the physmessage table.

Searching is apparently a little tested part of dbmail2 . However, with Leif's implementation of the SORT extension, that is bound to change.




Paul F. De La Cruz wrote:
That works on postgresql, but if that looks like dbmail-1.x, how'd it
end up on the CVS version of dbmail? I checked out the source just a
minute ago and sure enough, it has the bad query in it.

On Fri, Apr 02, 2004 at 08:08:21PM +0200, Paul J Stevens wrote:

Paul F. De La Cruz wrote:

in dbsearch.c (line 359): snprintf(query, DEF_QUERYSIZE, "SELECT messageblk FROM messageblks " "WHERE message_idnr = '%llu' "
"ORDER BY messageblk_idnr", msg_idnr);

yet there is _no_ message_idnr in the messageblks table! did the messages table get left out of the FROM clause accidentally?
changing 'FROM messageblks' to 'FROM messageblks,messages' seems
to make the query work, but I'm wondering how that query might
have ended up the way it is?

Smells like dbmail-1.x to me. Now the physmessage table has been inserted between messages and messageblks. So you probably need something like:

snprintf(query, DEF_QUERYSIZE, "SELECT     messageblk FROM messageblks"
"LEFT JOIN messages ON " "messages.physmessage_id=messageblks.physmessage_id " "WHERE
messages.message_idnr = '%llu' " "ORDER BY messageblk_idnr",
msg_idnr);

Will this work for postgresql ? Looks like ansi sql to me, but I'm
not sure.

_______________________________________________ Dbmail-dev mailing
list Dbmail-dev@dbmail.org http://twister.fastxs.net/mailman/listinfo/dbmail-dev


--
  ________________________________________________________________
  Paul Stevens                                  mailto:[EMAIL PROTECTED]
  NET FACILITIES GROUP                     PGP: finger [EMAIL PROTECTED]
  The Netherlands________________________________http://www.nfg.nl

Reply via email to