List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:November 19 2012 2:45pm
Subject:bzr push into mysql-5.6 branch (bjorn.munch:4575 to 4577)
View as plain text  
 4577 Bjorn Munch	2012-11-19
      14848215 - RANDOM PASSWD IN "MYSQL_INSTALL_DB" FAILS DUE TO "TR": "ILLEGAL BYTE SEQUENCE"
      
        Follow-up fix: setting LC_CTYPE was not enough on all platforms.
        On Solaris, with my settings, I saw it generate password with only
        digits or 'a'.
      
        Fixed by setting LC_ALL=C instead.

    modified:
      scripts/mysql_install_db.pl.in
 4576 Bjorn Munch	2012-11-16
      Bug #15866735 MYSQL_INSTALL_DB DOES NOT HONOR --USER, AND CODE TO DO IT IS BROKEN
        Write correct code for executing chown
        --user not supported on Windows

    modified:
      scripts/mysql_install_db.pl.in
 4575 Jon Olav Hauglid	2012-11-09 {clone-5.6.9-rc-build}
      Bug#11762933: MYSQLDUMP WILL SILENTLY SKIP THE `EVENT` TABLE DATA IF DUMPS
      
      Post-push fix: Drop event explicitly since events are now dumped even with --skip-events

    modified:
      mysql-test/r/mysqldump.result
      mysql-test/t/mysqldump.test
=== modified file 'scripts/mysql_install_db.pl.in'
--- a/scripts/mysql_install_db.pl.in	2012-11-02 18:47:08 +0000
+++ b/scripts/mysql_install_db.pl.in	2012-11-19 13:53:28 +0000
@@ -93,15 +93,20 @@ EOF2
                        uses the compiled binaries and support files within the
                        source tree, useful for if you don't want to install
                        MySQL yet and just want to create the system tables.
+EOF3
+  if ( $^O !~ m/^(MSWin32|cygwin)$/ ) {
+    print <<EOF4;
   --user=user_name     The login username to use for running mysqld.  Files
                        and directories created by mysqld will be owned by this
                        user.  You must be root to use this option.  By default
                        mysqld runs using your current login name and files and
                        directories that it creates will be owned by you.
-
+EOF4
+  }
+  print <<EOF5;
 Any other options are passed to the mysqld program.
 
-EOF3
+EOF5
   exit 1;
 }
 
@@ -353,8 +358,8 @@ sub tell_root_password {
 sub generate_random_password {
   # Short term:
   # On (at least) Linux and Solaris, a "random" device is available, use it:
-  # cat /dev/urandom | LC_CTYPE=C tr -dc "[:alnum:]" | fold -w 8  | head -1
-  # Without LC_CTYPE, "tr" may not know the "alnum" character class -
+  # cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1
+  # Without LC_ALL, "tr" may not know the "alnum" character class -
   # and there are user profiles which do not have this set.
   # Note: There is no guarantee the results will pass a validation checker
   # as resulted from WL#2739
@@ -366,7 +371,7 @@ sub generate_random_password {
   # http://search.cpan.org/~cgrau/String-MkPasswd/bin/mkpasswd.pl
   # Using it got approved recently.
   #
-  my $password = `cat /dev/urandom | LC_CTYPE=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
+  my $password = `cat /dev/urandom | LC_ALL=C tr -dc "[:alnum:]" | fold -w 8  | head -1`;
   chomp ($password);
   return $password;
 }
@@ -633,10 +638,30 @@ if ( ! -d $parent ) {
         "restart this script.",
         "If some other path was intended, please use the correct path when restarting this script.");
 }
+
+my $opt_user= $opt->{user};
+my @pwnam;
+if ($opt_user)
+{
+  if ( $^O =~ m/^(MSWin32|cygwin)$/ )
+  {
+    warning($opt, "The --user option is not supported on Windows, ignoring");
+    $opt_user= undef;
+  }
+  else
+  {
+    @pwnam= getpwnam($opt_user);
+  }
+}
+
 foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
 {
   mkdir($dir, 0700) unless -d $dir;
-  chown($opt->{user}, $dir) if -w "/" and !$opt->{user};
+  if ($opt_user and -w "/")
+  {
+    chown($pwnam[2], $pwnam[3], $dir)
+      or error($opt, "Could not chown directory $dir");
+  }
 }
 
 push(@args, "--user=$opt->{user}") if $opt->{user};

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6 branch (bjorn.munch:4575 to 4577) Bjorn Munch19 Nov