mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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 --)
This commit is contained in:
@ -525,7 +525,7 @@ fi
|
|||||||
|
|
||||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
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_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"
|
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
|
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
let $type= 'InnoDB' ;
|
let $type= 'InnoDB' ;
|
||||||
-- source include/ps_create.inc
|
-- source include/ps_create.inc
|
||||||
-- source include/ps_renew.inc
|
-- source include/ps_renew.inc
|
||||||
|
@ -17,8 +17,24 @@ bindir=""
|
|||||||
|
|
||||||
file=mysql_fix_privilege_tables.sql
|
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
|
# 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() {
|
parse_arguments() {
|
||||||
# We only need to pass arguments through to the server if we don't
|
# We only need to pass arguments through to the server if we don't
|
||||||
# handle them here. So, we collect unrecognized options (passed on
|
# handle them here. So, we collect unrecognized options (passed on
|
||||||
@ -36,7 +52,7 @@ parse_arguments() {
|
|||||||
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
--password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
--password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||||
--host=*) host=`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 ;;
|
--verbose) verbose=1 ;;
|
||||||
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
|
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
|
||||||
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
|
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
|
||||||
@ -47,7 +63,7 @@ parse_arguments() {
|
|||||||
then
|
then
|
||||||
# This sed command makes sure that any special chars are quoted,
|
# This sed command makes sure that any special chars are quoted,
|
||||||
# so the arg gets passed exactly to the server.
|
# 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
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -94,11 +110,9 @@ else
|
|||||||
fi
|
fi
|
||||||
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"
|
if test -z "$password"
|
||||||
then
|
then
|
||||||
password=`echo $args | sed -e 's/ *//g'`
|
password=$old_style_password
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmd="$bindir/mysql -f --user=$user --host=$host"
|
cmd="$bindir/mysql -f --user=$user --host=$host"
|
||||||
|
Reference in New Issue
Block a user