summaryrefslogtreecommitdiff
path: root/scripts/mysql_fix_privilege_tables.sh
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-03-19 14:52:48 +0200
committerunknown <monty@mysql.com>2004-03-19 14:52:48 +0200
commit9935110b30fff7fb79bf3eebdfd310b86474d425 (patch)
tree1c6d92ecad9833a2597679df059d3a046018aa9d /scripts/mysql_fix_privilege_tables.sh
parent00ff1f609ea0500d6701db2e8b7dd34374d099c5 (diff)
downloadmariadb-git-9935110b30fff7fb79bf3eebdfd310b86474d425.tar.gz
Portability fixes
Removed \r from new tests Fixes to get new sustem_mysql_db... tests to work client/mysqltest.c: More debug information innobase/que/que0que.c: Fixed wrong usage of __attribute mysql-test/mysql-test-run.sh: Portability fix; Added CLIENT_BINDIR mysql-test/t/system_mysql_db_fix.test: Removed \r mysql-test/t/system_mysql_db_refs.test: Removed \r scripts/mysql_fix_privilege_tables.sh: Don't set root password from first option Added --bindir option
Diffstat (limited to 'scripts/mysql_fix_privilege_tables.sh')
-rw-r--r--scripts/mysql_fix_privilege_tables.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 5e3e4210aa4..1dac3ebc725 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -32,13 +32,23 @@
# --password=<password>
# --database=<database>
-root_password="$1"
+root_password=""
host="localhost"
user="root"
port=""
socket=""
comment=""
database="mysql"
+bindir="@bindir@"
+
+# Old format where there is only one argument and it's the password
+if test "$#" == 1
+then
+ case "$1" in
+ --*) ;;
+ *) root_password="$1" ; shift ;;
+ esac
+fi
# read all the options
parse_arguments()
@@ -52,6 +62,7 @@ parse_arguments()
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
--password=*) root_password=`echo "$arg" | sed -e "s;--password=;;"` ;;
--database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
+ --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;;
*)
echo "Unknown argument '$arg'"
exit 1
@@ -63,7 +74,7 @@ parse_arguments()
parse_arguments "$@"
if test -z "$cmd"; then
- cmd="@bindir@/mysql -f --user=$user --host=$host"
+ cmd="$bindir/mysql -f --user=$user --host=$host"
if test ! -z "$root_password"; then
cmd="$cmd --password=$root_password"
fi