未验证 提交 4ff00ea4 编写于 作者: H hustjieke 提交者: GitHub

fix(mtr): backport bug for run mtr failed under low version perl (#73) (#74)

[summary]
Change is needed in MySQL 5.6 and 5.7 as well.
Signed-off-by: Nhustjieke <gaoriyao1@gmail.com>
上级 d3913129
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2022, 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
......@@ -35,6 +35,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
......@@ -52,6 +53,7 @@
using std::min;
using std::max;
using std::string;
#ifdef __WIN__
#include <crtdbg.h>
......@@ -4237,7 +4239,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);
......
#!/usr/bin/perl
# -*- cperl -*-
# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2022, 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
......@@ -100,6 +100,8 @@ use mtr_results;
use IO::Socket::INET;
use IO::Select;
push @INC, ".";
require "lib/mtr_process.pl";
require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册