From f4345281065b93742f44ea6c4c4336d21ccc979a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 13 Oct 2007 16:46:27 +0000 Subject: [PATCH] kes Fix spurious warning message printed when creating a volume with a LabelFormat. This fixes bug #976. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5750 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.2.5-nextvol.patch | 29 +++++++++++++++++++++++++++++ bacula/src/dird/newvol.c | 2 +- bacula/technotes-2.1 | 5 +++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 bacula/patches/2.2.5-nextvol.patch diff --git a/bacula/patches/2.2.5-nextvol.patch b/bacula/patches/2.2.5-nextvol.patch new file mode 100644 index 0000000000..27bf0d5641 --- /dev/null +++ b/bacula/patches/2.2.5-nextvol.patch @@ -0,0 +1,29 @@ + + This bug fixes the warning message that prints each time an automatic + Volume name is created. This fixes bug #979 + + This patch applies to Bacula version 2.2.5 (not to previous versions), + and can be applied with the following: + + cd + patch -p0 <2.2.5-newvol.patch + ./configure (your options) + make + ... + make install + + + +Index: src/dird/newvol.c +=================================================================== +--- src/dird/newvol.c (revision 5717) ++++ src/dird/newvol.c (working copy) +@@ -124,7 +124,7 @@ + mr->VolumeName[0] = 0; + bstrncpy(name, pr->LabelFormat, sizeof(name)); + ctx.value = 0; +- Mmsg(query, "SELECT MAX(MediaId) FROM Media,POOL WHERE Pool.PoolId=%s", ++ Mmsg(query, "SELECT MAX(MediaId) FROM Media,Pool WHERE Pool.PoolId=%s", + edit_int64(pr->PoolId, ed1)); + if (!db_sql_query(jcr->db, query.c_str(), db_int64_handler, (void *)&ctx)) { + Jmsg(jcr, M_WARNING, 0, _("SQL failed, but ignored. ERR=%s\n"), db_strerror(jcr->db)); diff --git a/bacula/src/dird/newvol.c b/bacula/src/dird/newvol.c index c66b813325..b15ade839d 100644 --- a/bacula/src/dird/newvol.c +++ b/bacula/src/dird/newvol.c @@ -124,7 +124,7 @@ static bool create_simple_name(JCR *jcr, MEDIA_DBR *mr, POOL_DBR *pr) mr->VolumeName[0] = 0; bstrncpy(name, pr->LabelFormat, sizeof(name)); ctx.value = 0; - Mmsg(query, "SELECT MAX(MediaId) FROM Media,POOL WHERE Pool.PoolId=%s", + Mmsg(query, "SELECT MAX(MediaId) FROM Media,Pool WHERE Pool.PoolId=%s", edit_int64(pr->PoolId, ed1)); if (!db_sql_query(jcr->db, query.c_str(), db_int64_handler, (void *)&ctx)) { Jmsg(jcr, M_WARNING, 0, _("SQL failed, but ignored. ERR=%s\n"), db_strerror(jcr->db)); diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 78363a0c23..3b5813ae98 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,11 @@ Technical notes on version 2.2 General: +12Oct07 +kes Fix spurious warning message printed when creating a volume with + a LabelFormat. This fixes bug #976. + +Release Version 2.2.5 09Oct07 kes Add JobId in place of Job name in all the Jmsg() output. kes Correct the APP_DESC for the Win32 storage service (remove an e). -- 2.39.5