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.


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

Reply via email to