]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix SQL case problem that may cause the failure of DiskToCatalog
authorKern Sibbald <kern@sibbald.com>
Mon, 8 Sep 2008 19:21:08 +0000 (19:21 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 8 Sep 2008 19:21:08 +0000 (19:21 +0000)
     in bug #1149.
kes  Copy missing storage name into edit buffer. As far as I can tell
     this never caused a bug.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7566 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/2.4.2-storename.patch [new file with mode: 0644]
bacula/patches/2.4.2-verifydisk.patch [new file with mode: 0644]
bacula/src/cats/sql_get.c
bacula/src/dird/msgchan.c
bacula/technotes-2.4

diff --git a/bacula/patches/2.4.2-storename.patch b/bacula/patches/2.4.2-storename.patch
new file mode 100644 (file)
index 0000000..bb20106
--- /dev/null
@@ -0,0 +1,25 @@
+
+  This patch fixes a missing storage name problem, which as far
+  as we can tell never created any problem.
+  Apply the patch to version 2.4.2 (and previous versions) with:
+
+  cd <bacula-source>
+  patch -p0 <2.4.2-storename.patch
+  ./configure <your-options>
+  make
+  ...
+  make install
+
+   
+Index: src/dird/msgchan.c
+===================================================================
+--- src/dird/msgchan.c (revision 7507)
++++ src/dird/msgchan.c (working copy)
+@@ -229,6 +229,7 @@
+       bash_spaces(pool_name);
+       foreach_alist(storage, rstore) {
+          Dmsg1(100, "Rstore=%s\n", storage->name());
++         pm_strcpy(store_name, storage->name());
+          bash_spaces(store_name);
+          pm_strcpy(media_type, storage->media_type);
+          bash_spaces(media_type);
diff --git a/bacula/patches/2.4.2-verifydisk.patch b/bacula/patches/2.4.2-verifydisk.patch
new file mode 100644 (file)
index 0000000..74bc1ed
--- /dev/null
@@ -0,0 +1,26 @@
+
+  This patch fixes a case problem in an SQL command, and could potentially
+  fix the DiskToCatalog problem reported in bug #1149.
+  Apply the patch to version 2.4.2 (and previous versions) with:
+
+  cd <bacula-source>
+  patch -p0 <2.4.2-verifydisk.patch
+  ./configure <your-options>
+  make
+  ...
+  make install
+
+   
+Index: src/cats/sql_get.c
+===================================================================
+--- src/cats/sql_get.c (revision 7507)
++++ src/cats/sql_get.c (working copy)
+@@ -109,7 +109,7 @@
+    Mmsg(mdb->cmd,
+ "SELECT FileId, LStat, MD5 FROM File,Job WHERE "
+ "File.JobId=Job.JobId AND File.PathId=%s AND "
+-"File.FilenameId=%s AND Job.Type='B' AND Job.JobSTATUS='T' AND "
++"File.FilenameId=%s AND Job.Type='B' AND Job.JobStatus='T' AND "
+ "ClientId=%s ORDER BY StartTime DESC LIMIT 1",
+       edit_int64(fdbr->PathId, ed1), 
+       edit_int64(fdbr->FilenameId, ed2), 
index 981f10ab789af3d22aa99133de4f2ba420291346..79bab88ca277b991cac8f1372daf3626f29f2ee2 100644 (file)
@@ -109,7 +109,7 @@ int db_get_file_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr, FILE_DBR *fdbr)
    Mmsg(mdb->cmd,
 "SELECT FileId, LStat, MD5 FROM File,Job WHERE "
 "File.JobId=Job.JobId AND File.PathId=%s AND "
-"File.FilenameId=%s AND Job.Type='B' AND Job.JobSTATUS='T' AND "
+"File.FilenameId=%s AND Job.Type='B' AND Job.JobStatus='T' AND "
 "ClientId=%s ORDER BY StartTime DESC LIMIT 1",
       edit_int64(fdbr->PathId, ed1), 
       edit_int64(fdbr->FilenameId, ed2), 
index 935a9d08ab0764188a620e7cc613db6b79971e5a..71260bfeb2a0f9dd16ab512265e8d96c8424ea1f 100644 (file)
@@ -229,6 +229,7 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore)
       bash_spaces(pool_name);
       foreach_alist(storage, rstore) {
          Dmsg1(100, "Rstore=%s\n", storage->name());
+         pm_strcpy(store_name, storage->name());
          bash_spaces(store_name);
          pm_strcpy(media_type, storage->media_type);
          bash_spaces(media_type);
index 9fb353021a3a761957de3cfe2a7f57e4c814adcd..4e4dbb819e8472cd3fb6e9d8251e8393b60e2f4b 100644 (file)
@@ -1,6 +1,11 @@
               Technical notes on version 2.4
 
 General:
+08Sep08
+kes  Fix SQL case problem that may cause the failure of DiskToCatalog
+     in bug #1149.
+kes  Copy missing storage name into edit buffer. As far as I can tell
+     this never caused a bug.
 28Aug08
 ebl  Remove catalog dependency for bcopy
 ebl  Modify catalog scripts to have an easier packaging integration,