1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for Bug#56817 - mysqlhotcopy tests fail when DBI and DBD-mysql perl modules are not found

Third updated patch - this version also includes copyright notice in added Perl script.
This patch implements a check for such modules at runtime. If modules are not found or unable to load, the test is skipped with 
the following message:
            
            [ skipped ]  Test needs Perl modules DBI and DBD::mysql
            
Checks are done via a helper Perl script which looks for the module in a runtime environment that is as similar to that of the 
mysqlhotcopy script as possible (thus not intended for Windows environments at this time).
The helper script tells mysql-test about the result by writing information to a temporary file that is later read by mysql-test.
See comments in added files (have_dbi_dbd-mysql.inc and checkDBI_DBD-mysql.pl) for details.
The patch also removes the mysqlhotcopy tests from the list of disabled tests.
This commit is contained in:
John H. Embretsen
2011-01-29 12:38:36 +01:00
parent d83706bc74
commit 26528be711
4 changed files with 189 additions and 2 deletions

View File

@ -4,12 +4,26 @@
--source include/not_windows.inc
--source include/not_embedded.inc
--source include/have_dbi_dbd-mysql.inc
if (!$MYSQLHOTCOPY)
{
# Fail the test if the mysqlhotcopy script is missing.
# If the tool's location changes, mysql-test-run.pl must be updated to
# reflect this (look for "MYSQLHOTCOPY").
die due to missing mysqlhotcopy tool;
}
# NOTE (johnemb, 2011-01-26):
# In this test mysqlhotcopy (a perl script) is executed as a standalone
# executable, i.e. not necessarily using the perl interpreter in PATH,
# because that is how the documentation demonstrates it.
#
# We include have_dbi_dbd-mysql.inc above so that the test will
# be skipped if Perl modules required by the mysqlhotcopy tool are not
# found when the script is run this way.
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--disable_warnings
DROP DATABASE IF EXISTS hotcopy_test;