List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:July 7 2011 3:50pm
Subject:bzr push into mysql-5.1 branch (joerg.bruehe:3566 to 3567) Bug#45415
View as plain text  
 3567 Joerg Bruehe	2011-07-07
      Fix bug#45415: "rpm upgrade recreates test database"
      
      Let the creation of the "test" database happen only during a new
      installation, not in an RPM upgrade.

    modified:
      support-files/mysql.spec.sh
 3566 Georgi Kodinov	2011-07-07 [merge]
      empty weave merge from mysql-5.0

=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh	2011-06-30 15:37:13 +0000
+++ b/support-files/mysql.spec.sh	2011-07-07 15:22:24 +0000
@@ -798,13 +798,12 @@ else
 fi
 # echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
 if [ ! -d $mysql_datadir/mysql ] ; then
-	mkdir $mysql_datadir/mysql;
+	mkdir $mysql_datadir/mysql $mysql_datadir/test
 	echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
 else
 	# If the directory exists, we may assume it is an upgrade.
 	echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
 fi
-if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
 
 # ----------------------------------------------------------------------
 # Make MySQL start/shutdown automatically when the machine does it.
@@ -837,7 +836,12 @@ chown -R %{mysqld_user}:%{mysqld_group} 
 # ----------------------------------------------------------------------
 # Initiate databases if needed
 # ----------------------------------------------------------------------
-%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
+	# Fix bug#45415: no "mysql_install_db" on an upgrade
+	# Do this as a negative to err towards more "install" runs
+	# rather than to miss one.
+	%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+fi
 
 # ----------------------------------------------------------------------
 # Upgrade databases if needed would go here - but it cannot be automated yet
@@ -1161,6 +1165,12 @@ fi
 # merging BK trees)
 ##############################################################################
 %changelog
+* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@stripped>
+
+- Fix bug#45415: "rpm upgrade recreates test database"
+  Let the creation of the "test" database happen only during a new installation,
+  not in an RPM upgrade.
+  This affects both the "mkdir" and the call of "mysql_install_db".
 
 * Thu Feb 03 2011 Joerg Bruehe <joerg.bruehe@stripped>
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1 branch (joerg.bruehe:3566 to 3567) Bug#45415Joerg Bruehe7 Jul