Merge lp:~ignacio-nin/percona-server/5.6-bug1169522 into lp:percona-server/5.6

Proposed by Ignacio Nin
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: 397
Merged at revision: 398
Proposed branch: lp:~ignacio-nin/percona-server/5.6-bug1169522
Merge into: lp:percona-server/5.6
Diff against target: 35 lines (+9/-4)
1 file modified
build/percona-server.spec (+9/-4)
To merge this branch: bzr merge lp:~ignacio-nin/percona-server/5.6-bug1169522
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+172266@code.launchpad.net

Description of the change

Fix for bug #1169522. The way this was implemented is that mysql_install_db is not called if the $datadir/mysql directory exists. Also useless calls to mkdir for the mysql and test databases were removed.

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build/percona-server.spec'
2--- build/percona-server.spec 2013-06-25 13:13:06 +0000
3+++ build/percona-server.spec 2013-07-01 02:35:50 +0000
4@@ -737,13 +737,11 @@
5 if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
6 # echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
7 if [ ! -d $mysql_datadir/mysql ] ; then
8- mkdir $mysql_datadir/mysql;
9 echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
10 else
11 # If the directory exists, we may assume it is an upgrade.
12 echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
13 fi
14-if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
15
16 # ----------------------------------------------------------------------
17 # Make MySQL start/shutdown automatically when the machine does it.
18@@ -778,8 +776,15 @@
19 # ----------------------------------------------------------------------
20 # Initiate databases if needed
21 # ----------------------------------------------------------------------
22-%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} \
23- --datadir=$mysql_datadir
24+ # Does $mysql_datadir/mysql exist? In this case, this is probably an
25+ # upgrade from a previous version or a reinstall. It's best not to
26+ # call mysql_install_db in this case since the test db would be
27+ # possibly recreated (bug #1169522).
28+ if test ! -e $mysql_datadir/mysql
29+ then
30+ %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} \
31+ --datadir=$mysql_datadir
32+ fi
33
34 # ----------------------------------------------------------------------
35 # Upgrade databases if needed would go here - but it cannot be automated yet

Subscribers

People subscribed via source and target branches