Skip to content

Commit 6f8e0f1

Browse files
committed
Bug#25604587 BACKPORT BUG#24947217 TO 5.6 AND 5.7
Change is needed in MySQL 5.6 and 5.7 as well.
1 parent 5c06bfa commit 6f8e0f1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

client/mysqltest.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@
3535
#include <my_dir.h>
3636
#include <hash.h>
3737
#include <stdarg.h>
38+
#include <string>
3839
#include <violite.h>
3940
#include "my_regex.h" /* Our own version of regex */
4041
#ifdef HAVE_SYS_WAIT_H
@@ -52,6 +53,7 @@
5253

5354
using std::min;
5455
using std::max;
56+
using std::string;
5557

5658
#ifdef __WIN__
5759
#include <crtdbg.h>
@@ -4237,7 +4239,11 @@ void do_perl(struct st_command *command)
42374239
die("Failed to create temporary file for perl command");
42384240
my_close(fd, MYF(0));
42394241

4240-
str_to_file(temp_file_path, ds_script.str, ds_script.length);
4242+
/* Compatibility for Perl 5.24 and newer. */
4243+
string script = "push @INC, \".\";\n";
4244+
script.append(ds_script.str, ds_script.length);
4245+
4246+
str_to_file(temp_file_path, &script[0], script.size());
42414247

42424248
/* Format the "perl <filename>" command */
42434249
my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);

mysql-test/mysql-test-run.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl
22
# -*- cperl -*-
33

4-
# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
4+
# Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -100,6 +100,8 @@ BEGIN
100100
use IO::Socket::INET;
101101
use IO::Select;
102102

103+
push @INC, ".";
104+
103105
require "lib/mtr_process.pl";
104106
require "lib/mtr_io.pl";
105107
require "lib/mtr_gcov.pl";

0 commit comments

Comments
 (0)