From: Kern Sibbald Date: Sun, 4 Nov 2007 16:43:30 +0000 (+0000) Subject: kes Minor tweaks to some bat restore SQL. X-Git-Tag: Release-7.0.0~5452 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ce9234b3fe489e2b542761b7ee9db87ce17fb1a4;p=bacula%2Fbacula kes Minor tweaks to some bat restore SQL. kes This patch fixes bug #1003 where putting the message output from a Verify job into the catalog results in a recursive loop. The problem seems to show up only with postgresql (to be verified). kes Correct %x to %p in postgresql debug statement. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5848 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 74b0c65f19..e5d14bdfcb 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -386,7 +386,7 @@ POSTGRESQL_ROW my_postgresql_fetch_row(B_DB *mdb) Dmsg2(500, "my_postgresql_fetch_row row number '%d' is NOT acceptable (0..%d)\n", mdb->row_number, mdb->num_rows); } - Dmsg1(500, "my_postgresql_fetch_row finishes returning %x\n", row); + Dmsg1(500, "my_postgresql_fetch_row finishes returning %p\n", row); return row; } diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index 8562add9db..559eb0eaea 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -767,11 +767,11 @@ static int missing_handler(void *ctx, int num_fields, char **row) return 1; } if (!jcr->fn_printed) { - Jmsg(jcr, M_INFO, 0, _("\nThe following files are in the Catalog but not on %s:\n"), + Qmsg(jcr, M_INFO, 0, _("\nThe following files are in the Catalog but not on %s:\n"), jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ? "the Volume(s)" : "disk"); jcr->fn_printed = true; } - Jmsg(jcr, M_INFO, 0, " %s%s\n", row[0]?row[0]:"", row[1]?row[1]:""); + Qmsg(jcr, M_INFO, 0, " %s%s\n", row[0]?row[0]:"", row[1]?row[1]:""); return 0; } diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index e999274108..e21084ba3c 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -198,11 +198,9 @@ void restoreTree::populateDirectoryTree() prLabel2->setText("Querying Jobs"); repaint(); populateJobTable(); - setJobsCheckedList(); - } else { - if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating from checks in Job Table\n"); - setJobsCheckedList(); } + setJobsCheckedList(); + if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating from checks in Job Table\n"); if (m_checkedJobs != "") { /* First get the filenameid of where the nae is null. These will be the directories @@ -614,7 +612,7 @@ void restoreTree::fileCurrentItemChanged(QTableWidgetItem *currentFileTableItem, QBrush blackBrush(Qt::black); - QStringList headerlist = (QStringList() << "Job Id" << "Type" << "End Time" << "Md5" << "FileId"); + QStringList headerlist = (QStringList() << "Job Id" << "Type" << "End Time" << "Hash" << "FileId"); versionTable->clear(); versionTable->setColumnCount(headerlist.size()); versionTable->setHorizontalHeaderLabels(headerlist); @@ -623,7 +621,7 @@ void restoreTree::fileCurrentItemChanged(QTableWidgetItem *currentFileTableItem, int pathid = m_directoryPathIdHash.value(directory, -1); if ((pathid != -1) && (fileNameId != -1)) { QString cmd = - "SELECT Job.JobId AS JobId, Job.Level AS Type, Job.EndTime AS EndTime, File.Md5 AS MD5, File.FileId AS FileId" + "SELECT Job.JobId AS JobId,Job.Level AS Type,Job.EndTime AS EndTime,File.MD5 AS MD5,File.FileId AS FileId" " FROM File" " INNER JOIN Filename on (Filename.FilenameId=File.FilenameId)" " INNER JOIN Path ON (Path.PathId=File.PathId)" @@ -724,7 +722,7 @@ void restoreTree::directoryItemExpanded(QTreeWidgetItem *item) } /* - * I wanted a table to show what jobs meet the criterion and are being used to + * Show what jobs meet the criteria and are being used to * populate the directory tree and file and version tables. */ void restoreTree::populateJobTable() @@ -732,7 +730,8 @@ void restoreTree::populateJobTable() QBrush blackBrush(Qt::black); if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating the Job Table\n"); - QStringList headerlist = (QStringList() << "Job Id" << "End Time" << "Level" << "Name" << "Purged" << "TU" << "TD"); + QStringList headerlist = (QStringList() << "Job Id" << "End Time" << "Level" << + "Name" << "Purged" << "TU" << "TD"); m_toggleUpIndex = headerlist.indexOf("TU"); m_toggleDownIndex = headerlist.indexOf("TD"); int purgedIndex = headerlist.indexOf("Purged"); @@ -740,7 +739,8 @@ void restoreTree::populateJobTable() jobTable->setColumnCount(headerlist.size()); jobTable->setHorizontalHeaderLabels(headerlist); QString jobQuery = - "SELECT Job.Jobid AS Id, Job.EndTime AS EndTime, Job.Level AS Level, Job.Name AS JobName, Job.purgedfiles AS Purged" + "SELECT Job.Jobid AS Id,Job.EndTime AS EndTime,Job.Level AS Level," + "Job.Name AS JobName,Job.purgedfiles AS Purged" " FROM Job" /* INNER JOIN FileSet eliminates all restore jobs */ " INNER JOIN Client ON (Job.ClientId=Client.ClientId)" diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 36a43a7703..7ca5025ed7 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,12 @@ Technical notes on version 2.3 General: +04Nov07 +kes Minor tweaks to some bat restore SQL. +kes This patch fixes bug #1003 where putting the message output from + a Verify job into the catalog results in a recursive loop. The problem + seems to show up only with postgresql (to be verified). +kes Correct %x to %p in postgresql debug statement. 02Nov07 kes Fix bug #942 where lots of emails where generated when the heartbeat interval was low and Bacula wanted a different tape from the one in