From cf01bfe811dcdad121ed04922adf231e2c85520d Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 25 Feb 2025 15:43:20 +0200 Subject: [PATCH] Extended mariadb-test-run to define MARIADB_TOPDIR and MARIADB_DATADIR This is for preparing MariaDB for catalogs. mtr tests should in the future use MARIADB_TOPDIR or MARIADB_DATADIR instead of '@@datadir'. This is especially true for replication tests that access binlog files. MARIADB_TOPDIR is the top directory where binary log and engine log files resides. MARIADB_DATADIR is the directory where the database/schema directories resides. MARIADB_TOPDIR is not depending on catalogs. When catalogs is used MARIADB_DATADIR will point to the directory of the current catalog. If catalogs is not used then MARIAD_DATADIR=MARIADB_TOPDIR. --- mysql-test/mariadb-test-run.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index f72ff055a33..57fb5580139 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -268,6 +268,9 @@ our $opt_force= 0; our $opt_skip_not_found= 0; our $opt_mem= $ENV{'MTR_MEM'}; our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'}; +our $opt_catalogs= 0; +our $opt_catalog_name=""; +our $catalog_name="def"; our $opt_gcov; our $opt_gprof; @@ -3945,6 +3948,23 @@ sub run_testcase ($$) { } } + # Set up things for catalogs + # The values of MARIADB_TOPDIR and MARIAD_DATADIR should + # be taken from the values used by the default (first) + # connection that is used by mariadb-test. + my ($mysqld, @servers); + @servers= all_servers(); + $mysqld= $servers[0]; + $ENV{'MARIADB_TOPDIR'}= $mysqld->value('datadir'); + if (!$opt_catalogs) + { + $ENV{'MARIADB_DATADIR'}= $mysqld->value('datadir'); + } + else + { + $ENV{'MARIADB_DATADIR'}= $mysqld->value('datadir') . "/" . $catalog_name; + } + # Write start of testcase to log mark_log($path_current_testlog, $tinfo);