List:Commits« Previous MessageNext Message »
From:Ian Greenhoe Date:June 23 2006 10:07pm
Subject:bk commit into 4.1 tree (igreenhoe:1.2511) BUG#17700
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of greenman. When greenman does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2511 06/06/23 13:07:28 igreenhoe@stripped +1 -0
  Fix for bug #17700 (mysql_fix_privilege_tables cannot handle a
  password with embedded spaces)
  
  Problem:  Original code written assuming password contains no spaces.
  Further, because of how sh interprets characters in variables, you
  cannot do the "simple solution".
  
  Solution:  Move the "was a password provided" check to the end. This
  allows us to correctly quote the password argument when passed to the
  mysql client program.

  scripts/mysql_fix_privilege_tables.sh
    1.30 06/06/23 13:07:24 igreenhoe@stripped +14 -5
    Moved password existence check to end to allow for passwords with
    with embedded spaces.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	igreenhoe
# Host:	anubis.greendragongames.com
# Root:	/home/greenman/workspace-mysql/mysql/bug-4.1-17700

--- 1.29/scripts/mysql_fix_privilege_tables.sh	2004-12-09 02:47:15 -08:00
+++ 1.30/scripts/mysql_fix_privilege_tables.sh	2006-06-23 13:07:24 -07:00
@@ -120,9 +120,6 @@
 fi
 
 cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host"
-if test ! -z "$password" ; then
-  cmd="$cmd --password=$password"
-fi
 if test ! -z "$port"; then
   cmd="$cmd --port=$port"
 fi
@@ -180,9 +177,21 @@
 
 if test $verbose = 0
 then
-  cat $sql_file | $cmd > /dev/null 2>&1
+  # Password test is done here due to quoting rules under sh
+  if test ! -z "$password"
+  then
+    cat $sql_file | $cmd --password="$password" > /dev/null 2>&1
+  else
+    cat $sql_file | $cmd > /dev/null 2>&1
+  fi
 else
-  cat $sql_file | $cmd > /dev/null
+  # Password test is done here due to quoting rules under sh
+  if test ! -z "$password"
+  then
+    cat $sql_file | $cmd --password="$password" > /dev/null
+  else
+    cat $sql_file | $cmd > /dev/null
+  fi
 fi
 if test $? = 0
 then
Thread
bk commit into 4.1 tree (igreenhoe:1.2511) BUG#17700Ian Greenhoe23 Jun