summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-06-21 12:02:40 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2019-06-21 12:02:40 +0200
commit8d24f4e35d466cc70322b0593ba02d850a394826 (patch)
tree81608c543bfa6e4dfa74f9ca515685a12460973d
parentc631bd7f1099b7f60b319c3c6093869116bed2d2 (diff)
downloadmariadb-git-8d24f4e35d466cc70322b0593ba02d850a394826.tar.gz
MDEV-19821 "perl;" snippet must run the same perl executable that runs mtr.
-rw-r--r--client/mysqltest.cc10
-rwxr-xr-xmysql-test/mysql-test-run.pl2
2 files changed, 11 insertions, 1 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 16c0f684c0b..7c46bd194c5 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -4643,8 +4643,16 @@ void do_perl(struct st_command *command)
str_to_file(temp_file_path, ds_script.str, ds_script.length);
+ /* Use the same perl executable as the one that runs mysql-test-run.pl */
+ const char *mtr_perl=getenv("MTR_PERL");
+ if (!mtr_perl)
+ mtr_perl="perl";
+
/* Format the "perl <filename>" command */
- my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);
+ if (strchr(mtr_perl, ' '))
+ my_snprintf(buf, sizeof(buf), "\"%s\" %s", mtr_perl, temp_file_path);
+ else
+ my_snprintf(buf, sizeof(buf), "%s %s", mtr_perl, temp_file_path);
if (!(res_file= my_popen(buf, "r")))
{
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 9f1414d8d8b..68bd03ef5ca 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -366,6 +366,8 @@ main();
sub main {
+ $ENV{MTR_PERL}=$^X;
+
# Default, verbosity on
report_option('verbose', 0);