Bug #968 script needs fixing
Submitted: 31 Jul 2003 12:19 Modified: 1 Aug 2003 1:11
Reporter: Philip Brown Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version: OS:
Assigned to: Lenz Grimmer CPU Architecture:Any

[31 Jul 2003 12:19] Philip Brown
Description:
[This bug is copied from a message I sent to the docs group. they asked me to file a bug on it]

Note that the mysql_fix_privilege_tables makes non-portable assumptions
about /bin/sh
   
[" mysql_fix_privilege_tables: test: argument expected " ]

   
Under solaris,for example,  you'll want to explicitly run
   
 ksh [mysqlbinpath]/mysql_fix_privilege_tables

How to repeat:
run the script on a non-linux box.

Suggested fix:
run the script a few times under a "true" bourne shell, and pull out the non-portable stuff.
[31 Jul 2003 23:21] Alex Kiernan
The fix is trivial:

Index: scripts/mysql_fix_privilege_tables.sh
===================================================================
RCS file: /cvsroot/upstream/mysql/scripts/mysql_fix_privilege_tables.sh,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- scripts/mysql_fix_privilege_tables.sh	2003/07/18 14:57:48	1.1.1.2
+++ scripts/mysql_fix_privilege_tables.sh	2003/08/01 06:01:41	1.2
@@ -4,7 +4,7 @@
 host="localhost"
 user="root"
 
-if test -z $1 ; then
+if test -z "$1" ; then
   cmd="@bindir@/mysql -f --user=$user --host=$host mysql"
 else
   root_password="$1"
[1 Aug 2003 1:11] Lenz Grimmer
Thanks for the patch! Now fixed in the 4.0 tree:

ChangeSet@1.1554, 2003-08-01 10:09:23+02:00, lenz@mysql.com
   - fixed BUG#968 ("test: argument expected" error) - thanks to Alex Kiernan
     for the patch