]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/dird.c
Fix bug #1367 by creating an empty query.sql file
[bacula/bacula] / bacula / src / dird / dird.c
index a4317214617ea3f1b93d497cbb9294b5b47e5207..2e3a4c7ce01cd6536a5f34093d8e89f1ae195f54 100644 (file)
@@ -329,7 +329,7 @@ int main (int argc, char *argv[])
 
    init_job_server(director->MaxConcurrentJobs);
 
-   dbg_jcr_add_hook(_dbg_print_db); /* used to debug B_DB connexion after fatal signal */
+   dbg_jcr_add_hook(dbg_print_db); /* used to debug B_DB connexion after fatal signal */
 
 //   init_device_resources();
 
@@ -958,6 +958,12 @@ static bool check_catalog(cat_op mode)
          OK = false;
          continue;
       }
+      
+      /* Display a message if the db max_connections is too low */
+      if (!db_check_max_connections(NULL, db, director->MaxConcurrentJobs+1)) {
+         Pmsg1(000, "Warning, settings problem for Catalog=%s\n", catalog->name());
+         Pmsg1(000, "%s", db_strerror(db));
+      }
 
       /* we are in testing mode, so don't touch anything in the catalog */
       if (mode == CHECK_CONNECTION) {
@@ -1088,6 +1094,7 @@ static bool check_catalog(cat_op mode)
       if (mode == UPDATE_AND_FIX) {
          db_sql_query(db, cleanup_created_job, NULL, NULL);
          db_sql_query(db, cleanup_running_job, NULL, NULL);
+         db_sql_query(db, "CREATE INDEX basefiles_jobid_idx ON BaseFiles ( JobId )" , NULL, NULL);
       }
 
       db_close_database(NULL, db);