List:Commits« Previous MessageNext Message »
From:Nirbhay Choubey Date:October 12 2012 10:42am
Subject:bzr push into mysql-trunk branch (nirbhay.choubey:4710 to 4711) Bug#14726722
View as plain text  
 4711 Nirbhay Choubey	2012-10-12 [merge]
      Merge of patch for Bug#14726722 from mysql-5.6.

    modified:
      scripts/mysql_secure_installation.pl.in
      scripts/mysql_secure_installation.sh
 4710 Jimmy Yang	2012-10-12
      Fix Bug #14670810 - NOT ABLE TO DIFFERENTIATE READ / WRITE / IBUF IO THREADS
      IN PERFORMANCE SCHEMA
            
      rb://1352 approved by Marko

    modified:
      mysql-test/suite/perfschema/r/threads_innodb.result
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/srv0srv.h
      storage/innobase/srv/srv0start.cc
=== modified file 'scripts/mysql_secure_installation.pl.in'
--- a/scripts/mysql_secure_installation.pl.in	2012-08-29 13:34:48 +0000
+++ b/scripts/mysql_secure_installation.pl.in	2012-10-12 10:40:13 +0000
@@ -189,16 +189,25 @@ sub set_root_password {
 
   my $esc_pass = basic_single_escape($password1);
 
+  # attempt to lift the password expiration flag for root first
+  do_query("SET PASSWORD=PASSWORD('$esc_pass');")
+    or die "root password update failed!\n";
+ 
+  # now since the password has changed, lets use the new one.
+  $rootpass = $password1;
+  make_config($rootpass);
+
+  # set password for all root users
   # do the old password
-  do_query("SET @\@old_passwords=1; UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root' and plugin = 'mysql_old_password';")
+  do_query("SET @\@old_passwords=1; UPDATE mysql.user SET Password=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin = 'mysql_old_password';")
     or die "old password update failed!\n";
 
   # do the native password
-  do_query("SET @\@old_passwords=0; UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root' and plugin in ('', 'mysql_native_password');")
+  do_query("SET @\@old_passwords=0; UPDATE mysql.user SET Password=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin in ('', 'mysql_native_password');")
     or die "native password update failed!\n";
 
   # do the sha256 password
-  do_query("SET @\@old_passwords=2; UPDATE mysql.user SET authentication_string=PASSWORD('$esc_pass') WHERE User='root' and plugin = 'sha256_password';")
+  do_query("SET @\@old_passwords=2; UPDATE mysql.user SET authentication_string=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin = 'sha256_password';")
     or die "sha256 password update failed!\n";
 
 
@@ -208,8 +217,6 @@ sub set_root_password {
     or die "Can not continue.\n";
 
   print "\n";
-  $rootpass = $password1;
-  make_config($rootpass);
 }
 
 sub remove_anonymous_users {

=== modified file 'scripts/mysql_secure_installation.sh'
--- a/scripts/mysql_secure_installation.sh	2012-08-29 13:34:48 +0000
+++ b/scripts/mysql_secure_installation.sh	2012-10-12 10:40:13 +0000
@@ -136,22 +136,34 @@ set_root_password() {
 
     esc_pass=`basic_single_escape "$password1"`
 
+    # attempt to lift the password expiration flag for root first
+    do_query "SET PASSWORD=PASSWORD('$esc_pass');"
+    if [ $? -ne 0 ]; then
+	echo "root password update failed!"
+	clean_and_exit
+    fi
+
+    # now since the password has changed, lets use the new one.
+    rootpass=$password1
+    make_config
+
+    # set password for all root users
     # do the old password
-    do_query "SET @@old_passwords=1; UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root' and plugin = 'mysql_old_password';"
+    do_query "SET @@old_passwords=1; UPDATE mysql.user SET Password=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin = 'mysql_old_password';"
     if [ $? -ne 0 ]; then
 	echo "old password update failed!"
 	clean_and_exit
     fi
 
     # do the native password
-    do_query "SET @@old_passwords=0; UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root' and plugin in ('', 'mysql_native_password');"
+    do_query "SET @@old_passwords=0; UPDATE mysql.user SET Password=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin in ('', 'mysql_native_password');"
     if [ $? -ne 0 ]; then
 	echo "native password update failed!"
 	clean_and_exit
     fi
 
     # do the sha256 password
-    do_query "SET @@old_passwords=2; UPDATE mysql.user SET authentication_string=PASSWORD('$esc_pass') WHERE User='root' and plugin = 'sha256_password';"
+    do_query "SET @@old_passwords=2; UPDATE mysql.user SET authentication_string=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin = 'sha256_password';"
     if [ $? -ne 0 ]; then
 	echo "sha256 password update failed!"
 	clean_and_exit
@@ -164,8 +176,6 @@ set_root_password() {
             clean_and_exit
     fi
     echo
-    rootpass=$password1
-    make_config
 
     return 0
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (nirbhay.choubey:4710 to 4711) Bug#14726722Nirbhay Choubey12 Oct