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

Proposed by Ignacio Nin
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: 545
Merged at revision: 547
Proposed branch: lp:~ignacio-nin/percona-server/5.5-bug1169522
Merge into: lp:percona-server/5.5
Diff against target: 35 lines (+8/-5)
1 file modified
build/percona-server.spec (+8/-5)
To merge this branch: bzr merge lp:~ignacio-nin/percona-server/5.5-bug1169522
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+172265@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-27 15:35:20 +0000
3+++ build/percona-server.spec 2013-07-01 02:34:39 +0000
4@@ -754,15 +754,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
15- mkdir $mysql_datadir/test;
16-fi
17
18 # ----------------------------------------------------------------------
19 # Create a MySQL user and group. Do not report any problems if it already
20@@ -778,7 +774,14 @@
21 # ----------------------------------------------------------------------
22 # Initiate databases if needed
23 # ----------------------------------------------------------------------
24-%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
25+ # Does $mysql_datadir/mysql exist? In this case, this is probably an
26+ # upgrade from a previous version or a reinstall. It's best not to
27+ # call mysql_install_db in this case since the test db would be
28+ # possibly recreated (bug #1169522).
29+ if test ! -e $mysql_datadir/mysql
30+ then
31+ %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
32+ fi
33 fi
34
35 # ----------------------------------------------------------------------

Subscribers

People subscribed via source and target branches