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
Change is needed in MySQL 5.6 and 5.7 as well.

In the 5.5 backport, replace std::string with a DYNAMIC_STRING.

(cherry picked from commit 6f8e0f1)
  • Loading branch information
trosten authored and laurynas-biveinis committed May 4, 2017
1 parent d4585f0 commit fc6e43c
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 @@ -4159,7 +4159,13 @@ 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. */
static DYNAMIC_STRING script;
init_dynamic_string(&script, "push @INC, \".\";\n", 1024, 1024);
dynstr_append_mem(&script, ds_script.str, ds_script.length);

str_to_file(temp_file_path, script.str, script.length);
dynstr_free(&script);

/* 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, 2015, 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::Select;
use Subunit;

push @INC, ".";

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

0 comments on commit fc6e43c

Please sign in to comment.