92cf85
Revert upstream changes to make the mysql_install_dbrelocatable
92cf85
92cf85
Resolves: #1731062
92cf85
92cf85
Upstream intended to make the mysql_install_db script to be relocatable, which
92cf85
is not a supported use case in RHEL. Because of different layout (mysqld in
92cf85
/usr/libexec while all other binaries in /usr/bin) these changes broke
92cf85
mysql_install_db if run without arguments (we use --rpm in the systemd so we
92cf85
didn't meet this issue there). Reverting changes upstream did fixes the
92cf85
standalone run of mysql_install_db again.
92cf85
92cf85
Original upstream issue: https://jira.mariadb.org/browse/MDEV-14580
92cf85
Related fixes that broke the RHEL build:
92cf85
https://github.com/MariaDB/server/commit/9c5be7d131f7eb7f27df722463faa2cd8135fd1b
92cf85
https://github.com/MariaDB/server/commit/50e593386fcbaa1ca7bd2ed9fdfc51fd5102cdab
92cf85
92cf85
diff -up mariadb-5.5.65/scripts/mysql_install_db.sh.norellocatable mariadb-5.5.65/scripts/mysql_install_db.sh
92cf85
--- mariadb-5.5.65/scripts/mysql_install_db.sh.norellocatable	2019-08-17 07:06:14.135318451 +0200
92cf85
+++ mariadb-5.5.65/scripts/mysql_install_db.sh	2019-08-17 07:10:58.702473136 +0200
92cf85
@@ -36,9 +36,6 @@ in_rpm=0
92cf85
 ip_only=0
92cf85
 cross_bootstrap=0
92cf85
 
92cf85
-dirname0=`dirname $0 2>/dev/null`
92cf85
-dirname0=`dirname $dirname0 2>/dev/null`
92cf85
-
92cf85
 usage()
92cf85
 {
92cf85
   cat <
92cf85
@@ -243,16 +238,9 @@ then
92cf85
 fi
92cf85
 if test -n "$srcdir"
92cf85
 then
92cf85
-  # In an out-of-source build, builddir is not srcdir. Try to guess where
92cf85
-  # builddir is by looking for my_print_defaults.
92cf85
   if test -z "$builddir"
92cf85
   then
92cf85
-    if test -x "$dirname0/extra/my_print_defaults"
92cf85
-    then
92cf85
-      builddir="$dirname0"
92cf85
-    else
92cf85
-      builddir="$srcdir"
92cf85
-    fi
92cf85
+    builddir="$srcdir"
92cf85
   fi
92cf85
   print_defaults="$builddir/extra/my_print_defaults"
92cf85
 elif test -n "$basedir"
92cf85
@@ -263,9 +251,6 @@ then
92cf85
     cannot_find_file my_print_defaults $basedir/bin $basedir/extra
92cf85
     exit 1
92cf85
   fi
92cf85
-elif test -n "$dirname0" -a -x "$dirname0/@bindir@/my_print_defaults"
92cf85
-then
92cf85
-  print_defaults="$dirname0/@bindir@/my_print_defaults"
92cf85
 else
92cf85
   print_defaults="@bindir@/my_print_defaults"
92cf85
 fi
92cf85
@@ -317,19 +302,11 @@ then
92cf85
     cannot_find_file fill_help_tables.sql @pkgdata_locations@
92cf85
     exit 1
92cf85
   fi
92cf85
-# relative from where the script was run for a relocatable install
92cf85
-elif test -n "$dirname0" -a -x "$dirname0/@INSTALL_SBINDIR@/mysqld"
92cf85
-then
92cf85
-  basedir="$dirname0"
92cf85
-  bindir="$basedir/@INSTALL_SBINDIR@"
92cf85
-  resolveip="$bindir/resolveip"
92cf85
-  mysqld="$basedir/@INSTALL_SBINDIR@/mysqld"
92cf85
-  pkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
92cf85
 else
92cf85
   basedir="@prefix@"
92cf85
   bindir="@bindir@"
92cf85
   resolveip="$bindir/resolveip"
92cf85
-  mysqld="@sbindir@/mysqld"
92cf85
+  mysqld="@libexecdir@/mysqld"
92cf85
   pkgdatadir="@pkgdatadir@"
92cf85
 fi
92cf85