summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-06-30 16:39:20 +0200
committerSergei Golubchik <serg@mariadb.org>2018-06-30 16:39:20 +0200
commit36e59752e7fc70bc5179a3d730b5ce3ee58e4e30 (patch)
tree0d3e30ce973b2e1f044931c0eb1846d7192becda /scripts
parent7c0779da7c37f6ef6eff2f79dda6f1b0c57e3869 (diff)
parent1dd3c8f8ba49ec06e550d7376d27ff05ce024bec (diff)
downloadmariadb-git-36e59752e7fc70bc5179a3d730b5ce3ee58e4e30.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'scripts')
-rw-r--r--scripts/CMakeLists.txt19
-rw-r--r--scripts/mysql_install_db.sh35
-rw-r--r--scripts/mysql_system_tables_data.sql5
-rwxr-xr-xscripts/wsrep_sst_common.sh28
-rw-r--r--scripts/wsrep_sst_mysqldump.sh13
5 files changed, 70 insertions, 30 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index d7f7906f713..fe14edba139 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -175,6 +175,7 @@ IF(INSTALL_LAYOUT MATCHES "STANDALONE")
SET(scriptdir ${prefix}/${INSTALL_BINDIR})
SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
+ SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR})
SET(localstatedir ${prefix}/data)
ELSE()
SET(prefix "${CMAKE_INSTALL_PREFIX}")
@@ -183,6 +184,7 @@ ELSE()
SET(scriptdir ${INSTALL_BINDIRABS})
SET(libexecdir ${INSTALL_SBINDIRABS})
SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS})
+ SET(pkgplugindir ${INSTALL_PLUGINDIRABS})
SET(localstatedir ${MYSQL_DATADIR})
ENDIF()
@@ -330,6 +332,22 @@ ELSE()
COMPONENT ${${file}_COMPONENT}
)
ENDFOREACH()
+ SET (wsrep_sst_rsync_wan ${CMAKE_CURRENT_BINARY_DIR}/wsrep_sst_rsync_wan)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${wsrep_sst_rsync_wan}
+ COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
+ wsrep_sst_rsync
+ wsrep_sst_rsync_wan
+ )
+ ADD_CUSTOM_TARGET(symlink_wsrep_sst_rsync
+ ALL
+ DEPENDS ${wsrep_sst_rsync_wan}
+ )
+ INSTALL(
+ FILES ${wsrep_sst_rsync_wan}
+ DESTINATION ${INSTALL_BINDIR}
+ COMPONENT Server
+ )
FOREACH(file ${WSREP_SOURCE})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
@@ -343,7 +361,6 @@ ELSE()
COMPONENT ${${file}_COMPONENT}
)
ENDFOREACH()
-
ENDIF()
# Install libgcc as mylibgcc.a
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 8d706e4c5ad..ad7c028a7af 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -307,6 +307,7 @@ then
langdir="$basedir/sql/share/english"
srcpkgdatadir="$srcdir/scripts"
buildpkgdatadir="$builddir/scripts"
+ plugindir="$builddir/plugin/auth_socket"
elif test -n "$basedir"
then
bindir="$basedir/bin" # only used in the help text
@@ -335,6 +336,7 @@ then
cannot_find_file fill_help_tables.sql @pkgdata_locations@
exit 1
fi
+ plugindir=`find_in_dirs --dir auth_socket.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin`
else
basedir="@prefix@"
bindir="@bindir@"
@@ -342,6 +344,7 @@ else
mysqld="@libexecdir@/mysqld"
srcpkgdatadir="@pkgdatadir@"
buildpkgdatadir="@pkgdatadir@"
+ plugindir="@pkgplugindir@"
fi
# Set up paths to SQL scripts required for bootstrap
@@ -461,6 +464,7 @@ mysqld_install_cmd_line()
{
"$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup\
"--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" \
+ "--plugin-dir=${plugindir}" \
$args --max_allowed_packet=8M \
--net_buffer_length=16K
}
@@ -538,19 +542,24 @@ then
s_echo "To start mysqld at boot time you have to copy"
s_echo "support-files/mysql.server to the right place for your system"
- echo
- echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
- echo "To do so, start the server, then issue the following commands:"
- echo
- echo "'$bindir/mysqladmin' -u root password 'new-password'"
- echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
- echo
- echo "Alternatively you can run:"
- echo "'$bindir/mysql_secure_installation'"
- echo
- echo "which will also give you the option of removing the test"
- echo "databases and anonymous user created by default. This is"
- echo "strongly recommended for production servers."
+ if test "$auth_root_authentication_method" = normal
+ then
+ echo
+ echo
+ echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
+ echo "To do so, start the server, then issue the following commands:"
+ echo
+ echo "'$bindir/mysqladmin' -u root password 'new-password'"
+ echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
+ echo
+ echo "Alternatively you can run:"
+ echo "'$bindir/mysql_secure_installation'"
+ echo
+ echo "which will also give you the option of removing the test"
+ echo "databases and anonymous user created by default. This is"
+ echo "strongly recommended for production servers."
+ fi
+
echo
echo "See the MariaDB Knowledgebase at http://mariadb.com/kb or the"
echo "MySQL manual for more instructions."
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index 0fbbfe4701f..4761fe51dcc 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -35,8 +35,11 @@ INSERT INTO tmp_user_nopasswd VALUES ('localhost','root','','Y','Y','Y','Y','Y',
REPLACE INTO tmp_user_nopasswd SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0 FROM dual WHERE @current_hostname != 'localhost';
REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0);
REPLACE INTO tmp_user_nopasswd VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0);
--- More secure root account using unix sucket auth.
+-- More secure root account using unix socket auth.
INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),'','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'unix_socket','','N', 'N','', 0);
+IF @auth_root_socket is not null THEN
+ IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN
+ INSTALL SONAME 'auth_socket'; END IF; END IF;
INSERT INTO user SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0 AND @skip_auth_root_nopasswd IS NULL;
INSERT INTO user SELECT * FROM tmp_user_socket WHERE @had_user_table=0 AND @auth_root_socket IS NOT NULL;
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index e72b74ab6d1..21da52b015e 100755
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -35,12 +35,24 @@ case "$1" in
#
# Break address string into host:port/path parts
#
- readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
- readonly WSREP_SST_OPT_HOST_UNESCAPED=`echo "$WSREP_SST_OPT_HOST"|awk '{if(match($0,/^\[.*\]$/)) $0=substr($0,2,RLENGTH-2);print}'`
- readonly WSREP_SST_OPT_ADDR_PORT=$(echo $WSREP_SST_OPT_ADDR | \
- cut -d ']' -f 2 | cut -s -d ':' -f 2 | cut -d '/' -f 1)
+ case "${WSREP_SST_OPT_ADDR}" in
+ \[*)
+ # IPv6
+ addr_no_bracket=${WSREP_SST_OPT_ADDR#\[}
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*}
+ readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
+ ;;
+ *)
+ readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST
+ ;;
+ esac
+ remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST}}
+ remain=${remain#:}
+ readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*}
+ remain=${remain#*/}
+ readonly WSREP_SST_OPT_MODULE=${remain%%/*}
readonly WSREP_SST_OPT_PATH=${WSREP_SST_OPT_ADDR#*/}
- readonly WSREP_SST_OPT_MODULE=${WSREP_SST_OPT_PATH%%/*}
remain=${WSREP_SST_OPT_PATH#*/}
readonly WSREP_SST_OPT_LSN=${remain%%/*}
remain=${remain#*/}
@@ -120,10 +132,10 @@ done
readonly WSREP_SST_OPT_BYPASS
readonly WSREP_SST_OPT_BINLOG
-if [ -n "${WSREP_SST_OPT_ADDR:-}" ]; then
+if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then
if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then
- if [ -n "$WSREP_SST_OPT_ADDR_PORT" -a "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
- wsrep_log_error "port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR"
+ if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
+ echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2
exit 2
fi
else
diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh
index cfe4838fbc4..faa3f10639b 100644
--- a/scripts/wsrep_sst_mysqldump.sh
+++ b/scripts/wsrep_sst_mysqldump.sh
@@ -108,11 +108,6 @@ then
DROP PREPARE stmt;"
fi
-# Retrieve the donor's @@global.gtid_binlog_state.
-GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" |\
-$MYSQL_CLIENT $AUTH -S$WSREP_SST_OPT_SOCKET --disable-reconnect --connect_timeout=10 |\
-tail -1 | awk -F ' ' '{ print $2 }')
-
MYSQL="$MYSQL_CLIENT $WSREP_SST_OPT_CONF "\
"$AUTH -h${WSREP_SST_OPT_HOST_UNESCAPED} "\
"-P$WSREP_SST_OPT_PORT --disable-reconnect --connect_timeout=10"
@@ -126,12 +121,16 @@ tail -1 | awk -F ' ' '{ print $2 }')
SERVER_VERSION=$(echo "set statement wsrep_sync_wait=0 for SHOW VARIABLES LIKE 'version'" | $MYSQL |\
tail -1 | awk -F ' ' '{ print $2 }')
+# Retrieve the donor's @@global.gtid_binlog_state.
+GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" | $MYSQL |\
+tail -1 | awk -F ' ' '{ print $2 }')
+
RESET_MASTER=""
SET_GTID_BINLOG_STATE=""
SQL_LOG_BIN_OFF=""
# Safety check
-if echo $SERVER_VERSION | grep '^10.' > /dev/null
+if [ "${SERVER_VERSION%%.*}" != '5' ]
then
# If binary logging is enabled on the joiner node, we need to copy donor's
# gtid_binlog_state to joiner. In order to do that, a RESET MASTER must be
@@ -146,7 +145,7 @@ then
fi
# NOTE: we don't use --routines here because we're dumping mysql.proc table
-MYSQLDUMP="$MYSQLDUMP $AUTH -S$WSREP_SST_OPT_SOCKET \
+MYSQLDUMP="$MYSQLDUMP $WSREP_SST_OPT_CONF $AUTH -S$WSREP_SST_OPT_SOCKET \
--add-drop-database --add-drop-table --skip-add-locks --create-options \
--disable-keys --extended-insert --skip-lock-tables --quick --set-charset \
--skip-comments --flush-privileges --all-databases --events"