Import alt-mysql plugin

This commit is contained in:
Marek Miklewicz
2026-07-04 15:48:19 +02:00
commit d71fcf9ace
101 changed files with 18635 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
set -euo pipefail
PLUGIN_DIR="$(cd "$(dirname "$0")/.." && pwd)"
SCRIPT="$PLUGIN_DIR/scripts/setup/mysql_upgrade.sh"
fail() {
echo "FAIL: $*" >&2
exit 1
}
grep -Fq "rollback_upgrade()" "$SCRIPT" \
|| fail "mysql_upgrade.sh does not define rollback_upgrade"
grep -Fq "UPGRADE_COMMITTED=1" "$SCRIPT" \
|| fail "mysql_upgrade.sh does not mark successful upgrades as committed"
grep -Fq 'trap '\''code=$?; rollback_upgrade "$code"'\'' EXIT' "$SCRIPT" \
|| fail "mysql_upgrade.sh does not run rollback on failed exit"
grep -Fq "RESTORED_PREVIOUS_DIR" "$SCRIPT" \
|| fail "mysql_upgrade.sh does not restore previous binary directory"
grep -Fq "RESTORED_INSTANCE_CNF" "$SCRIPT" \
|| fail "mysql_upgrade.sh does not restore previous instance config"
echo "mysql_upgrade_rollback_test: OK"