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 facebook#885.

Test Plan: mtr

Reviewers: mung, rtm

Reviewed By: mung

Subscribers: butterflybot, aubertg, webscalesql-eng@fb.com

Differential Revision: https://phabricator.intern.facebook.com/D10407251

Tags: perl, aubertg

Signature: 10407251:1539714602:3fcc6db698efb7bc8e895daa5661edab30edf0f9
  • Loading branch information
trosten authored and Herman Lee committed Oct 16, 2018
1 parent 10df167 commit 4848c36
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 4848c36

Please sign in to comment.