summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-04-17 14:53:30 +0200
committerSergei Golubchik <serg@mariadb.org>2019-04-24 16:06:54 +0200
commit3db6de33b2b47a3c31bc8f8deb721abe0c5b0e1c (patch)
tree335035a147364001b85c674ec542f2ca5dab84b1
parent17088dd941b6c759e294cc3a9767574b19734694 (diff)
downloadmariadb-git-3db6de33b2b47a3c31bc8f8deb721abe0c5b0e1c.tar.gz
MDEV-17640 UMASK_DIR configuration for mysql_install_db is not applied to mysql database
create mysql and test databases with SQL, not mkdir.
-rwxr-xr-xdebian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch21
-rw-r--r--scripts/mysql_install_db.sh8
-rw-r--r--support-files/rpm/server-postin.sh3
3 files changed, 15 insertions, 17 deletions
diff --git a/debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch b/debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch
index 5ab8ab3d3d7..9593cd7c3e0 100755
--- a/debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch
+++ b/debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch
@@ -7,14 +7,13 @@
@DPATCH@
---- mysql-dfsg-5.1-5.1.23rc.orig/scripts/mysql_install_db.sh 2008-01-29 22:41:20.000000000 +0100
-+++ mysql-dfsg-5.1-5.1.23rc/scripts/mysql_install_db.sh 2008-02-28 10:08:11.000000000 +0100
-@@ -372,7 +372,7 @@ then
- fi
-
- # Create database directories
--for dir in "$ldata" "$ldata/mysql" "$ldata/test"
-+for dir in "$ldata" "$ldata/mysql"
- do
- if test ! -d "$dir"
- then
+--- a/scripts/mysql_install_db.sh
++++ b/scripts/mysql_install_db.sh
+@@ -36,7 +36,6 @@ in_rpm=0
+ ip_only=0
+ cross_bootstrap=0
+ install_params="create database if not exists mysql;
+-create database if not exists test;
+ use mysql;"
+ auth_root_authentication_method=normal
+ auth_root_socket_user='root'
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 5fa2c4c0e04..43b7d7a52f6 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -35,7 +35,9 @@ force=0
in_rpm=0
ip_only=0
cross_bootstrap=0
-install_params=""
+install_params="create database if not exists mysql;
+create database if not exists test;
+use mysql;"
auth_root_authentication_method=normal
auth_root_socket_user='root'
@@ -431,7 +433,7 @@ then
fi
# Create database directories
-for dir in "$ldata" "$ldata/mysql" "$ldata/test"
+for dir in "$ldata"
do
if test ! -d "$dir"
then
@@ -493,7 +495,7 @@ SET @auth_root_socket=NULL;" ;;
SET @skip_auth_root_nopasswd=1;
SET @auth_root_socket='$auth_root_socket_user';" ;;
esac
-if { echo "use mysql;$install_params"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
+if { echo "$install_params"; cat "$create_system_tables" "$create_system_tables2" "$fill_system_tables"; } | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null
then
s_echo "OK"
else
diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh
index ad783812184..57db9fd5d90 100644
--- a/support-files/rpm/server-postin.sh
+++ b/support-files/rpm/server-postin.sh
@@ -53,9 +53,6 @@ if [ $1 = 1 ] ; then
chown -R %{mysqld_user}:%{mysqld_group} $datadir
if [ ! -e $datadir/mysql ]; then
- # Create data directory
- mkdir -p $datadir/{mysql,test}
-
# Initiate databases
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
fi