From 895c7e1e561ccfa4773070f594a1bba52795c111 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 6 Sep 2012 19:21:58 +0200 Subject: [PATCH] mysql database install/update scripts patch. Fixes bug #1901 --- bacula/src/cats/make_mysql_tables.in | 3 +-- bacula/src/cats/update_mysql_tables.in | 8 +++----- bacula/updatedb/update_mysql_tables_10_to_11.in | 4 +--- bacula/updatedb/update_mysql_tables_11_to_12.in | 6 ++---- bacula/updatedb/update_mysql_tables_12_to_14.in | 8 +++----- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index acced10eee..0a94b60e38 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -10,8 +10,7 @@ bindir=@MYSQL_BINDIR@ PATH="$bindir:$PATH" db_name=${db_name:-@db_name@} -if mysql $* -f </tmp/$$ +mysql -D ${db_name} $* -e "select VersionId from Version\G" >/tmp/$$ DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` if [ $DBVERSION != 12 ] ; then echo " " @@ -21,9 +21,7 @@ if [ $DBVERSION != 12 ] ; then exit 1 fi -if mysql $* -f </tmp/$$ +mysql -D ${db_name} $* -e "select VersionId from Version\G" >/tmp/$$ DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` if [ $DBVERSION != 11 ] ; then echo " " @@ -21,9 +21,7 @@ if [ $DBVERSION != 11 ] ; then exit 1 fi -if mysql $* -f </tmp/$$ +mysql -D ${db_name} $* -e "select VersionId from Version\G" >/tmp/$$ DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` if [ $DBVERSION != 12 ] ; then echo " " @@ -21,9 +21,7 @@ if [ $DBVERSION != 12 ] ; then exit 1 fi -if mysql $* -f <