From 5d7354482cbab8f5f6b42000028ddf5faa1967fb Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 8 Sep 2008 19:21:34 +0000 Subject: [PATCH] Fix SQL case problem that may cause the failure of DiskToCatalog in bug #1149. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7567 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.4.2-storename.patch | 25 +++++++++++++++++++++++++ bacula/patches/2.4.2-verifydisk.patch | 26 ++++++++++++++++++++++++++ bacula/src/cats/sql_get.c | 2 +- bacula/technotes-2.5 | 2 ++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 bacula/patches/2.4.2-storename.patch create mode 100644 bacula/patches/2.4.2-verifydisk.patch diff --git a/bacula/patches/2.4.2-storename.patch b/bacula/patches/2.4.2-storename.patch new file mode 100644 index 0000000000..bb2010627e --- /dev/null +++ b/bacula/patches/2.4.2-storename.patch @@ -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 + patch -p0 <2.4.2-storename.patch + ./configure + 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 index 0000000000..74bc1ed7ad --- /dev/null +++ b/bacula/patches/2.4.2-verifydisk.patch @@ -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 + patch -p0 <2.4.2-verifydisk.patch + ./configure + 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), diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 753f47864d..d778dac73f 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -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), diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 68488fae35..cb69938cb6 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -62,6 +62,8 @@ remove reader/writer in FOPTS???? General: 08Sep08 +kes Fix SQL case problem that may cause the failure of DiskToCatalog + in bug #1149. kes First cut adding SD plugins. 03Sep08 kes Add Slot if it is non-zero to writing bsr file after a -- 2.39.5