Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions scripts/bash_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ upgrade_test_type() {
;;
"major")
major=${major_version%.*}
# intentionally twice, 11.5.3 has minor of 5.
minor=${major_version##*.}
# 11.5 has minor of 5 and major of 11
minor=${major_version##*.}
# with the earliest supported 11.X version
# and make this the upgrade from 10.11
Expand All @@ -477,7 +476,20 @@ upgrade_test_type() {
exit 1
fi
else
prev_major_version="$major.$((minor - 1))"
case $major_version in
"10.11")
prev_major_version="10.6"
;;
"11.4")
prev_major_version="10.11"
;;
"11.8")
prev_major_version="11.4"
;;
*)
prev_major_version="$major.$((minor - 1))"
;;
esac
fi
;;
"distro")
Expand Down
20 changes: 0 additions & 20 deletions scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,6 @@ if [[ $package_version == "$old_version" ]]; then
exit
fi

# ------------------------------------------------------------------------------
# -- MDBF-1121 / MDEV-33459 --
# ------------------------------------------------------------------------------

# Major upgrades within the same family (>10) and vendor (!=distro)
# should work without removing old packages first.

old_family=$(echo "$prev_major_version" | sed -n -e 's,^\([1-9][0-9]*\)\..*$,\1,p')
new_family=$(echo "$major_version" | sed -n -e 's,^\([1-9][0-9]*\)\..*$,\1,p')

if [[ "$test_type" == "distro" ||
( "$old_family" -lt 11 && "$test_type" != "minor" ) ||
"$old_family" -ne "$new_family" ]]; then
bb_log_info "remove old packages for major upgrade"
packages_to_remove=$(rpm -qa | grep -E '^(MariaDB|mariadb)-' | awk -F'-' '{print $1"-"$2}')
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" remove
rpm -qa | grep -iE 'maria|mysql' || true
fi
# ------------------------------------------------------------------------------

rpm_setup_bb_galera_artifacts_mirror
rpm_setup_bb_artifacts_mirror
if [[ "$test_type" =~ ^(major|distro)$ ]]; then
Expand Down