From ad5c32f22db41eb13f8a8938732d1021ef50e69d Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 11 Jan 2010 18:43:03 +0100 Subject: [PATCH] Change DB version from 11 to 12 --- bacula/src/cats/bvfs.c | 2 + bacula/src/cats/cats.h | 10 +- bacula/src/cats/make_mysql_tables.in | 81 ++++--- bacula/src/cats/make_postgresql_tables.in | 170 ++++++++------ bacula/src/cats/make_sqlite3_tables.in | 116 +++++---- bacula/src/cats/sql_cmds.c | 4 +- bacula/src/cats/update_mysql_tables.in | 88 +++---- bacula/src/cats/update_postgresql_tables.in | 75 ++++-- bacula/src/cats/update_sqlite3_tables.in | 247 ++++---------------- bacula/src/dird/dird.c | 1 - 10 files changed, 375 insertions(+), 419 deletions(-) diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index 4673bf5590..8a71ff5412 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -371,6 +371,7 @@ void bvfs_update_cache(JCR *jcr, B_DB *mdb) db_lock(mdb); db_start_transaction(jcr, mdb); +#ifdef xxx /* TODO: Remove this code when updating make_bacula_table script */ Mmsg(mdb->cmd, "SELECT 1 FROM Job WHERE HasCache<>2 LIMIT 1"); if (!QUERY_DB(jcr, mdb, mdb->cmd)) { @@ -407,6 +408,7 @@ void bvfs_update_cache(JCR *jcr, B_DB *mdb) QUERY_DB(jcr, mdb, mdb->cmd); } +#endif Mmsg(mdb->cmd, "SELECT JobId from Job " diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 0eeb452839..2272401c41 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -89,7 +89,7 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **); #ifdef HAVE_SQLITE #error "SQLite2 is now deprecated, use SQLite3 instead." -#define BDB_VERSION 11 +#define BDB_VERSION 12 #include @@ -211,7 +211,7 @@ extern const char* my_sqlite_batch_fill_path_query; #ifdef HAVE_SQLITE3 -#define BDB_VERSION 11 +#define BDB_VERSION 12 #include @@ -338,7 +338,7 @@ extern const char* my_sqlite_batch_fill_path_query; #ifdef HAVE_MYSQL -#define BDB_VERSION 11 +#define BDB_VERSION 12 #include @@ -422,7 +422,7 @@ extern void my_mysql_free_result(B_DB *mdb); #ifdef HAVE_POSTGRESQL -#define BDB_VERSION 11 +#define BDB_VERSION 12 #include @@ -645,7 +645,7 @@ extern const char* my_ingres_batch_fill_path_query; #ifdef HAVE_DBI -#define BDB_VERSION 11 +#define BDB_VERSION 12 #include diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 3a6f460619..6e0747e2b6 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -3,9 +3,10 @@ # shell script to create Bacula MySQL tables # bindir=@SQL_BINDIR@ +PATH="$bindir:$PATH" db_name=${db_name:-@db_name@} -if $bindir/mysql $* -f <