diff options
author | John H. Embretsen <john.embretsen@oracle.com> | 2011-01-29 12:38:36 +0100 |
---|---|---|
committer | John H. Embretsen <john.embretsen@oracle.com> | 2011-01-29 12:38:36 +0100 |
commit | 26528be7112fadd5f23994f96174d3c45bd741b5 (patch) | |
tree | 56d651e7859dda13fef1541a41d00a960225d582 /mysql-test/include/mysqlhotcopy.inc | |
parent | d83706bc74a5a53e9f4472e6846a73aa0d1df2d1 (diff) | |
download | mariadb-git-26528be7112fadd5f23994f96174d3c45bd741b5.tar.gz |
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.
Diffstat (limited to 'mysql-test/include/mysqlhotcopy.inc')
-rw-r--r-- | mysql-test/include/mysqlhotcopy.inc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc index 91e0eff1e0f..110b0769ae1 100644 --- a/mysql-test/include/mysqlhotcopy.inc +++ b/mysql-test/include/mysqlhotcopy.inc @@ -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; |