From 9a0b904dafcea597c15d1a7afc807cbbf5568155 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 25 Mar 2007 16:18:21 +0000 Subject: [PATCH] Fix new .sql command for bat git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4416 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/ua_dotcmds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index af8258ff17..4ec9cce182 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -336,6 +336,9 @@ static int sql_handler(void *ctx, int num_field, char **row) static bool sql_cmd(UAContext *ua, const char *cmd) { + if (!open_client_db(ua)) { + return true; + } if (!db_sql_query(ua->db, ua->argk[1], sql_handler, (void *)ua)) { bsendmsg(ua, _("Query failed: %s. ERR=%s\n"), ua->cmd, db_strerror(ua->db)); return true; -- 2.39.5