1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Monty
2025-02-25 15:43:20 +02:00
parent 7b59a4dbc2
commit cf01bfe811

View File

@@ -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);