On Mon, 2007-12-10 at 12:41 +0200, Silver Salonen wrote:
> Hi!
> 
> On Sunday 09 December 2007 16:51, Dirk Bartley wrote:
> > Hello Silver
> > 
> > I'd like to discover what is causing this.  Please turn on sql debugging
> > in preferences and we should be able to isolate the sql command that is
> > getting the list of files.  The result should be an sql query that
> > should look alot like this:
> > 
> > bat: restore/restoretree.cpp:534 Query cmd : SELECT DISTINCT
> > Filename.Name AS FileName, Filename.FilenameId AS FilenameId FROM File
> > INNER JOIN Filename on (Filename.FilenameId=File.FilenameId) WHERE
> > File.PathId=269827 AND File.Jobid IN (3641,3632,3619,3606,3593) AND
> > Filename.Name!='' ORDER BY FileName
> 
> I use MySQL 5.0.45, but I don't see such a query in Bat's output - should I 
> see this command when pressing Refresh in Version Browser? In my case I see 
> this:
> =====
> $ bat -c bat-baculaclient.conf
> bat: restore/restoretree.cpp:771 Query cmd : 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 Client ON 
> (Job.ClientId=Client.ClientId) INNER JOIN FileSet ON 
> (Job.FileSetId=FileSet.FileSetId) WHERE Client.Name='baculaclient-fd' AND 
> Job.name = 'baculaclient-userdata' AND FileSet.FileSet='userdata-snap' ORDER 
> BY Job.EndTime DESC LIMIT 150
> bat: restore/restoretree.cpp:214 Query cmd : SELECT FilenameId FROM Filename 
> WHERE name=''
> bat: restore/restoretree.cpp:238 Query cmd : SELECT DISTINCT Path.Path AS 
> Path, File.PathId AS PathId FROM File INNER JOIN Path ON 
> (File.PathId=Path.PathId) WHERE File.FilenameId=1 AND File.Jobid IN 
> (13291,13267,13243,13219,13194,13170,13146,13087,13063,13039,13015,12991,12943,12919,12775,12607)
>  
> ORDER BY Path
> bat: restore/restoretree.cpp:589 did not perform query, pathid=-1 not found
> bat: restore/restoretree.cpp:589 did not perform query, pathid=-1 not found
> =====

Here is where the issue is.  The pathid is not found from the known
directory string.  I'm not sure how but it is unable to find the value
of pathid here.

Please apply the following patch and send me the output like above
again.

Dirk
Index: restoretree.cpp
===================================================================
--- restoretree.cpp	(revision 6009)
+++ restoretree.cpp	(working copy)
@@ -270,6 +270,8 @@
                   int pathid = field.toInt(&ok, 10);
                   if (ok)
                      m_directoryPathIdHash.insert(fieldlist[0], pathid);
+                  else
+                     Pmsg1(000, "Error inserting %s into m_directoryPathIdHash\n", fieldlist[0].toUtf8().data());
                }
                fieldcnt += 1;
             }
@@ -584,7 +586,7 @@
       if (mainWin->m_rtDirCurICDebug) Pmsg0(000, "will update file table checks\n");
       updateFileTableChecks();
    } else if (mainWin->m_sqlDebug)
-      Pmsg1(000, "did not perform query, pathid=%i not found\n", pathid);
+      Pmsg1(000, "did not perform query, pathid not found from directory %s\n", directory.toUtf8().data());
    connect(fileTable, SIGNAL(itemChanged(QTableWidgetItem *)),
           this, SLOT(fileTableItemChanged(QTableWidgetItem *)));
 }
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to