summaryrefslogtreecommitdiff
path: root/client/mysqltest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r--client/mysqltest.cc10
1 files changed, 9 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")))
{