summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 13:28:25 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 13:28:25 +0300
commitb2baeba415b4c8564cd46a624a9cede8a033a9f3 (patch)
tree1629a71dcbd994d2d137ff88edd3fc0f667884cc /scripts
parent7b06bc9a9447f1ec63930f27a4209b312d24c519 (diff)
parent2d8e38bc9477aa00b371ed14d95390bede70c5cb (diff)
downloadmariadb-git-b2baeba415b4c8564cd46a624a9cede8a033a9f3.tar.gz
Merge 10.7 into 10.8
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables.sql8
-rw-r--r--scripts/wsrep_sst_mariabackup.sh2
-rw-r--r--scripts/wsrep_sst_rsync.sh16
3 files changed, 18 insertions, 8 deletions
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index b48e9baf12b..fd2f1c95dda 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -35,17 +35,15 @@ set @had_db_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS global_priv (Host char(255) binary DEFAULT '', User char(128) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
-set @had_sys_user= 0 <> (select count(*) from mysql.global_priv where Host="localhost" and User="mariadb.sys");
-
set @exists_user_view= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user');
set @exists_user_view_by_root= EXISTS (SELECT * FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost');
-set @need_sys_user_creation= (NOT @had_sys_user) AND (( NOT @exists_user_view) OR @exists_user_view_by_root);
+set @need_sys_user_creation= (( NOT @exists_user_view) OR @exists_user_view_by_root);
CREATE TEMPORARY TABLE tmp_user_sys LIKE global_priv;
INSERT INTO tmp_user_sys (Host,User,Priv) VALUES ('localhost','mariadb.sys','{"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}');
-INSERT INTO global_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
+INSERT IGNORE INTO global_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;
@@ -117,7 +115,7 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Host char(255) binary DEFAULT '' NOT NU
CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv;
INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Delete');
-INSERT INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
+INSERT IGNORE INTO tables_priv SELECT * FROM tmp_user_sys WHERE 0 <> @need_sys_user_creation;
DROP TABLE tmp_user_sys;
CREATE TABLE IF NOT EXISTS columns_priv ( Host char(255) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(128) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index ce4001fdc56..067a777fb9c 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -472,7 +472,7 @@ read_cnf()
encrypt=$(parse_cnf "$encgroups" 'encrypt' 0)
tmode=$(parse_cnf "$encgroups" 'ssl-mode' 'DISABLED' | \
- tr [:lower:] [:upper:])
+ tr '[[:lower:]]' '[[:upper:]]')
case "$tmode" in
'VERIFY_IDENTITY'|'VERIFY_CA'|'REQUIRED'|'DISABLED')
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 735016cda71..adc78f1c70d 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -3,7 +3,7 @@
set -ue
# Copyright (C) 2017-2022 MariaDB
-# Copyright (C) 2010-2014 Codership Oy
+# Copyright (C) 2010-2022 Codership Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -224,7 +224,7 @@ SSTCERT="$tpem"
SSTCA="$tcert"
SSTCAP="$tcap"
-SSLMODE=$(parse_cnf "$encgroups" 'ssl-mode' | tr [:lower:] [:upper:])
+SSLMODE=$(parse_cnf "$encgroups" 'ssl-mode' | tr '[[:lower:]]' '[[:upper:]]')
if [ -z "$SSLMODE" ]; then
# Implicit verification if CA is set and the SSL mode
@@ -416,6 +416,8 @@ EOF
sync
+ wsrep_log_info "Tables flushed"
+
if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
# Change the directory to binlog base (if possible):
cd "$DATA"
@@ -557,6 +559,8 @@ FILTER="-f '- /lost+found'
exit $RC
fi
+ wsrep_log_info "Transfer of normal directories done"
+
# Transfer InnoDB data files
rsync ${STUNNEL:+--rsh="$STUNNEL"} \
--owner --group --perms --links --specials \
@@ -570,6 +574,8 @@ FILTER="-f '- /lost+found'
exit 255 # unknown error
fi
+ wsrep_log_info "Transfer of InnoDB data files done"
+
# second, we transfer InnoDB and Aria log files
rsync ${STUNNEL:+--rsh="$STUNNEL"} \
--owner --group --perms --links --specials \
@@ -583,6 +589,8 @@ FILTER="-f '- /lost+found'
exit 255 # unknown error
fi
+ wsrep_log_info "Transfer of InnoDB and Aria log files done"
+
# then, we parallelize the transfer of database directories,
# use '.' so that path concatenation works:
@@ -610,6 +618,9 @@ FILTER="-f '- /lost+found'
exit 255 # unknown error
fi
+ wsrep_log_info "Transfer of data done"
+
+
else # BYPASS
wsrep_log_info "Bypassing state dump."
@@ -620,6 +631,7 @@ FILTER="-f '- /lost+found'
fi
+ wsrep_log_info "Sending continue to donor"
echo 'continue' # now server can resume updating data
echo "$STATE" > "$MAGIC_FILE"