From f5bcf9149754b13ea1e6957706baaa11eded327d Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Wed, 14 May 2025 09:32:39 +0300 Subject: [PATCH] [#3789] Check only major version in upgrade scripts to allow for intermediary backported schema changes --- .../database/scripts/mysql/upgrade_029_to_030.sh.in | 8 ++++---- .../database/scripts/pgsql/upgrade_028_to_029.sh.in | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/share/database/scripts/mysql/upgrade_029_to_030.sh.in b/src/share/database/scripts/mysql/upgrade_029_to_030.sh.in index e5675cdb18..55d1977cfe 100755 --- a/src/share/database/scripts/mysql/upgrade_029_to_030.sh.in +++ b/src/share/database/scripts/mysql/upgrade_029_to_030.sh.in @@ -26,10 +26,10 @@ else . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" fi -# Check version. -version=$(mysql_version "${@}") -if test "${version}" != "29.0"; then - printf 'This script upgrades 29.0 to 30.0. ' +# Check only major version to allow for intermediary backported schema changes. +version=$(mysql_version "${@}" | cut -d '.' -f 1) +if test "${version}" != '29'; then + printf 'This script upgrades 29.* to 30.0. ' printf 'Reported version is %s. Skipping upgrade.\n' "${version}" exit 0 fi diff --git a/src/share/database/scripts/pgsql/upgrade_028_to_029.sh.in b/src/share/database/scripts/pgsql/upgrade_028_to_029.sh.in index 3d6b741e80..6b5cdc68e1 100755 --- a/src/share/database/scripts/pgsql/upgrade_028_to_029.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_028_to_029.sh.in @@ -26,11 +26,11 @@ else . "@datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh" fi -VERSION=$(pgsql_version "$@") - -if [ "$VERSION" != "28.0" ]; then - printf 'This script upgrades 28.0 to 29.0. ' - printf 'Reported version is %s. Skipping upgrade.\n' "${VERSION}" +# Check only major version to allow for intermediary backported schema changes. +version=$(pgsql_version "${@}" | cut -d '.' -f 1) +if test "${version}" != '28'; then + printf 'This script upgrades 28.* to 29.0. ' + printf 'Reported version is %s. Skipping upgrade.\n' "${version}" exit 0 fi