Hallo everyone,
I'm working on some private modifications to dbmail for my company and noticed something strange in the db_search_range() function in dbsearch.c...
I was testing the IMAP search functionality when I came across the fact that my searches were turning up bad (no results when there should be) and set debug to maximum and found that it was due to a bad query.
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?
Blessings in Jesus,
Paul F. De La Cruz
I'm working on some private modifications to dbmail for my company and noticed something strange in the db_search_range() function in dbsearch.c...
I was testing the IMAP search functionality when I came across the fact that my searches were turning up bad (no results when there should be) and set debug to maximum and found that it was due to a bad query.
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?
Blessings in Jesus,
Paul F. De La Cruz