A NOTE has been added to this issue. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=869 
====================================================================== 
Reported By:                cmayo
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   869
Category:                   Command-Line programs (dbmail-users, dbmail-util)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             01-Jan-11 12:54 CET
Last Modified:              25-Jun-11 09:06 CEST
====================================================================== 
Summary:                    dbmail-util -p reports failed when there are no
messages with purge status
Description: 
It looks to me like db_deleted_count() declares t as FALSE and never
modifies it if the query is a success. Test in do_purge_deleted() for
failure is "if (! db_deleted_count())".

Patch that demonstrates fixing db_deleted_count() for me is attached. 

Includes a couple of other changes to address these points:
- DM_EQUERY is -1 with evaluates as true?
- db_deleted_count() is wrapping db_query() in a TRY/CATCH but db_query()
itself implements a TRY/CATCH around Connection_executeQuery(). And
db_result_next() tests it has been passed a result set. So if the query
itself fails there is no exception to catch in db_deleted_count().

Probably also worth looking at do_set_deleted() and db_count_deleted() -
always returns true?
====================================================================== 

---------------------------------------------------------------------- 
 (0003195) lemmster (reporter) - 25-Jun-11 09:06
 http://www.dbmail.org/mantis/view.php?id=869#c3195 
---------------------------------------------------------------------- 
I have a similar issue on MySQL, but the count query returns a result > 0.
Still dbmail-utils fails with the error mentioned above. Executing the
count query directly in MySQL reveals
http://www.dbmail.org/mantis/view.php?id=560#c2000 messages to be deleted.

foobar:/var/log/dbmail# dbmail-util -p
Choosing dry-run mode. No changes will be made at this time.
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_connect(+189): db at url:
[mysql://localhost/dbmail?user=bar&password=foo&charset=utf8]
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Info:[db]
db_connect(+201): database connection pool created with maximum connections
of [10]
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_connect(+205): run a database connection reaper thread every [60]
seconds
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_connect(+209): database connection pool started with [5] connections,
max [10]
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_con_close(+274): [0x61b6c0] connection to pool
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Debug:[auth]
auth_load_driver(+48): no value for library_directory, using default []
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Debug:[auth]
auth_load_driver(+64): looking for auth_sql as libauth_sql.so

Counting messages with DELETE status...
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_con_get(+256): [0x61b6c0] connection from pool
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_query(+344): [0x61b6c0] [SELECT COUNT(*) FROM dbmail_messages WHERE
status=3]
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
log_query_time(+290): last query took [0.001] seconds
Jun 25 09:04:52 foobar dbmail-util[12569]: [0x60a040] Database:[db]
db_con_close(+274): [0x61b6c0] connection to pool
Failed. An error occured. Please check log.

Maintenance done. Errors were found but not fixed due to failures.
Please check the logs for further details, turning up the trace level as
needed.

Happens with git HEAD (d5e570647123ce569c33a809c4f829eef82be66c) 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
01-Jan-11 12:54  cmayo          New Issue                                    
01-Jan-11 12:54  cmayo          File Added: dbmail-3.0.0_rc1-purge-retval.patch 
                  
25-Jun-11 09:06  lemmster       Note Added: 0003195                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to