summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-07-06 16:29:26 +0200
committerunknown <serg@serg.mylan>2004-07-06 16:29:26 +0200
commit68aec1e48d58dd8251324ca4f6fc886d627d89af (patch)
tree85668468b77e9e396ee280f84e688ff73152d238
parent692f440b42a685da5414c8612d0e022f501d77f6 (diff)
downloadmariadb-git-68aec1e48d58dd8251324ca4f6fc886d627d89af.tar.gz
mysql_fix_privilege_tables.sh:
various fixes (for mysql-test-run at least): * accept --no-defaults * 4.0 compatible password handling (only it no other argumensts, only if doesn't start with --) ps_3innodb.test: only run ps_3innodb.test if innodb is present mysql-test-run.sh: it's --verbose, not --verbose=1 mysql-test/mysql-test-run.sh: it's --verbose, not --verbose=1 mysql-test/t/ps_3innodb.test: only run ps_3innodb.test if innodb is present scripts/mysql_fix_privilege_tables.sh: various fixes (for mysql-test-run at least): * accept --no-defaults * 4.0 compatible password handling (only it no other argumensts, only if doesn't start with --)
-rw-r--r--mysql-test/mysql-test-run.sh2
-rw-r--r--mysql-test/t/ps_3innodb.test2
-rw-r--r--scripts/mysql_fix_privilege_tables.sh24
3 files changed, 22 insertions, 6 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 52938c8a2ee..55f9d3b00a9 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -525,7 +525,7 @@ fi
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
-MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose=1"
+MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
diff --git a/mysql-test/t/ps_3innodb.test b/mysql-test/t/ps_3innodb.test
index e6d3e239ff9..055e1e127e5 100644
--- a/mysql-test/t/ps_3innodb.test
+++ b/mysql-test/t/ps_3innodb.test
@@ -10,6 +10,8 @@
use test;
+-- source include/have_innodb.inc
+
let $type= 'InnoDB' ;
-- source include/ps_create.inc
-- source include/ps_renew.inc
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index f3c5c009f1c..79b4bc627b7 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -17,8 +17,24 @@ bindir=""
file=mysql_fix_privilege_tables.sql
+# The following test is to make this script compatible with the 4.0 where
+# the single argument could be a password
+if test "$#" = 1
+then
+ case "$1" in
+ --*) ;;
+ *) old_style_password="$1" ; shift ;;
+ esac
+fi
+
# The following code is almost identical to the code in mysql_install_db.sh
+case "$1" in
+ --no-defaults|--defaults-file=*|--defaults-extra-file=*)
+ defaults="$1"; shift
+ ;;
+esac
+
parse_arguments() {
# We only need to pass arguments through to the server if we don't
# handle them here. So, we collect unrecognized options (passed on
@@ -36,7 +52,7 @@ parse_arguments() {
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --sql|--sql-only) sql_only=1;;
+ --sql|--sql-only) sql_only=1 ;;
--verbose) verbose=1 ;;
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
@@ -47,7 +63,7 @@ parse_arguments() {
then
# This sed command makes sure that any special chars are quoted,
# so the arg gets passed exactly to the server.
- args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
+ args="$args "`echo "$arg" | sed -e 's,\([^=a-zA-Z0-9_.-]\),\\\\\1,g'`
fi
;;
esac
@@ -94,11 +110,9 @@ else
fi
fi
-# The following test is to make this script compatible with the 4.0 where
-# the first argument was the password
if test -z "$password"
then
- password=`echo $args | sed -e 's/ *//g'`
+ password=$old_style_password
fi
cmd="$bindir/mysql -f --user=$user --host=$host"