From 6ed7b720f09d048cd05fcf27e404eb291a71790e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 4 Oct 2010 17:26:09 +0200 Subject: [PATCH] tweak debug --- bacula/src/cats/bvfs.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index 3bcbfbf547..942e971e7b 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -810,11 +810,12 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, Mmsg(tmp, "SELECT Path FROM Path WHERE PathId=%lld", id); if (!db_sql_query(db, tmp.c_str(), get_path_handler, (void *)&tmp2)) { + Dmsg0(dbglevel, "Can't search for path\n"); /* print error */ return false; } if (!strcmp(tmp2.c_str(), "")) { /* path not found */ - Dmsg3(0, "Path not found %lld q=%s s=%s\n", + Dmsg3(dbglevel, "Path not found %lld q=%s s=%s\n", id, tmp.c_str(), tmp2.c_str()); break; } @@ -852,6 +853,7 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, int64_t prev_jobid=0; while (get_next_id_from_list(&hardlink, &jobid) == 1) { if (get_next_id_from_list(&hardlink, &id) != 1) { + Dmsg0(dbglevel, "hardlink should be two by two\n"); return false; } if (jobid != prev_jobid) { /* new job */ @@ -880,12 +882,14 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, init = true; } - Dmsg1(0, "q=%s\n", query.c_str()); + Dmsg1(dbglevel_sql, "q=%s\n", query.c_str()); if (!db_sql_query(db, query.c_str(), NULL, NULL)) { + Dmsg0(dbglevel, "Can't execute q\n"); goto bail_out; } + /* TODO: handle basejob and MySQL/SQLite3 */ Mmsg(query, "CREATE TABLE %s AS ( " "SELECT JobId, FileIndex, FileId " "FROM ( " @@ -895,8 +899,9 @@ bool Bvfs::compute_restore_list(char *fileid, char *dirid, char *hardlink, ") AS T " "WHERE FileIndex > 0)", output_table, output_table); - Dmsg1(0, "q=%s\n", query.c_str()); + Dmsg1(dbglevel_sql, "q=%s\n", query.c_str()); if (!db_sql_query(db, query.c_str(), NULL, NULL)) { + Dmsg0(dbglevel, "Can't execute q\n"); goto bail_out; } ret = true; -- 2.39.5