From d997cb1c6c3fa9f66cab3e2ddf240e58555d066e Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Fri, 8 May 2026 22:35:41 +0200 Subject: [PATCH 1/7] Update default datadir for debian to be /var/lib/mariadb Match the existing datadir setting for Debian and Ubuntu, which was changed from /var/lib/mysql to /var/lib/mariadb in 1:11.8.6-5. --- cmake/install_layout.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 55e960a3c1572..ecd65b0419a4c 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -192,7 +192,7 @@ SET(INSTALL_MYSQLTESTDIR_DEB "share/mariadb/mariadb-test") SET(INSTALL_SQLBENCHDIR_DEB ".") SET(INSTALL_SUPPORTFILESDIR_DEB "share/mariadb") # -SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql") +SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mariadb") SET(INSTALL_RUNDATADIR_DEB "/run/mysqld") SET(INSTALL_UNIX_ADDRDIR_DEB "${INSTALL_RUNDATADIR_DEB}/mysqld.sock") From 1a60c28adc43d8b957bd8b5d15bd5d5ee9eab1c7 Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Tue, 24 Mar 2026 22:46:02 -0400 Subject: [PATCH 2/7] Determine whether to use /var/lib/mysql or /var/lib/mariadb on upgrade Check for MariaDB data in /var/lib/mariadb. If there is none, then check in /var/lib/mysql instead. If the data there belongs to MariaDB, then continue using it. If it belongs to MySQL, then ignore it and handle the folder setup as a new install. Likewise, stop using .flag files to determine version numbers. With the guarantee that all mariadb installs will have an upgrade info file in the data directory, it is no longer necessary to determine the version from the .flag file. Update detection logic to reflect this, and clear remaining flag file logic other than flag file removal. --- debian/mariadb-server.postinst | 17 ++++--- debian/mariadb-server.preinst | 91 ++++++++++++++-------------------- debian/rules | 2 - 3 files changed, 49 insertions(+), 61 deletions(-) diff --git a/debian/mariadb-server.postinst b/debian/mariadb-server.postinst index 3d7ff59bb4a1e..3ca02580a021b 100644 --- a/debian/mariadb-server.postinst +++ b/debian/mariadb-server.postinst @@ -61,11 +61,19 @@ case "$1" in fi mariadb_statedir=/usr/share/mariadb - mariadb_datadir=/var/lib/mysql + mariadb_datadir=/var/lib/mariadb + legacy_mariadb_datadir=/var/lib/mysql mariadb_logdir=/var/log/mysql mariadb_cfgdir=/etc/mysql mariadb_upgradedir=/var/lib/mysql-upgrade + # If new mariadb data directory does not exist, assume we are continuing + # to use the legacy directory. + if [ ! -d "$mariadb_datadir" ] + then + mariadb_datadir="$legacy_mariadb_datadir" + fi + # If the following symlink exists, it is a preserved copy the old data dir # created by the preinst script during a upgrade that would have otherwise # been replaced by an empty mysql dir. This should restore it. @@ -181,12 +189,8 @@ EOF # data directory and then somehow gets purged by the admin. db_set mariadb-server/postrm_remove_database false || true - # Clean up old flags before setting new one + # Clean up old debian version flag files rm -f $mariadb_datadir/debian-*.flag - # Flag data dir to avoid downgrades - # @TODO: Rewrite this to use the new upstream /var/lib/mysql_upgrade_info file - # instead of the legacy /var/lib/debian-XX.X.flag file - touch "$mariadb_datadir/debian-__MARIADB_MAJOR_VER__.flag" # initiate databases. Output is not allowed by debconf :-( # This will fail if we are upgrading an existing database; in this case @@ -198,6 +202,7 @@ EOF # working with libpam-tmpdir (by setting TMPDIR to empty value). set +e TMPDIR='' bash /usr/bin/mariadb-install-db \ + --datadir="$mariadb_datadir" \ --rpm --cross-bootstrap \ --user=mysql --disable-log-bin \ --skip-test-db 2>&1 | \ diff --git a/debian/mariadb-server.preinst b/debian/mariadb-server.preinst index 74503f227ffa2..216b98095449a 100644 --- a/debian/mariadb-server.preinst +++ b/debian/mariadb-server.preinst @@ -26,7 +26,8 @@ fi ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin -mariadb_datadir=/var/lib/mysql +mariadb_datadir=/var/lib/mariadb +legacy_mariadb_datadir=/var/lib/mysql mariadb_upgradedir=/var/lib/mysql-upgrade MARIADBD_USERS="root" @@ -67,46 +68,53 @@ stop_server() { fi } -################################ main() ########################## - -# @TODO: Rewrite this to use the new upstream /var/lib/mysql_upgrade_info file -# instead of the legacy /var/lib/debian-XX.X.flag file -this_version=__MARIADB_MAJOR_VER__ -max_upgradeable_version=5.7 +# Check if the version file mariadb_upgrade_info or mysql_upgrade_info is +# included with the provided data directory. If it is a MariaDB version, then +# return the major version number only (XX.XX). Return empty if this directory +# does not belong to MariaDB. +get_mariadb_upgrade_info_major_version() { + datadir="$1" -# Check if a flag file is found that indicates a previous MariaDB or MySQL -# version was installed. If multiple flags are found, check which one was -# the biggest version number. -for flag in "$mariadb_datadir"/debian-*.flag -do - - # The for loop leaves $flag as the query string if there are no results, - # so the check below is needed to stop further processing when there are - # no real results. - if [ "$flag" = "$mariadb_datadir/debian-*.flag" ] + # Check both mariadb_upgrade_info (higher priority) and mysql_upgrade_info. + if [ -f "$datadir/mysql_upgrade_info" ] then - break + read -r full_version < "$datadir/mysql_upgrade_info" fi - # The whole flag_version thing should be rewritten, so ignore minor Shellcheck - # nag for now - # shellcheck disable=SC2001 - flag_version=$(echo "$flag" | sed 's/.*debian-\([0-9\.]\+\).flag/\1/') - - # Initialize value if empty - if [ -z "$found_version" ] + if [ -f "$datadir/mariadb_upgrade_info" ] then - found_version=$flag_version + read -r full_version < "$datadir/mariadb_upgrade_info" fi - # Update value if now bigger then before - if dpkg --compare-versions "$flag_version" '>>' "$found_version" + # If version is not empty and contains 'MariaDB', get the version number. + if [ -n "$full_version" ] && echo "$full_version" | grep -q "MariaDB" then - found_version=$flag_version + # The major version number should the first two components of the version + # string (e.g. 11.8 from 11.8.6). + echo "$full_version" | awk -F'.' '{print $1"."$2}' fi +} -done +################################ main() ########################## + +this_version=__MARIADB_MAJOR_VER__ +max_upgradeable_version=5.7 +# Check for previous mariadb version in the new datadir. +found_version=$(get_mariadb_upgrade_info_major_version "$mariadb_datadir") + +# If nothing was found in the new datadir, check the legacy datadir to see if +# it has a MariaDB instance. +if [ -z "$found_version" ] && [ -d "$legacy_mariadb_datadir" ] +then + found_version=$(get_mariadb_upgrade_info_major_version "$legacy_mariadb_datadir") + + # If a mariadb version was found in the legacy datadir, continue using it. + if [ -n "$found_version" ] + then + mariadb_datadir="$legacy_mariadb_datadir" + fi +fi # If an upgrade is detected, proceed with it automatically without # requiring any user interaction. @@ -117,16 +125,6 @@ done # than $max_upgradeable_version. if [ -n "$found_version" ] then - - # MySQL 8.0 in Ubuntu has a bug in packaging and the file is name wrongly - # 'debian-5.7.flag', so in case '5.7' was encountered an extra check needs to - # be done to see is there is a file called undo_001, which is a sign of 8.0. - if [ "$found_version" == "5.7" ] && [ -f "$mariadb_datadir/undo_001" ] - then - # Seems to be a 8.0, flag has wrongly 5.7 (know bug) - found_version=8.0 - fi - echo "$mariadb_datadir: found previous version $found_version" if dpkg --compare-versions "$found_version" '>>' "$this_version" @@ -142,19 +140,6 @@ then fi -# If there is no debian-*.flag, and no version was detected, but a file that -# indicated MySQL 8.0 is found (undo_001 is created by default in MySQL 8.0+ -# installs), then that file is enough of additional indication to trigger the -# move of the data directory. -if [ -z "$found_version" ] && - [ -z "$(find $mariadb_datadir/debian-*.flag 2> /dev/null)" ] && - [ -f "$mariadb_datadir/undo_001" ] -then - echo "$mariadb_datadir: no server version flag found, assuming MySQL 8.0 data encountered" - downgrade_detected=true - found_version="previous" # Just use dummy name as we don't know real version -fi - # Don't abort dpkg if downgrade is detected (as was done previously). # Instead simply move the old datadir and create a new for this_version. if [ -n "$downgrade_detected" ] diff --git a/debian/rules b/debian/rules index bc0ea43a5a6e2..553db2167158d 100644 --- a/debian/rules +++ b/debian/rules @@ -79,8 +79,6 @@ endif # As packages does not have major version any more in package name there is no # way as it not set by dpkg to use this on postinst script. Use sed to # determine major version instead. - # @TODO: Rewrite this to use the new upstream /var/lib/mysql_upgrade_info file - # instead of the legacy /var/lib/debian-XX.X.flag file sed -i 's/__MARIADB_MAJOR_VER__/$(DEB_VERSION_MAJOR)/g' debian/mariadb-server.post* debian/mariadb-server.preinst # Don't build ColumnStore as part of the native build as it does not meet the From 6f4a5175c74b8240b05625e539c11870ccd09bde Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Tue, 24 Mar 2026 15:48:56 -0400 Subject: [PATCH 3/7] On purge, remove /var/lib/mariadb, and /var/lib/mysql if owned by mariadb MySQL log files and the mysql user will be removed if mariadb owns them. The log files should be split eventually though. --- debian/mariadb-server.postrm | 95 +++++++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 11 deletions(-) diff --git a/debian/mariadb-server.postrm b/debian/mariadb-server.postrm index 601fe87f7e9ad..4586aa587baaf 100644 --- a/debian/mariadb-server.postrm +++ b/debian/mariadb-server.postrm @@ -12,16 +12,68 @@ fi ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } +mariadb_datadir=/var/lib/mariadb +legacy_mariadb_datadir=/var/lib/mysql + +# Check if the version file mariadb_upgrade_info or mysql_upgrade_info is +# included with the provided data directory. If it is a MariaDB version, then +# return the major version number only (XX.XX). Return empty if this directory +# does not belong to MariaDB. +get_mariadb_upgrade_info_major_version() { + datadir="$1" + + # Check both mariadb_upgrade_info (higher priority) and mysql_upgrade_info. + if [ -f "$datadir/mysql_upgrade_info" ] + then + read -r full_version < "$datadir/mysql_upgrade_info" + fi + + if [ -f "$datadir/mariadb_upgrade_info" ] + then + read -r full_version < "$datadir/mariadb_upgrade_info" + fi + + # If version is not empty and contains 'MariaDB', get the version number. + if [ -n "$full_version" ] && echo "$full_version" | grep -q "MariaDB" + then + # The major version number should the first two components of the version + # string (e.g. 11.8 from 11.8.6). + echo "$full_version" | awk -F'.' '{print $1"."$2}' + fi +} + # # - Purge logs and data only if they are ours (#307473) # - Remove the mysql user only after all his owned files are purged. # - Cleanup the initscripts only if this was the last provider of them # -if [ "$1" = "purge" ] && [ -f "/var/lib/mysql/debian-__MARIADB_MAJOR_VER__.flag" ] +if [ "$1" = "purge" ] then - # we remove the mysql user only after all his owned files are purged - rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz} - rm -rf /var/log/mysql + # Mark data directories for removal if they match the current MariaDB version. + remove_mariadb_datadir="false" + remove_legacy_mariadb_datadir="false" + + mariadb_datadir_version=$(get_mariadb_upgrade_info_major_version "$mariadb_datadir") + + if [ "$mariadb_datadir_version" = "__MARIADB_MAJOR_VER__" ] + then + remove_mariadb_datadir="true" + fi + + legacy_mariadb_datadir_version=$(get_mariadb_upgrade_info_major_version "$legacy_mariadb_datadir") + + if [ "$legacy_mariadb_datadir_version" = "__MARIADB_MAJOR_VER__" ] + then + remove_legacy_mariadb_datadir="true" + fi + + # Remove logs in /var/log/mysql only if they are ours. + # These must be removed before mysql user is removed. + if [ "$remove_mariadb_datadir" = "true" ] || [ "$remove_legacy_mariadb_datadir" = "true" ] + then + rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz} + rm -rf /var/log/mysql + fi db_input high "mariadb-server/postrm_remove_databases" || true db_go || true @@ -30,26 +82,47 @@ then then # never remove the debian.cnf when the databases are still existing # else we ran into big trouble on the next install! - rm -f /etc/mysql/debian.cnf - # Remove all contents from /var/lib/mysql except if it's a + if [ "$remove_mariadb_datadir" = "true" ] || [ "$remove_legacy_mariadb_datadir" = "true" ] + then + rm -f /etc/mysql/debian.cnf + fi + # Remove all contents from /var/lib/mariadb except if it's a # directory with file system data. See #829491 for details and # #608938 for potential mysql-server leftovers which erroneously # had been renamed. # Attempt removal only if the directory hasn't already been removed # by dpkg to avoid failing on "No such file or directory" errors. - if [ -d /var/lib/mysql ] + if [ "$remove_mariadb_datadir" = "true" ] then - find /var/lib/mysql -mindepth 1 \ + find "$mariadb_datadir" -mindepth 1 \ + -not -path '*/lost+found/*' -not -name 'lost+found' \ + -not -path '*/lost@002bfound/*' -not -name 'lost@002bfound' \ + -delete + + # "|| true" still needed as rmdir still exits with non-zero if + # /var/lib/mariadb is a mount point + rmdir --ignore-fail-on-non-empty "$mariadb_datadir" || true + fi + # Remove all contents from /var/lib/mysql if it's owned by us, with same + # checks as /var/lib/mariadb. + if [ "$remove_legacy_mariadb_datadir" = "true" ] + then + find "$legacy_mariadb_datadir" -mindepth 1 \ -not -path '*/lost+found/*' -not -name 'lost+found' \ -not -path '*/lost@002bfound/*' -not -name 'lost@002bfound' \ -delete # "|| true" still needed as rmdir still exits with non-zero if # /var/lib/mysql is a mount point - rmdir --ignore-fail-on-non-empty /var/lib/mysql || true + rmdir --ignore-fail-on-non-empty "$legacy_mariadb_datadir" || true + fi + + # Remove /run/mysqld and mysql user if owned by us. + if [ "$remove_mariadb_datadir" = "true" ] || [ "$remove_legacy_mariadb_datadir" = "true" ] + then + rm -rf /run/mysqld # this directory is created by the init script, don't leave behind + userdel mysql || true fi - rm -rf /run/mysqld # this directory is created by the init script, don't leave behind - userdel mysql || true fi fi From 00a8c49a47648ac4d9086c738bfc850ecf64d45e Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Tue, 24 Mar 2026 11:38:12 -0400 Subject: [PATCH 4/7] Enforce default datadir in config as /var/lib/mariadb Update logic for handling the new /var/lib/mariadb datadir. For legacy installs, drop in an additional file, 99-legacy-datadir.cnf, that overrides the value back to /var/lib/mysql. Also remove this new file on purge. Mention the default change in 50-server.cnf. Finally, set the default datadir in mariadb-server mariadb.init to /var/lib/mariadb. --- debian/additions/mariadb.conf.d/50-server.cnf | 2 +- debian/mariadb-server.mariadb.init | 2 +- debian/mariadb-server.postinst | 13 ++++++++++++- debian/mariadb-server.postrm | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/additions/mariadb.conf.d/50-server.cnf b/debian/additions/mariadb.conf.d/50-server.cnf index 66301f78e636b..ab17ce3ecd330 100644 --- a/debian/additions/mariadb.conf.d/50-server.cnf +++ b/debian/additions/mariadb.conf.d/50-server.cnf @@ -15,7 +15,7 @@ #user = mysql pid-file = /run/mysqld/mysqld.pid basedir = /usr -#datadir = /var/lib/mysql +#datadir = /var/lib/mariadb # Starting with MariaDB 1:11.8.6-5, /var/lib/mariadb is used by default for better MySQL co-installability in Debian/Ubuntu. #tmpdir = /tmp # Broken reverse DNS slows down connections considerably and name resolve is diff --git a/debian/mariadb-server.mariadb.init b/debian/mariadb-server.mariadb.init index 765640327d19d..0d8d72dffce7f 100644 --- a/debian/mariadb-server.mariadb.init +++ b/debian/mariadb-server.mariadb.init @@ -96,7 +96,7 @@ sanity_checks() { # and this should fall back to a sane default value if [ -z "$datadir" ] then - datadir="/var/lib/mysql" + datadir="/var/lib/mariadb" fi # Verify the datadir location exists diff --git a/debian/mariadb-server.postinst b/debian/mariadb-server.postinst index 3ca02580a021b..a872d04ff0325 100644 --- a/debian/mariadb-server.postinst +++ b/debian/mariadb-server.postinst @@ -68,10 +68,21 @@ case "$1" in mariadb_upgradedir=/var/lib/mysql-upgrade # If new mariadb data directory does not exist, assume we are continuing - # to use the legacy directory. + # to use the legacy directory. Add a config entry to override datadir's + # value back to the original. if [ ! -d "$mariadb_datadir" ] then mariadb_datadir="$legacy_mariadb_datadir" + + mkdir -p /etc/mysql/mariadb.conf.d + + { + echo "# Override the data directory config to continue using the legacy directory." + echo "[mariadbd]" + echo "datadir = $legacy_mariadb_datadir" + } > /etc/mysql/mariadb.conf.d/99-legacy-datadir.cnf + + echo "Created /etc/mysql/mariadb.conf.d/99-legacy-datadir.cnf for MariaDB to continue using /var/lib/mysql on upgrade." fi # If the following symlink exists, it is a preserved copy the old data dir diff --git a/debian/mariadb-server.postrm b/debian/mariadb-server.postrm index 4586aa587baaf..9afb8428cdd23 100644 --- a/debian/mariadb-server.postrm +++ b/debian/mariadb-server.postrm @@ -49,6 +49,8 @@ get_mariadb_upgrade_info_major_version() { # if [ "$1" = "purge" ] then + rm -f /etc/mysql/mariadb.conf.d/99-legacy-datadir.cnf + # Mark data directories for removal if they match the current MariaDB version. remove_mariadb_datadir="false" remove_legacy_mariadb_datadir="false" From cfce3d01ce4cc4d98d139c0cf052654898850406 Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Tue, 24 Mar 2026 15:28:56 -0400 Subject: [PATCH 5/7] Update autopkgtest to match new data directory expectations --- debian/tests/smoke | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/tests/smoke b/debian/tests/smoke index 5c4facbb5018e..f78b3ca7be1e0 100644 --- a/debian/tests/smoke +++ b/debian/tests/smoke @@ -95,7 +95,7 @@ if [ "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" != 32 ] && then dpkg-query -W $plugin - LOG=/var/lib/mysql/#rocksdb/LOG + LOG=/var/lib/mariadb/#rocksdb/LOG # XXX: The server may only be started during the install of # mariadb-server, which happens before that of the plugin. [ -e $LOG ] || mariadb -e "INSTALL PLUGIN RocksDB SONAME 'ha_rocksdb';" From 3ed38e9ca875c0d37fc37fd95699db52e2aa79df Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Mon, 23 Feb 2026 20:14:44 -0500 Subject: [PATCH 6/7] Apport: Include /var/lib/mariadb data directory info in report --- debian/additions/source_mariadb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/additions/source_mariadb.py b/debian/additions/source_mariadb.py index a91695a704846..5a743fa9c6e9c 100644 --- a/debian/additions/source_mariadb.py +++ b/debian/additions/source_mariadb.py @@ -42,6 +42,10 @@ def add_info(report): _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f)) for f in os.listdir('/etc/mysql/mariadb.conf.d'): _add_my_conf_files(report, os.path.join('/etc/mysql/mariadb.conf.d', f)) + try: + report['MariaDBVarLibDirListing'] = str(os.listdir('/var/lib/mariadb')) + except OSError: + report['MariaDBVarLibDirListing'] = str(False) try: report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql')) except OSError: From 6367619e567b18c0f6e95910b8f6548b569ea22e Mon Sep 17 00:00:00 2001 From: Lena Voytek Date: Fri, 20 Mar 2026 21:52:08 -0400 Subject: [PATCH 7/7] Salsa CI: Confirm correct datadir is in use for each test and add list of /var/lib/mariadb files as test artifact --- debian/salsa-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index ba0355f84e2f6..ba1fc96326d38 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -200,10 +200,24 @@ blhc: - dpkg -l | grep -iE 'maria|mysql|galera' # library tests don't have the mariadb client nor server, so don't check them +.test-verify-using-legacy-data-directory: &test-verify-using-legacy-data-directory + # Verify that /var/lib/mysql is still in use as the data directory, and /var/lib/mariadb does not exist. + - | + test -d /var/lib/mysql || { echo "ERROR: Expected legacy data directory /var/lib/mysql does not exist"; exit 1; } + test -d /var/lib/mariadb && { echo "ERROR: Legacy install has new data directory /var/lib/mariadb that should not exist"; exit 1; } || true + mariadbd --help --verbose 2>/dev/null | grep --only-matching --perl-regex "datadir[ ]+\K(.*)" | grep /var/lib/mysql/ 1>/dev/null || { echo "ERROR: Legacy install is not using /var/lib/mysql as data directory"; exit 1; } + +.test-verify-using-new-data-directory: &test-verify-using-new-data-directory + # Verify that /var/lib/mariadb is in use as the data directory. + - | + test -d /var/lib/mariadb || { echo "ERROR: Expected new data directory /var/lib/mariadb does not exist"; exit 1; } + mariadbd --help --verbose 2>/dev/null | grep --only-matching --perl-regex "datadir[ ]+\K(.*)" | grep /var/lib/mariadb/ 1>/dev/null || { echo "ERROR: New install is not using /var/lib/mariadb as data directory"; exit 1; } + .test-verify-final: &test-verify-final | dpkg -l | grep -e "mariadb-server.*10\.11" mkdir -p debug # Ensure dir exists before using it find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" + find /var/lib/mariadb -ls > debug/var-lib-mariadb.list || true # Ignore errors about "no such file or directory" cp -ra /etc/mysql debug/etc-mysql mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version mariadb --table -e "SHOW DATABASES;" # List databases @@ -346,6 +360,7 @@ fresh install: - *test-prepare-container - *test-install-all - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-new-data-directory - *test-verify-final simple upgrade: @@ -356,6 +371,7 @@ simple upgrade: - apt-get install -qq --yes 'default-mysql*' ${BUILT_PACKAGES} - *test-full-upgrade - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final mariadb and Bookworm upgrade: @@ -374,6 +390,7 @@ mariadb and Bookworm upgrade: - service mariadb restart - *test-full-upgrade - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final mariadb-10.6 and Bookworm-20230208 upgrade: @@ -397,6 +414,7 @@ mariadb-10.6 and Bookworm-20230208 upgrade: - *test-full-upgrade - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - apt-get purge --yes mariadb*10.? + - *test-verify-using-legacy-data-directory - *test-verify-final mariadb-10.6 and Jammy upgrade: @@ -423,6 +441,7 @@ mariadb-10.6 and Jammy upgrade: # Due to usrmerge, full-upgrade from Jammy to Trixie or newer cannot work - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - apt-get purge --yes mariadb*10.? + - *test-verify-using-legacy-data-directory - *test-verify-final mariadb-10.5 and Bullseye upgrade: @@ -445,6 +464,7 @@ mariadb-10.5 and Bullseye upgrade: # Due to usrmerge, full-upgrade from Bullseye to Trixie or newer cannot work - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - apt-get purge --yes mariadb*10.? + - *test-verify-using-legacy-data-directory - *test-verify-final mariadb-10.3 and Buster upgrade: @@ -504,6 +524,7 @@ mariadb-10.3 and Focal upgrade: # Give the mariadb-upgrade plenty of time to complete, otherwise next commands # fail on non-existing mariadb.sys user - sleep 15 + - *test-verify-using-legacy-data-directory - *test-verify-final # Similar to the Cacti install test, check that MariaDB consumer Zoph upgrades @@ -524,6 +545,7 @@ default-mysql-server and Bookworm upgrade: - apt-get install -qq --yes default-mysql-server - *test-full-upgrade - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final # Similar to the Cacti install test, check that MariaDB consumer Zoph upgrades @@ -544,6 +566,7 @@ default-mysql-server and Bullseye upgrade: - apt-get install -qq --yes default-mysql-server # Due to usrmerge, full-upgrade from Bullseye to Trixie or newer cannot work - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final test basic features: @@ -552,6 +575,7 @@ test basic features: - *test-prepare-container - *test-install-all - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-new-data-directory - *test-verify-final - | # Print info about server @@ -730,6 +754,7 @@ mysql-8.0 in Sid upgrade: # the service name 'mariadb' instead, and the fallback is always used. - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - service mysql status || service mariadb status + - *test-verify-using-new-data-directory - *test-verify-final # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. @@ -759,6 +784,7 @@ mysql-8.0 in Ubuntu 23.10 upgrade: - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ # Remove everything MySQL except mysql-common which also MariaDB depends on - apt-get purge --yes mysql-s* mysql-cl* libmysql* + - *test-verify-using-new-data-directory - *test-verify-final # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. @@ -789,6 +815,7 @@ mysql-community-cluster-8.0 from MySQL.com with Bookworm upgrade: - systemctl status mysql || true - mysql -e 'SELECT VERSION()' || true - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - *test-verify-using-new-data-directory - *test-verify-final mariadb.org-10.11 upgrade: @@ -856,6 +883,7 @@ mariadb.org-10.7 upgrade: - *test-verify-initial - *test-install-all - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final mariadb.org-10.6 upgrade: @@ -871,6 +899,7 @@ mariadb.org-10.6 upgrade: - *test-verify-initial - *test-install-all - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final # archive.mariadb.org for Debian Sid latest is 10.5.13 @@ -885,6 +914,7 @@ mariadb.org-10.5 upgrade: - *test-verify-initial - *test-install-all - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-using-legacy-data-directory - *test-verify-final # archive.mariadb.org for Debian Sid latest is 10.4.17 @@ -1013,4 +1043,5 @@ percona-xtradb-5.7 with Bookworm upgrade: # Percona package owned /etc/init.d/mysql, so on removal and upgrade to MariaDB old service name can't be referenced anymore - service mariadb status - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server + - *test-verify-using-new-data-directory - *test-verify-final