Skip to content

Commit f595c02

Browse files
committed
Merge branch 'mysql-5.5-cluster-7.2' into mysql-5.6-cluster-7.3
2 parents 8328fd8 + 7a743bb commit f595c02

File tree

3 files changed

+88
-20
lines changed

3 files changed

+88
-20
lines changed

storage/ndb/compile-cluster

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/perl
22

3-
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
44
#
55
# This program is free software; you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ $| = 1;
3737
my $opt_debug;
3838
my $opt_build_type;
3939
my $opt_build = 1;
40+
my $opt_embedded = 0;
4041
my $opt_just_print;
4142
my $opt_vanilla;
4243
my $opt_autotest;
@@ -57,6 +58,7 @@ GetOptions(
5758
'autotest' => \$opt_autotest,
5859
'valgrind' => \$opt_valgrind,
5960
'distcheck' => \$opt_distcheck,
61+
'embedded' => sub { $opt_embedded = 1; },
6062

6163
# Special switch --parse-log=<file> which reads a log file (from build) and
6264
# parses it for warnings
@@ -121,6 +123,16 @@ if(defined $ENV{"CXXFLAGS"} and $ENV{"CXXFLAGS"} =~ "-fno-exceptions")
121123
print("compile-cluster: stripped off -fno-exceptions from CXXFLAGS='$ENV{CXXFLAGS}'\n");
122124
}
123125

126+
# If no libmysqld directory in source, there is support for build embedded server.
127+
if(! -d "$opt_srcdir/libmysqld")
128+
{
129+
if($opt_embedded)
130+
{
131+
die "Build with embedded server is not possible";
132+
}
133+
$opt_embedded = undef;
134+
}
135+
124136
#
125137
# Configure
126138
#
@@ -162,7 +174,11 @@ if(defined $ENV{"CXXFLAGS"} and $ENV{"CXXFLAGS"} =~ "-fno-exceptions")
162174
{
163175
print("compile-cluster: autotest build requested, extra everything\n");
164176
push(@args, "-DWITH_NDB_CCFLAGS='-DERROR_INSERT'");
165-
push(@args, "-DWITH_EMBEDDED_SERVER=1");
177+
}
178+
179+
if (defined $opt_embedded)
180+
{
181+
push(@args, "-DWITH_EMBEDDED_SERVER=$opt_embedded");
166182
}
167183

168184
if ($opt_valgrind)

storage/ndb/test/run-test/autotest-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
##############
2727

2828
save_args=$*
29-
VERSION="autotest-run.sh version 1.06"
29+
VERSION="autotest-run.sh version 1.07"
3030

3131
DATE=`date '+%Y-%m-%d'`
3232
if [ `uname -s` != "SunOS" ]

storage/ndb/test/run-test/files.cpp

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -182,6 +182,21 @@ setup_files(atrt_config& config, int setup, int sshx)
182182

183183
if (setup == 2 || config.m_generated)
184184
{
185+
bool use_mysqld = false;
186+
{
187+
BaseString tmp;
188+
tmp.assfmt("%s --help --verbose", g_mysqld_bin_path);
189+
FILE *f = popen(tmp.c_str(), "re");
190+
char buf[1000];
191+
while (NULL != fgets(buf, sizeof(buf), f))
192+
{
193+
if (strncmp(buf, "initialize-insecure ", 20) == 0)
194+
{
195+
use_mysqld = true;
196+
}
197+
}
198+
pclose(f);
199+
}
185200
/**
186201
* Do mysql_install_db
187202
*/
@@ -197,26 +212,63 @@ setup_files(atrt_config& config, int setup, int sshx)
197212
const char * val;
198213
require(proc.m_options.m_loaded.get("--datadir=", &val));
199214
BaseString tmp;
200-
tmp.assfmt("%s --defaults-file=%s/my.cnf --basedir=%s --datadir=%s > %s/mysql_install_db.log 2>&1",
201-
g_mysql_install_db_bin_path, g_basedir, g_prefix0, val, proc.m_proc.m_cwd.c_str());
202-
215+
if (use_mysqld)
216+
{
217+
tmp.assfmt("%s --defaults-file=%s/my.cnf --basedir=%s "
218+
"--datadir=%s --initialize-insecure "
219+
"> %s/mysqld-initialize.log 2>&1",
220+
g_mysqld_bin_path,
221+
g_basedir,
222+
g_prefix,
223+
val,
224+
proc.m_proc.m_cwd.c_str());
225+
}
226+
else
227+
{
228+
tmp.assfmt("%s --defaults-file=%s/my.cnf --basedir=%s "
229+
"--datadir=%s > %s/mysql_install_db.log 2>&1",
230+
g_mysql_install_db_bin_path,
231+
g_basedir,
232+
g_prefix0,
233+
val,
234+
proc.m_proc.m_cwd.c_str());
235+
}
203236
to_fwd_slashes(tmp);
204-
if (sh(tmp.c_str()) != 0)
205-
{
206-
g_logger.error("Failed to mysql_install_db for %s, cmd: '%s'",
207-
proc.m_proc.m_cwd.c_str(),
208-
tmp.c_str());
209-
}
210-
else
211-
{
212-
g_logger.info("mysql_install_db for %s",
213-
proc.m_proc.m_cwd.c_str());
214-
}
237+
if (sh(tmp.c_str()) != 0)
238+
{
239+
if (use_mysqld)
240+
{
241+
g_logger.error("Failed to mysqld --initialize-insecure for "
242+
"%s, cmd: '%s'",
243+
proc.m_proc.m_cwd.c_str(),
244+
tmp.c_str());
245+
}
246+
else
247+
{
248+
g_logger.error("Failed to mysql_install_db for %s, cmd: '%s'",
249+
proc.m_proc.m_cwd.c_str(),
250+
tmp.c_str());
251+
}
252+
}
253+
else
254+
{
255+
if (use_mysqld)
256+
{
257+
g_logger.info("mysqld --initialize-insecure for %s",
258+
proc.m_proc.m_cwd.c_str());
259+
}
260+
else
261+
{
262+
g_logger.info("mysql_install_db for %s",
263+
proc.m_proc.m_cwd.c_str());
264+
}
265+
}
215266
}
216267
#else
217268
{
218-
g_logger.info("not running mysql_install_db for %s",
219-
proc.m_proc.m_cwd.c_str());
269+
g_logger.info("not running mysqld --initialize-insecure nor "
270+
"mysql_install_db for %s",
271+
proc.m_proc.m_cwd.c_str());
220272
}
221273
#endif
222274
}

0 commit comments

Comments
 (0)