List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:July 14 2010 9:58am
Subject:bzr push into mysql-5.1-bugteam branch (Georgi.Kodinov:3477 to 3478)
Bug#52274
View as plain text  
 3478 Georgi Kodinov	2010-07-09
      Bug #52274 : Missing path to mysql in mysql_secure_installation
            
      Added some code to try to find the mysql command line in the most 
      common places and stop if it's not there.

    modified:
      scripts/mysql_secure_installation.sh
 3477 Davi Arnaut	2010-07-09
      Use UNINIT_VAR workaround instead of LINT_INIT.

    modified:
      client/mysqlshow.c
      regex/regcomp.c
=== modified file 'scripts/mysql_secure_installation.sh'
--- a/scripts/mysql_secure_installation.sh	2009-11-03 20:50:28 +0000
+++ b/scripts/mysql_secure_installation.sh	2010-07-09 11:11:12 +0000
@@ -17,6 +17,7 @@
 
 config=".my.cnf.$$"
 command=".mysql.$$"
+mysql_client=""
 
 trap "interrupt" 2
 
@@ -37,10 +38,26 @@ prepare() {
     chmod 600 $config $command
 }
 
+find_mysql_client()
+{
+  for n in ./bin/mysql mysql
+  do  
+    $n --no-defaults --help > /dev/null 2>&1
+    status=$?
+    if test $status -eq 0
+    then
+      mysql_client=$n
+      return
+    fi  
+  done
+  echo "Can't find a 'mysql' client in PATH or ./bin"
+  exit 1
+}
+
 do_query() {
     echo "$1" >$command
     #sed 's,^,> ,' < $command  # Debugging
-    mysql --defaults-file=$config <$command
+    $mysql_client --defaults-file=$config <$command
     return $?
 }
 
@@ -204,6 +221,7 @@ cleanup() {
 # The actual script starts here
 
 prepare
+find_mysql_client
 set_echo_compat
 
 echo


Attachment: [text/bzr-bundle] bzr/georgi.kodinov@oracle.com-20100709111112-f80fv5ttuladiy1g.bundle
Thread
bzr push into mysql-5.1-bugteam branch (Georgi.Kodinov:3477 to 3478)Bug#52274Georgi Kodinov14 Jul