From aa2ff70a49d39062fc4198ff5cd3d97df23ea2ca Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 20 Nov 2008 09:30:04 +0000 Subject: [PATCH] ebl Apply patch from bug #1175 that reset the Slot and the Inchanger flag in db_make_inchanger_unique(). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8066 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/Patchnotes-2.5 | 10 ++--- .../testing/1175-unique-inchanger.patch | 39 ------------------- bacula/src/cats/sql_update.c | 6 +-- bacula/technotes-2.5 | 2 + 4 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 bacula/patches/testing/1175-unique-inchanger.patch diff --git a/bacula/Patchnotes-2.5 b/bacula/Patchnotes-2.5 index 3eaa960757..f505f3424d 100644 --- a/bacula/Patchnotes-2.5 +++ b/bacula/Patchnotes-2.5 @@ -1,15 +1,15 @@ Patch notes on version 3.0 -Patches being Tested: -12Nov08 + +Patches Committed: +20Nov08 patches/testing/1175-unique-inchanger.patch -ebl Reset InChanger AND Slot when using make_unique_inchanger() - => Need to test with non barcode reader +Patches being Tested: +12Nov08 patches/testing/1182-recycle-flag.patch ebl Update Recycle flag during a db_media_update_record() - patches/testing/fileid64.patch ebl Update the FileId_t to 64bit, update catalog creation and upgrade scripts. diff --git a/bacula/patches/testing/1175-unique-inchanger.patch b/bacula/patches/testing/1175-unique-inchanger.patch deleted file mode 100644 index 5ed55280d8..0000000000 --- a/bacula/patches/testing/1175-unique-inchanger.patch +++ /dev/null @@ -1,39 +0,0 @@ - - This patch should fix the bug #1175 about Slot field - that is not reset after update slots. - Should work for 2.4.3 with 2.4.3-update-slots.patch - - cd - patch -p0 <1175-unique-inchanger.patch - ./configure - make - ... - make install - -Index: src/cats/sql_update.c -=================================================================== ---- src/cats/sql_update.c (révision 7981) -+++ src/cats/sql_update.c (copie de travail) -@@ -476,19 +476,19 @@ - if (mr->InChanger != 0 && mr->Slot != 0 && mr->StorageId != 0) { - - if (mr->MediaId != 0) { -- Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE " -+ Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0, Slot=0 WHERE " - "Slot=%d AND StorageId=%s AND MediaId!=%s", - mr->Slot, - edit_int64(mr->StorageId, ed1), edit_int64(mr->MediaId, ed2)); - - } else if (*mr->VolumeName) { -- Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE " -+ Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0, Slot=0 WHERE " - "Slot=%d AND StorageId=%s AND VolumeName!='%s'", - mr->Slot, - edit_int64(mr->StorageId, ed1), mr->VolumeName); - - } else { /* used by ua_label to reset all volume with this slot */ -- Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE " -+ Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0, Slot=0 WHERE " - "Slot=%d AND StorageId=%s", - mr->Slot, - edit_int64(mr->StorageId, ed1), mr->VolumeName); diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 2b4ef29f59..5e11a278f5 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -476,19 +476,19 @@ db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) if (mr->InChanger != 0 && mr->Slot != 0 && mr->StorageId != 0) { if (mr->MediaId != 0) { - Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE " + Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0, Slot=0 WHERE " "Slot=%d AND StorageId=%s AND MediaId!=%s", mr->Slot, edit_int64(mr->StorageId, ed1), edit_int64(mr->MediaId, ed2)); } else if (*mr->VolumeName) { - Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE " + Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0, Slot=0 WHERE " "Slot=%d AND StorageId=%s AND VolumeName!='%s'", mr->Slot, edit_int64(mr->StorageId, ed1), mr->VolumeName); } else { /* used by ua_label to reset all volume with this slot */ - Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE " + Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0, Slot=0 WHERE " "Slot=%d AND StorageId=%s", mr->Slot, edit_int64(mr->StorageId, ed1), mr->VolumeName); diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 854d6c7854..928c2b214b 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -11,6 +11,8 @@ mixed priorities General: 20Nov08 +ebl Apply patch from bug #1175 that reset the Slot and the Inchanger + flag in db_make_inchanger_unique(). ebl Remove a Emsg() after recieving a Fatal signal that can lock the catalog. 19Nov08 -- 2.39.5