Kern Sibbald schrieb:
>>
>> if media.scratchpoolid is useful for something, how can i set it after
>> the volume has been created?
> 
> Not all DB fields can be set by user command other than the "sql" command. 
> That is true for virtually all Id fields.
> 
>> if i read the source correct, media.scratchpoolid is set to
>> pool.scratchpoolid at volume creation. if i update volumes from pool,
>> the scratchpoolid of all media remains 0 which means not set. using
>> bconsole i cannot set the scratchpool of a volume.
>>
>> i have the feeling i'm missing something totally obvious here.
> 
> Perhaps the field is unused.
> 

as i thought, totally obvious :)

> When we first added the fields in the database, the feature was not fully 
> defined, and I remember later that we found we had added one field too many.  
> It is very likely the one you are referring to.  As long as the code does 
> what we want, it really doesn't matter in the case of the Pool table if there 
> is one extra field.
> 

thanks Kern for explaining it to me.
as scratchpool seems to be unused i patched my copy of BAT to remove the
scratchpool column from the media page, see attached patch.

regards,
-ap
diff -Pur bacula-3.0.2/src/qt-console/medialist/medialist.cpp bacula-3.0.2.mod/src/qt-console/medialist/medialist.cpp
--- bacula-3.0.2/src/qt-console/medialist/medialist.cpp	2009-05-30 20:51:09.000000000 +0200
+++ bacula-3.0.2.mod/src/qt-console/medialist/medialist.cpp	2009-10-01 17:40:44.788219810 +0200
@@ -87,7 +87,7 @@
       << tr("Jobs") << tr("Retention") << tr("Media Type") << tr("Slot") << tr("Use Duration")
       << tr("Max Jobs") << tr("Max Files") << tr("Max Bytes") << tr("Recycle")
       << tr("Last Written") << tr("First Written") << tr("Read Time")
-      << tr("Write Time") << tr("Recycle Count") << tr("Recycle Pool") << tr("Scratch Pool"));
+      << tr("Write Time") << tr("Recycle Count") << tr("Recycle Pool"));
 
    m_checkcurwidget = false;
    mp_treeWidget->clear();
@@ -133,11 +133,10 @@
          " Media.FirstWritten AS FirstWritten,"
          " (VolReadTime/1000000) AS ReadTime, (VolWriteTime/1000000) AS WriteTime,"
          " RecycleCount AS ReCyCount,"
-         " RecPool.Name AS RecyclePool, ScrPool.Name AS ScratchPool"
+         " RecPool.Name AS RecyclePool"
          " FROM Media"
          " JOIN Pool ON (Media.PoolId=Pool.PoolId)"
          " LEFT OUTER JOIN Pool AS RecPool ON (Media.RecyclePoolId=RecPool.PoolId)"
-         " LEFT OUTER JOIN Pool AS ScrPool ON (Media.ScratchPoolId=ScrPool.PoolId)"
          " WHERE ";
       query += " Pool.Name IN (" + pool_comsep + ")";
       query += " ORDER BY Pool.Name, Media";
@@ -248,9 +247,6 @@
             /* recycle pool */
             mediaitem.setTextFld(index++, fld.next()); 
 
-            /* Scratch pool */
-            mediaitem.setTextFld(index++, fld.next()); 
-
          } /* foreach resultline */
          counter += 1;
       } /* if results from query */
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to