From a5490e43b5b231c144dd3eb14c963678bc728854 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 26 Sep 2007 10:36:49 +0000 Subject: [PATCH] Separate batch init error messages. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5649 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/sql_create.c | 16 +++++++++------- bacula/technotes-2.3 | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index e2811e827b..80bc523822 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -846,19 +846,21 @@ bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) mdb->db_port, mdb->db_socket, 1 /* multi_db = true */); + if (!jcr->db_batch) { + Jmsg1(jcr, M_FATAL, 0, _("Could not init batch database: \"%s\".\n"), + jcr->db->db_name); + return false; + } - if (!jcr->db_batch || !db_open_database(jcr, jcr->db_batch)) { - Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\".\n"), - jcr->db->db_name); - if (jcr->db_batch) { - Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db_batch)); - } + if (!db_open_database(jcr, jcr->db_batch)) { + Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\": ERR=%s.\n"), + jcr->db->db_name, db_strerror(jcr->db_batch)); return false; } if (!sql_batch_start(jcr, jcr->db_batch)) { Jmsg(jcr, M_FATAL, 0, - "Can't start batch mode %s", db_strerror(jcr->db_batch)); + "Can't start batch mode: ERR=%s", db_strerror(jcr->db_batch)); return false; } Dmsg3(100, "initdb ref=%d connected=%d db=%p\n", jcr->db_batch->ref_count, diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index a84090c41e..58d9536375 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,7 @@ General: 26Sep07 +kes Separate batch init error messages. kes Make SD code that contructs attribute insert check string lengths more carefully. kes If Dir gets an error during inserting attributes, cancel SD. -- 2.39.5