From: Eric Bollengier Date: Wed, 2 Dec 2009 15:06:09 +0000 (+0100) Subject: bvfs: update bvfs_test X-Git-Tag: Release-5.0.0~212 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b721afb0d76e332d9c6cce03c7d59ed6f21ebf55;p=bacula%2Fbacula bvfs: update bvfs_test --- diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index fff4f39544..4673bf5590 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -371,8 +371,8 @@ void bvfs_update_cache(JCR *jcr, B_DB *mdb) db_lock(mdb); db_start_transaction(jcr, mdb); - Mmsg(mdb->cmd, "SELECT 1 from PathHierarchy LIMIT 1"); - /* TODO: Add this code in the make_bacula_table script */ + /* TODO: Remove this code when updating make_bacula_table script */ + Mmsg(mdb->cmd, "SELECT 1 FROM Job WHERE HasCache<>2 LIMIT 1"); if (!QUERY_DB(jcr, mdb, mdb->cmd)) { Dmsg0(dbglevel, "Creating cache table\n"); Mmsg(mdb->cmd, "ALTER TABLE Job ADD HasCache int DEFAULT 0"); diff --git a/bacula/src/tools/bvfs_test.c b/bacula/src/tools/bvfs_test.c index 2bb3832ef1..5fa4d06dd9 100644 --- a/bacula/src/tools/bvfs_test.c +++ b/bacula/src/tools/bvfs_test.c @@ -228,9 +228,9 @@ int main (int argc, char *argv[]) if (clean) { Pmsg0(0, "Clean old table\n"); - db_sql_query(db, "DELETE FROM brestore_pathhierarchy", NULL, NULL); - db_sql_query(db, "DELETE FROM brestore_knownjobid", NULL, NULL); - db_sql_query(db, "DELETE FROM brestore_pathvisibility", NULL, NULL); + db_sql_query(db, "DELETE FROM PathHierarchy", NULL, NULL); + db_sql_query(db, "UPDATE Job SET HasCache=0", NULL, NULL); + db_sql_query(db, "DELETE FROM PathVisibility", NULL, NULL); bvfs_update_cache(bjcr, db); }