From: Eric Bollengier Date: Tue, 6 Dec 2011 08:17:18 +0000 (+0100) Subject: Fix #3419, update stats problem X-Git-Tag: Release-7.0.0~408 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=faf78b4e4d4657e3c896c579d8c2b1934f14eb32;p=bacula%2Fbacula Fix #3419, update stats problem --- diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 22ff00a72a..27dd0ab411 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -135,12 +135,19 @@ int db_update_stats(JCR *jcr, B_DB *mdb, utime_t age) { char ed1[30]; + int rows; utime_t now = (utime_t)time(NULL); edit_uint64(now - age, ed1); + db_lock(mdb); + Mmsg(mdb->cmd, fill_jobhisto, ed1); QUERY_DB(jcr, mdb, mdb->cmd); /* TODO: get a message ? */ - return sql_affected_rows(mdb); + rows = sql_affected_rows(mdb); + + db_unlock(mdb); + + return rows; } /*