--- /dev/null
+
+ This patch should correct bug #1159 where Migration does not properly
+ respect the Migration Low Bytes directive.
+
+ Apply it to Bacula version 2.4.2 (or possibly earlier) with:
+
+ cd <bacula-source>
+ patch -p0 <2.4.2-migrate-poolsize.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/dird/migrate.c
+===================================================================
+--- src/dird/migrate.c (revision 7566)
++++ src/dird/migrate.c (working copy)
+@@ -557,13 +557,16 @@
+ " AND Job.Type='B'"
+ " ORDER by Job.StartTime";
+
+-/* Get tne number of bytes in the pool */
++/* Get the number of bytes in the pool */
+ const char *sql_pool_bytes =
+- "SELECT SUM(VolBytes) FROM Media,Pool WHERE"
++ "SELECT SUM(JobBytes) FROM Job WHERE JobId IN"
++ " (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE"
++ " Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
+ " VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND"
+- " Media.PoolId=Pool.PoolId AND Pool.Name='%s'";
++ " Job.Type='B' AND"
++ " JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)";
+
+-/* Get tne number of bytes in the Jobs */
++/* Get the number of bytes in the Jobs */
+ const char *sql_job_bytes =
+ "SELECT SUM(JobBytes) FROM Job WHERE JobId IN (%s)";
+
" AND Job.Type='B'"
" ORDER by Job.StartTime";
-/* Get tne number of bytes in the pool */
+/* Get the number of bytes in the pool */
const char *sql_pool_bytes =
- "SELECT SUM(VolBytes) FROM Media,Pool WHERE"
+ "SELECT SUM(JobBytes) FROM Job WHERE JobId IN"
+ " (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE"
+ " Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
" VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND"
- " Media.PoolId=Pool.PoolId AND Pool.Name='%s'";
+ " Job.Type='B' AND"
+ " JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)";
-/* Get tne number of bytes in the Jobs */
+/* Get the number of bytes in the Jobs */
const char *sql_job_bytes =
"SELECT SUM(JobBytes) FROM Job WHERE JobId IN (%s)";
#undef VERSION
#define VERSION "2.4.3"
-#define BDATE "26 August 2008"
-#define LSMDATE "26Aug08"
+#define BDATE "08 October 2008"
+#define LSMDATE "08Oct08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */