Hello,
today I noticed that when I rename mail folders (through IMAP) not every
sub-folder is also moved to the new location. I traced this down to a bug in
the PostgreSQL version of db_listmailboxchildren() :
The attached patch shows the relevant code (which is removed): 'row' contains
the first result returned by the query asking PostgreSQL for the sub-folders
and 'PQcounter' is initialized to 0, so the first result tuple is fetched
again. The first and second entry in the 'children' list returned by
db_listmailboxchildren() are then the same and therefore the last result
value from the query is never returned. The "first" sub-folder is renamed
twice and the "last" sub-folder is not renamed.
The patch replaces the do/while-loop with an IMHO easier to read and
understand for-loop (the "big fatal" error can not occur since *nchildren is
initialized to PQntuples(res) ).
Please apply this to CVS.
Regards,
Armin
today I noticed that when I rename mail folders (through IMAP) not every
sub-folder is also moved to the new location. I traced this down to a bug in
the PostgreSQL version of db_listmailboxchildren() :
The attached patch shows the relevant code (which is removed): 'row' contains
the first result returned by the query asking PostgreSQL for the sub-folders
and 'PQcounter' is initialized to 0, so the first result tuple is fetched
again. The first and second entry in the 'children' list returned by
db_listmailboxchildren() are then the same and therefore the last result
value from the query is never returned. The "first" sub-folder is renamed
twice and the "last" sub-folder is not renamed.
The patch replaces the do/while-loop with an IMHO easier to read and
understand for-loop (the "big fatal" error can not occur since *nchildren is
initialized to PQntuples(res) ).
Please apply this to CVS.
Regards,
Armin