Skip to content

Commit

Permalink
Bug#25604587 BACKPORT BUG#24947217 TO 5.6 AND 5.7
Browse files Browse the repository at this point in the history
Summary:
Change is needed in MySQL 5.6 and 5.7 as well.

Should resolve #885.

Reviewed By: lth

Differential Revision: D10407251

fbshipit-source-id: 4848c36
  • Loading branch information
trosten authored and facebook-github-bot committed Oct 16, 2018
1 parent 9224784 commit 692004f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -36,6 +36,7 @@
#include <my_dir.h>
#include <hash.h>
#include <stdarg.h>
#include <string>
#include <violite.h>
#include "my_regex.h" /* Our own version of regex */
#ifdef HAVE_SYS_WAIT_H
Expand All @@ -56,6 +57,7 @@

using std::min;
using std::max;
using std::string;

#ifdef __WIN__
#include <crtdbg.h>
Expand Down Expand Up @@ -4800,7 +4802,11 @@ void do_perl(struct st_command *command)
die("Failed to create temporary file for perl command");
my_close(fd, MYF(0));

str_to_file(temp_file_path, ds_script.str, ds_script.length);
/* Compatibility for Perl 5.24 and newer. */
string script = "push @INC, \".\";\n";
script.append(ds_script.str, ds_script.length);

str_to_file(temp_file_path, &script[0], script.size());

/* Format the "perl <filename>" command */
my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);
Expand Down
4 changes: 3 additions & 1 deletion mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-

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

push @INC, ".";

require "lib/mtr_process.pl";
require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
Expand Down

0 comments on commit 692004f

Please sign in to comment.