Skip to content

Commit 8d24f4e

Browse files
committed
MDEV-19821 "perl;" snippet must run the same perl executable that runs mtr.
1 parent c631bd7 commit 8d24f4e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

client/mysqltest.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4643,8 +4643,16 @@ void do_perl(struct st_command *command)
46434643

46444644
str_to_file(temp_file_path, ds_script.str, ds_script.length);
46454645

4646+
/* Use the same perl executable as the one that runs mysql-test-run.pl */
4647+
const char *mtr_perl=getenv("MTR_PERL");
4648+
if (!mtr_perl)
4649+
mtr_perl="perl";
4650+
46464651
/* Format the "perl <filename>" command */
4647-
my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);
4652+
if (strchr(mtr_perl, ' '))
4653+
my_snprintf(buf, sizeof(buf), "\"%s\" %s", mtr_perl, temp_file_path);
4654+
else
4655+
my_snprintf(buf, sizeof(buf), "%s %s", mtr_perl, temp_file_path);
46484656

46494657
if (!(res_file= my_popen(buf, "r")))
46504658
{

mysql-test/mysql-test-run.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ ($)
366366

367367

368368
sub main {
369+
$ENV{MTR_PERL}=$^X;
370+
369371
# Default, verbosity on
370372
report_option('verbose', 0);
371373

0 commit comments

Comments
 (0)