Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
58e33676
Commit
58e33676
authored
Feb 04, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1
parents
40376788
9eacf61d
Changes
41
Show whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
960 additions
and
634 deletions
+960
-634
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
acinclude.m4
acinclude.m4
+6
-1
include/my_global.h
include/my_global.h
+6
-0
mysql-test/lib/mtr_io.pl
mysql-test/lib/mtr_io.pl
+3
-0
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_process.pl
+465
-207
mysql-test/lib/mtr_report.pl
mysql-test/lib/mtr_report.pl
+21
-4
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+178
-279
mysql-test/r/update.result
mysql-test/r/update.result
+7
-0
mysql-test/t/update.test
mysql-test/t/update.test
+9
-0
ndb/include/portlib/NdbThread.h
ndb/include/portlib/NdbThread.h
+1
-1
ndb/src/common/portlib/NdbPortLibTest.cpp
ndb/src/common/portlib/NdbPortLibTest.cpp
+4
-12
ndb/src/common/portlib/NdbThread.c
ndb/src/common/portlib/NdbThread.c
+24
-16
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+1
-4
ndb/src/common/util/NdbSqlUtil.cpp
ndb/src/common/util/NdbSqlUtil.cpp
+28
-0
ndb/src/common/util/SocketServer.cpp
ndb/src/common/util/SocketServer.cpp
+0
-9
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+0
-3
ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp
...rnel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp
+0
-4
ndb/src/kernel/vm/FastScheduler.cpp
ndb/src/kernel/vm/FastScheduler.cpp
+22
-11
ndb/src/kernel/vm/ThreadConfig.cpp
ndb/src/kernel/vm/ThreadConfig.cpp
+0
-3
ndb/src/kernel/vm/WatchDog.cpp
ndb/src/kernel/vm/WatchDog.cpp
+0
-3
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+1
-5
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+14
-0
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+0
-10
ndb/src/ndbapi/ClusterMgr.cpp
ndb/src/ndbapi/ClusterMgr.cpp
+0
-4
ndb/src/ndbapi/TransporterFacade.cpp
ndb/src/ndbapi/TransporterFacade.cpp
+2
-8
ndb/src/ndbapi/ndb_cluster_connection.cpp
ndb/src/ndbapi/ndb_cluster_connection.cpp
+0
-3
ndb/test/ndbapi/benchronja.cpp
ndb/test/ndbapi/benchronja.cpp
+1
-3
ndb/test/ndbapi/flexAsynch.cpp
ndb/test/ndbapi/flexAsynch.cpp
+1
-2
ndb/test/ndbapi/flexBench.cpp
ndb/test/ndbapi/flexBench.cpp
+2
-3
ndb/test/ndbapi/flexHammer.cpp
ndb/test/ndbapi/flexHammer.cpp
+1
-4
ndb/test/ndbapi/flexScan.cpp
ndb/test/ndbapi/flexScan.cpp
+1
-2
ndb/test/ndbapi/flexTT.cpp
ndb/test/ndbapi/flexTT.cpp
+1
-2
ndb/test/ndbapi/flexTimedAsynch.cpp
ndb/test/ndbapi/flexTimedAsynch.cpp
+1
-2
ndb/test/ndbapi/flex_bench_mysql.cpp
ndb/test/ndbapi/flex_bench_mysql.cpp
+14
-15
ndb/test/ndbapi/mainAsyncGenerator.cpp
ndb/test/ndbapi/mainAsyncGenerator.cpp
+0
-2
ndb/test/src/NDBT_Test.cpp
ndb/test/src/NDBT_Test.cpp
+0
-1
ndb/test/tools/transproxy.cpp
ndb/test/tools/transproxy.cpp
+0
-2
sql/item_func.cc
sql/item_func.cc
+2
-6
support-files/Makefile.am
support-files/Makefile.am
+6
-3
support-files/mysql.spec.sh
support-files/mysql.spec.sh
+94
-0
support-files/ndb-config-2-node.ini.sh
support-files/ndb-config-2-node.ini.sh
+43
-0
No files found.
BitKeeper/etc/logging_ok
View file @
58e33676
...
@@ -119,6 +119,7 @@ miguel@light.
...
@@ -119,6 +119,7 @@ miguel@light.
miguel@light.local
miguel@light.local
miguel@sartre.local
miguel@sartre.local
mikael@mc04.(none)
mikael@mc04.(none)
mikael@orca.ndb.mysql.com
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
mikron@mikael-ronstr-ms-dator.local
mikron@mikael-ronstr-ms-dator.local
mleich@mysql.com
mleich@mysql.com
...
...
acinclude.m4
View file @
58e33676
...
@@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
...
@@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
--without-ndb-debug Disable special ndb debug features],
--without-ndb-debug Disable special ndb debug features],
[ndb_debug="$withval"],
[ndb_debug="$withval"],
[ndb_debug="default"])
[ndb_debug="default"])
AC_ARG_WITH([ndb-ccflags],
[
--with-ndb-ccflags Extra CC options for ndb compile],
[ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"],
[ndb_cxxflags_fix=$ndb_cxxflags_fix])
AC_MSG_CHECKING([for NDB Cluster options])
AC_MSG_CHECKING([for NDB Cluster options])
AC_MSG_RESULT([])
AC_MSG_RESULT([])
...
...
include/my_global.h
View file @
58e33676
...
@@ -135,7 +135,13 @@
...
@@ -135,7 +135,13 @@
#ifdef HAVE_UNIXWARE7_THREADS
#ifdef HAVE_UNIXWARE7_THREADS
#include <thread.h>
#include <thread.h>
#else
#else
#if defined(HPUX10) || defined(HPUX11)
C_MODE_START
/* HPUX needs this, signal.h bug */
#include <pthread.h>
C_MODE_END
#else
#include <pthread.h>
/* AIX must have this included first */
#include <pthread.h>
/* AIX must have this included first */
#endif
#endif
/* HAVE_UNIXWARE7_THREADS */
#endif
/* HAVE_UNIXWARE7_THREADS */
#endif
/* HAVE_mit_thread */
#endif
/* HAVE_mit_thread */
#if !defined(SCO) && !defined(_REENTRANT)
#if !defined(SCO) && !defined(_REENTRANT)
...
...
mysql-test/lib/mtr_io.pl
View file @
58e33676
...
@@ -8,6 +8,7 @@ use strict;
...
@@ -8,6 +8,7 @@ use strict;
sub
mtr_get_pid_from_file
($);
sub
mtr_get_pid_from_file
($);
sub
mtr_get_opts_from_file
($);
sub
mtr_get_opts_from_file
($);
sub
mtr_fromfile
($);
sub
mtr_tofile
($@);
sub
mtr_tofile
($@);
sub
mtr_tonewfile
($@);
sub
mtr_tonewfile
($@);
...
@@ -107,6 +108,8 @@ sub mtr_fromfile ($) {
...
@@ -107,6 +108,8 @@ sub mtr_fromfile ($) {
open
(
FILE
,"
<
",
$file
)
or
mtr_error
("
can't open file
\"
$file
\"
: $!
");
open
(
FILE
,"
<
",
$file
)
or
mtr_error
("
can't open file
\"
$file
\"
: $!
");
my
$text
=
join
('',
<
FILE
>
);
my
$text
=
join
('',
<
FILE
>
);
close
FILE
;
close
FILE
;
$text
=~
s/^\s+//
;
# Remove starting space, incl newlines
$text
=~
s/\s+$//
;
# Remove ending space, incl newlines
return
$text
;
return
$text
;
}
}
...
...
mysql-test/lib/mtr_process.pl
View file @
58e33676
...
@@ -5,14 +5,19 @@
...
@@ -5,14 +5,19 @@
# same name.
# same name.
#use Carp qw(cluck);
#use Carp qw(cluck);
use
Socket
;
use
Errno
;
use
strict
;
use
strict
;
use
POSIX
"
:sys_wait_h
";
#use POSIX ":sys_wait_h";
use
POSIX
'
WNOHANG
';
sub
mtr_run
($$$$$$);
sub
mtr_run
($$$$$$);
sub
mtr_spawn
($$$$$$);
sub
mtr_spawn
($$$$$$);
sub
mtr_stop_mysqld_servers
($
$
);
sub
mtr_stop_mysqld_servers
($);
sub
mtr_kill_leftovers
();
sub
mtr_kill_leftovers
();
sub
mtr_record_dead_children
();
sub
sleep_until_file_created
($$$);
# static in C
# static in C
sub
spawn_impl
($$$$$$$);
sub
spawn_impl
($$$$$$$);
...
@@ -34,7 +39,18 @@ sub mtr_run ($$$$$$) {
...
@@ -34,7 +39,18 @@ sub mtr_run ($$$$$$) {
my
$error
=
shift
;
my
$error
=
shift
;
my
$pid_file
=
shift
;
my
$pid_file
=
shift
;
return
spawn_impl
(
$path
,
$arg_list_t
,
1
,
$input
,
$output
,
$error
,
$pid_file
);
return
spawn_impl
(
$path
,
$arg_list_t
,'
run
',
$input
,
$output
,
$error
,
$pid_file
);
}
sub
mtr_run_test
($$$$$$)
{
my
$path
=
shift
;
my
$arg_list_t
=
shift
;
my
$input
=
shift
;
my
$output
=
shift
;
my
$error
=
shift
;
my
$pid_file
=
shift
;
return
spawn_impl
(
$path
,
$arg_list_t
,'
test
',
$input
,
$output
,
$error
,
$pid_file
);
}
}
sub
mtr_spawn
($$$$$$)
{
sub
mtr_spawn
($$$$$$)
{
...
@@ -45,7 +61,7 @@ sub mtr_spawn ($$$$$$) {
...
@@ -45,7 +61,7 @@ sub mtr_spawn ($$$$$$) {
my
$error
=
shift
;
my
$error
=
shift
;
my
$pid_file
=
shift
;
my
$pid_file
=
shift
;
return
spawn_impl
(
$path
,
$arg_list_t
,
0
,
$input
,
$output
,
$error
,
$pid_file
);
return
spawn_impl
(
$path
,
$arg_list_t
,
'
spawn
'
,
$input
,
$output
,
$error
,
$pid_file
);
}
}
...
@@ -58,7 +74,7 @@ sub mtr_spawn ($$$$$$) {
...
@@ -58,7 +74,7 @@ sub mtr_spawn ($$$$$$) {
sub
spawn_impl
($$$$$$$)
{
sub
spawn_impl
($$$$$$$)
{
my
$path
=
shift
;
my
$path
=
shift
;
my
$arg_list_t
=
shift
;
my
$arg_list_t
=
shift
;
my
$
join
=
shift
;
my
$
mode
=
shift
;
my
$input
=
shift
;
my
$input
=
shift
;
my
$output
=
shift
;
my
$output
=
shift
;
my
$error
=
shift
;
my
$error
=
shift
;
...
@@ -71,55 +87,31 @@ sub spawn_impl ($$$$$$$) {
...
@@ -71,55 +87,31 @@ sub spawn_impl ($$$$$$$) {
print
STDERR
"
####
",
"
STDIN
$input
\n
"
if
$input
;
print
STDERR
"
####
",
"
STDIN
$input
\n
"
if
$input
;
print
STDERR
"
####
",
"
STDOUT
$output
\n
"
if
$output
;
print
STDERR
"
####
",
"
STDOUT
$output
\n
"
if
$output
;
print
STDERR
"
####
",
"
STDERR
$error
\n
"
if
$error
;
print
STDERR
"
####
",
"
STDERR
$error
\n
"
if
$error
;
if
(
$join
)
print
STDERR
"
####
",
"
$mode
:
$path
",
join
("
",
@$arg_list_t
),
"
\n
";
{
print
STDERR
"
####
",
"
RUN
";
}
else
{
print
STDERR
"
####
",
"
SPAWN
";
}
print
STDERR
"
$path
",
join
("
",
@$arg_list_t
),
"
\n
";
print
STDERR
"
####
",
"
-
"
x
78
,
"
\n
";
print
STDERR
"
####
",
"
-
"
x
78
,
"
\n
";
}
}
my
$pid
=
fork
();
FORK:
if
(
!
defined
$pid
)
{
mtr_error
("
$path
(
$pid
) can't be forked
");
}
if
(
$pid
)
{
# Parent, i.e. the main script
if
(
$join
)
{
{
# We run a command and wait for the result
my
$pid
=
fork
();
# FIXME this need to be improved
my
$res
=
waitpid
(
$pid
,
0
);
if
(
$res
==
-
1
)
if
(
!
defined
$pid
)
{
{
mtr_error
("
$path
(
$pid
) got lost somehow
");
if
(
$!
==
$!
{
EAGAIN
}
)
# See "perldoc Errno"
}
my
$exit_value
=
$?
>>
8
;
my
$signal_num
=
$?
&
127
;
my
$dumped_core
=
$?
&
128
;
if
(
$signal_num
)
{
{
mtr_error
("
$path
(
$pid
) got signal
$signal_num
");
mtr_debug
("
Got EAGAIN from fork(), sleep 1 second and redo
");
sleep
(
1
);
redo
FORK
;
}
}
if
(
$dumped_core
)
else
{
{
mtr_error
("
$path
(
$pid
)
dumped core
");
mtr_error
("
$path
(
$pid
)
can't be forked
");
}
}
return
$exit_value
;
}
}
else
if
(
$pid
)
{
{
# We spawned a process we don't wait for
spawn_parent_impl
(
$pid
,
$mode
,
$path
);
return
$pid
;
}
}
}
else
else
{
{
...
@@ -164,14 +156,134 @@ sub spawn_impl ($$$$$$$) {
...
@@ -164,14 +156,134 @@ sub spawn_impl ($$$$$$$) {
}
}
exec
(
$path
,
@$arg_list_t
);
exec
(
$path
,
@$arg_list_t
);
}
}
}
}
sub
spawn_parent_impl
{
my
$pid
=
shift
;
my
$mode
=
shift
;
my
$path
=
shift
;
if
(
$mode
eq
'
run
'
or
$mode
eq
'
test
'
)
{
my
$exit_value
=
-
1
;
my
$signal_num
=
0
;
my
$dumped_core
=
0
;
if
(
$mode
eq
'
run
'
)
{
# Simple run of command, we wait for it to return
my
$ret_pid
=
waitpid
(
$pid
,
0
);
if
(
$ret_pid
<=
0
)
{
mtr_error
("
$path
(
$pid
) got lost somehow
");
}
$exit_value
=
$?
>>
8
;
$signal_num
=
$?
&
127
;
$dumped_core
=
$?
&
128
;
return
$exit_value
;
}
else
{
# We run mysqltest and wait for it to return. But we try to
# catch dying mysqld processes as well.
#
# We do blocking waitpid() until we get the return from the
# "mysqltest" call. But if a mysqld process dies that we
# started, we take this as an error, and kill mysqltest.
#
# FIXME is this as it should be? Can't mysqld terminate
# normally from running a test case?
my
$ret_pid
;
# What waitpid() returns
while
(
(
$ret_pid
=
waitpid
(
-
1
,
0
))
!=
-
1
)
{
# Someone terminated, don't know who. Collect
# status info first before $? is lost,
# but not $exit_value, this is flagged from
#
if
(
$ret_pid
==
$pid
)
{
# We got termination of mysqltest, we are done
$exit_value
=
$?
>>
8
;
$signal_num
=
$?
&
127
;
$dumped_core
=
$?
&
128
;
last
;
}
# If one of the mysqld processes died, we want to
# mark this, and kill the mysqltest process.
foreach
my
$idx
(
0
..
1
)
{
if
(
$::master
->
[
$idx
]
->
{'
pid
'}
eq
$ret_pid
)
{
mtr_debug
("
child
$ret_pid
was master[
$idx
],
"
.
"
exit during mysqltest run
");
$::master
->
[
$idx
]
->
{'
pid
'}
=
0
;
last
;
}
}
foreach
my
$idx
(
0
..
2
)
{
if
(
$::slave
->
[
$idx
]
->
{'
pid
'}
eq
$ret_pid
)
{
mtr_debug
("
child
$ret_pid
was slave[
$idx
],
"
.
"
exit during mysqltest run
");
$::slave
->
[
$idx
]
->
{'
pid
'}
=
0
;
last
;
}
}
mtr_debug
("
waitpid() catched exit of unknown child
$ret_pid
,
"
.
"
exit during mysqltest run
");
}
if
(
$ret_pid
!=
$pid
)
{
# We terminated the waiting because a "mysqld" process died.
# Kill the mysqltest process.
kill
(
9
,
$pid
);
$ret_pid
=
waitpid
(
$pid
,
0
);
if
(
$ret_pid
==
-
1
)
{
mtr_error
("
$path
(
$pid
) got lost somehow
");
}
}
return
$exit_value
;
}
}
else
{
# We spawned a process we don't wait for
return
$pid
;
}
}
}
##############################################################################
##############################################################################
#
#
# Kill processes left from previous runs
# Kill processes left from previous runs
#
#
##############################################################################
##############################################################################
# We just "ping" on the ports, and if we can't do a socket connect
# we assume the server is dead. So we don't *really* know a server
# is dead, we just hope that it after letting the listen port go,
# it is dead enough for us to start a new server.
sub
mtr_kill_leftovers
()
{
sub
mtr_kill_leftovers
()
{
# First, kill all masters and slaves that would conflict with
# First, kill all masters and slaves that would conflict with
...
@@ -199,10 +311,23 @@ sub mtr_kill_leftovers () {
...
@@ -199,10 +311,23 @@ sub mtr_kill_leftovers () {
});
});
}
}
mtr_stop_mysqld_servers
(
\
@args
,
1
);
mtr_mysqladmin_shutdown
(
\
@args
);
# We now have tried to terminate nice. We have waited for the listen
# port to be free, but can't really tell if the mysqld process died
# or not. We now try to find the process PID from the PID file, and
# send a kill to that process. Note that Perl let kill(0,@pids) be
# a way to just return the numer of processes the kernel can send
# signals to. So this can be used (except on Cygwin) to determine
# if there are processes left running that we cound out might exists.
#
# But still after all this work, all we know is that we have
# the ports free.
# We scan the "var/run/" directory for other process id's to kill
# We scan the "var/run/" directory for other process id's to kill
my
$rundir
=
"
$::glob_mysql_test_dir/var/run
";
# FIXME $path_run_dir or something
# FIXME $path_run_dir or something
my
$rundir
=
"
$::glob_mysql_test_dir/var/run
";
if
(
-
d
$rundir
)
if
(
-
d
$rundir
)
{
{
...
@@ -218,22 +343,32 @@ sub mtr_kill_leftovers () {
...
@@ -218,22 +343,32 @@ sub mtr_kill_leftovers () {
if
(
-
f
$pidfile
)
if
(
-
f
$pidfile
)
{
{
my
$pid
=
mtr_get_pid_from_file
(
$pidfile
);
my
$pid
=
mtr_get_pid_from_file
(
$pidfile
);
if
(
!
unlink
(
$pidfile
)
)
# Race, could have been removed between I tested with -f
# and the unlink() below, so I better check again with -f
if
(
!
unlink
(
$pidfile
)
and
-
f
$pidfile
)
{
{
mtr_error
("
can't remove
$pidfile
");
mtr_error
("
can't remove
$pidfile
");
}
}
push
(
@pids
,
$pid
);
if
(
$::glob_cygwin_perl
or
kill
(
0
,
$pid
)
)
{
push
(
@pids
,
$pid
);
# We know (cygwin guess) it exists
}
}
}
}
}
closedir
(
RUNDIR
);
closedir
(
RUNDIR
);
start_reap_all
();
if
(
@pids
)
{
if
(
$::glob_cygwin_perl
)
if
(
$::glob_cygwin_perl
)
{
{
# We have no (easy) way of knowing the Cygwin controlling
# We have no (easy) way of knowing the Cygwin controlling
# process, in the PID file we only have the Windows process id.
# process, in the PID file we only have the Windows process id.
system
("
kill -f
"
.
join
("
",
@pids
));
# Hope for the best....
system
("
kill -f
"
.
join
("
",
@pids
));
# Hope for the best....
mtr_debug
("
Sleep 5 seconds waiting for processes to die
");
sleep
(
5
);
}
}
else
else
{
{
...
@@ -241,170 +376,124 @@ sub mtr_kill_leftovers () {
...
@@ -241,170 +376,124 @@ sub mtr_kill_leftovers () {
do
do
{
{
kill
(
9
,
@pids
);
kill
(
9
,
@pids
);
mtr_debug
("
Sleep 1 second waiting for processes to die
");
sleep
(
1
)
# Wait one second
}
while
(
$retries
--
and
kill
(
0
,
@pids
)
);
}
while
(
$retries
--
and
kill
(
0
,
@pids
)
);
if
(
kill
(
0
,
@pids
)
)
if
(
kill
(
0
,
@pids
)
)
# Check if some left
{
{
mtr_error
("
can't kill processes
"
.
join
("
",
@pids
));
# FIXME maybe just mtr_warning() ?
mtr_error
("
can't kill process(es)
"
.
join
("
",
@pids
));
}
}
}
}
}
}
stop_reap_all
();
# We may have failed everything, bug we now check again if we have
# the listen ports free to use, and if they are free, just go for it.
foreach
my
$srv
(
@args
)
{
if
(
mtr_ping_mysqld_server
(
$srv
->
{'
port
'},
$srv
->
{'
sockfile
'})
)
{
mtr_error
("
can't kill old mysqld holding port
$srv
->{'port'}
");
}
}
}
}
}
##############################################################################
##############################################################################
#
#
# Shut down mysqld servers
# Shut down mysqld servers
we have started from this run of this script
#
#
##############################################################################
##############################################################################
# To speed things we kill servers in parallel.
# To speed things we kill servers in parallel. The argument is a list
# The argument is a list of 'pidfiles' and 'socketfiles'.
# of 'ports', 'pids', 'pidfiles' and 'socketfiles'.
# We use the pidfiles and socketfiles to try to terminate the servers.
# This is not perfect, there could still be other server processes
# left.
# Force flag is to be set only for killing mysqld servers this script
# FIXME On Cygwin, and maybe some other platforms, $srv->{'pid'} and
# didn't create in this run, i.e. initial cleanup before we start working.
# $srv->{'pidfile'} will not be the same PID. We need to try to kill
# If force flag is set, we try to kill all with mysqladmin, and
# both I think.
# give up if we have no PIDs.
# FIXME On some operating systems, $srv->{'pid'} and $srv->{'pidfile'}
sub
mtr_stop_mysqld_servers
($)
{
# will not be the same PID. We need to try to kill both I think.
sub
mtr_stop_mysqld_servers
($$)
{
my
$spec
=
shift
;
my
$spec
=
shift
;
my
$force
=
shift
;
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# If the process was not started from this file, we got no PID,
# First try nice normal shutdown using 'mysqladmin'
# we try to find it in the PID file.
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
my
$any_pid
=
0
;
# If we have any PIDs
mtr_mysqladmin_shutdown
(
$spec
);
# ----------------------------------------------------------------------
# We loop with waitpid() nonblocking to see how many of the ones we
# are to kill, actually got killed by mtr_mysqladmin_shutdown().
# Note that we don't rely on this, the mysqld server might have stop
# listening to the port, but still be alive. But it is a start.
# ----------------------------------------------------------------------
foreach
my
$srv
(
@$spec
)
foreach
my
$srv
(
@$spec
)
{
{
if
(
!
$srv
->
{'
pid
'}
and
-
f
$srv
->
{'
pidfile
'}
)
if
(
$srv
->
{'
pid
'}
and
(
waitpid
(
$srv
->
{'
pid
'},
&
WNOHANG
)
==
$srv
->
{'
pid
'})
)
{
$srv
->
{'
pid
'}
=
mtr_get_pid_from_file
(
$srv
->
{'
pidfile
'});
}
if
(
$srv
->
{'
pid
'}
)
{
{
$
any_pid
=
1
;
$
srv
->
{'
pid
'}
=
0
;
}
}
}
}
# If the processes where started from this script, and we know
# no PIDs, then we don't have to do anything.
if
(
!
$any_pid
and
!
$force
)
{
# cluck "This is how we got here!";
return
;
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# First try nice normal shutdown using 'mysqladmin'
# We know the process was started from this file, so there is a PID
# saved, or else we have nothing to do.
# Might be that is is recorded to be missing, but we failed to
# take away the PID file earlier, then we do it now.
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
start_reap_all
();
# Don't require waitpid() of children
my
%
mysqld_pids
;
foreach
my
$srv
(
@$spec
)
foreach
my
$srv
(
@$spec
)
{
{
if
(
-
e
$srv
->
{'
sockfile
'}
or
$srv
->
{'
port
'}
)
if
(
$srv
->
{'
pid
'}
)
{
# FIXME wrong log.....
# FIXME, stderr.....
# Shutdown time must be high as slave may be in reconnect
my
$args
;
mtr_init_args
(
\
$args
);
mtr_add_arg
(
$args
,
"
--no-defaults
");
mtr_add_arg
(
$args
,
"
--user=%s
",
$::opt_user
);
mtr_add_arg
(
$args
,
"
--password=
");
if
(
-
e
$srv
->
{'
sockfile
'}
)
{
{
mtr_add_arg
(
$args
,
"
--socket=%s
",
$srv
->
{'
sockfile
'})
;
$mysqld_pids
{
$srv
->
{'
pid
'}}
=
1
;
}
}
if
(
$srv
->
{'
port
'}
)
else
{
{
mtr_add_arg
(
$args
,
"
--port=%s
",
$srv
->
{'
port
'});
# Race, could have been removed between I tested with -f
}
# and the unlink() below, so I better check again with -f
mtr_add_arg
(
$args
,
"
--connect_timeout=5
");
mtr_add_arg
(
$args
,
"
--shutdown_timeout=20
");
mtr_add_arg
(
$args
,
"
--protocol=tcp
");
# FIXME new thing, will it help?!
mtr_add_arg
(
$args
,
"
shutdown
");
# We don't wait for termination of mysqladmin
mtr_spawn
(
$::exe_mysqladmin
,
$args
,
"",
$::path_manager_log
,
$::path_manager_log
,
"");
}
}
# Wait for them all to remove their pid and socket file
PIDSOCKFILEREMOVED:
if
(
-
f
$srv
->
{'
pidfile
'}
and
!
unlink
(
$srv
->
{'
pidfile
'})
and
for
(
my
$loop
=
$::opt_sleep_time_for_delete
;
$loop
;
$loop
--
)
-
f
$srv
->
{'
pidfile
'}
)
{
{
my
$pidsockfiles_left
=
0
;
mtr_error
("
can't remove
$srv
->{'pidfile'}
");
foreach
my
$srv
(
@$spec
)
{
if
(
-
e
$srv
->
{'
sockfile
'}
or
-
f
$srv
->
{'
pidfile
'}
)
{
$pidsockfiles_left
++
;
# Could be that pidfile is left
}
}
}
}
if
(
!
$pidsockfiles_left
)
{
last
PIDSOCKFILEREMOVED
;
}
if
(
$loop
%
20
==
1
)
{
mtr_warning
("
Still processes alive after 10 seconds, retrying for
$loop
seconds...
");
}
mtr_debug
("
Sleep for 1 second waiting for pid and socket file removal
");
sleep
(
1
);
# One second
}
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# If no known PIDs, we have nothing more to try
# If the processes where started from this script, and we had no PIDS
# then we don't have to do anything.
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
if
(
!
$any_pid
)
if
(
!
keys
%
mysqld_pids
)
{
{
stop_reap_all
()
;
# cluck "This is how we got here!"
;
return
;
return
;
}
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# We may have killed all that left a socket, but we are not sure we got
# In mtr_mysqladmin_shutdown() we only waited for the mysqld servers
# them all killed. If we suspect it lives, try nice kill with SIG_TERM.
# not to listen to the port. But we are not sure we got them all
# Note that for true Win32 processes, kill(0,$pid) will not return 1.
# killed. If we suspect it lives, try nice kill with SIG_TERM. Note
# that for true Win32 processes, kill(0,$pid) will not return 1.
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
SIGNAL:
SIGNAL:
foreach
my
$sig
(
15
,
9
)
foreach
my
$sig
(
15
,
9
)
{
{
my
$process_left
=
0
;
my
$retries
=
10
;
# 10 seconds
foreach
my
$srv
(
@$spec
)
kill
(
$sig
,
keys
%
mysqld_pids
);
{
while
(
$retries
--
and
kill
(
0
,
keys
%
mysqld_pids
)
)
if
(
$srv
->
{'
pid
'}
and
(
-
f
$srv
->
{'
pidfile
'}
or
kill
(
0
,
$srv
->
{'
pid
'})
)
)
{
$process_left
++
;
mtr_warning
("
process
$srv
->{'pid'} not cooperating,
"
.
"
will send signal
$sig
to process
");
kill
(
$sig
,
$srv
->
{'
pid
'});
# SIG_TERM
}
if
(
!
$process_left
)
{
{
last
SIGNAL
;
mtr_debug
("
Sleep 1 second waiting for processes to die
")
;
}
sleep
(
1
)
# Wait one second
}
}
mtr_debug
("
Sleep for 5 seconds waiting for processes to die
");
sleep
(
5
);
# We wait longer than usual
}
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
@@ -437,8 +526,8 @@ sub mtr_stop_mysqld_servers ($$) {
...
@@ -437,8 +526,8 @@ sub mtr_stop_mysqld_servers ($$) {
foreach
my
$file
(
$srv
->
{'
pidfile
'},
$srv
->
{'
sockfile
'})
foreach
my
$file
(
$srv
->
{'
pidfile
'},
$srv
->
{'
sockfile
'})
{
{
unlink
(
$file
);
# Know it is dead so should be no race, careful anyway
if
(
-
e
$file
)
if
(
-
f
$file
and
!
unlink
(
$file
)
and
-
f
$file
)
{
{
$errors
++
;
$errors
++
;
mtr_warning
("
couldn't delete
$file
");
mtr_warning
("
couldn't delete
$file
");
...
@@ -454,9 +543,147 @@ sub mtr_stop_mysqld_servers ($$) {
...
@@ -454,9 +543,147 @@ sub mtr_stop_mysqld_servers ($$) {
}
}
}
}
stop_reap_all
();
# FIXME We just assume they are all dead, for Cygwin we are not
# really sure
# FIXME We just assume they are all dead, we don't know....
}
##############################################################################
#
# Shut down mysqld servers using "mysqladmin ... shutdown".
# To speed this up, we start them in parallel and use waitpid() to
# catch their termination. Note that this doesn't say the servers
# are terminated, just that 'mysqladmin' is terminated.
#
# Note that mysqladmin will ask the server about what PID file it uses,
# and mysqladmin will wait for it to be removed before it terminates
# (unless passes timeout).
#
# This function will take at most about 20 seconds, and we still are not
# sure we killed them all. If none is responding to ping, we return 1,
# else we return 0.
#
##############################################################################
sub
mtr_mysqladmin_shutdown
()
{
my
$spec
=
shift
;
my
@mysql_admin_pids
;
my
@to_kill_specs
;
foreach
my
$srv
(
@$spec
)
{
if
(
mtr_ping_mysqld_server
(
$srv
->
{'
port
'},
$srv
->
{'
sockfile
'})
)
{
push
(
@to_kill_specs
,
$srv
);
}
}
foreach
my
$srv
(
@to_kill_specs
)
{
# FIXME wrong log.....
# FIXME, stderr.....
# Shutdown time must be high as slave may be in reconnect
my
$args
;
mtr_init_args
(
\
$args
);
mtr_add_arg
(
$args
,
"
--no-defaults
");
mtr_add_arg
(
$args
,
"
--user=%s
",
$::opt_user
);
mtr_add_arg
(
$args
,
"
--password=
");
if
(
-
e
$srv
->
{'
sockfile
'}
)
{
mtr_add_arg
(
$args
,
"
--socket=%s
",
$srv
->
{'
sockfile
'});
}
if
(
$srv
->
{'
port
'}
)
{
mtr_add_arg
(
$args
,
"
--port=%s
",
$srv
->
{'
port
'});
}
if
(
$srv
->
{'
port
'}
and
!
-
e
$srv
->
{'
sockfile
'}
)
{
mtr_add_arg
(
$args
,
"
--protocol=tcp
");
# Needed if no --socket
}
mtr_add_arg
(
$args
,
"
--connect_timeout=5
");
mtr_add_arg
(
$args
,
"
--shutdown_timeout=20
");
mtr_add_arg
(
$args
,
"
shutdown
");
# We don't wait for termination of mysqladmin
my
$pid
=
mtr_spawn
(
$::exe_mysqladmin
,
$args
,
"",
$::path_manager_log
,
$::path_manager_log
,
"");
push
(
@mysql_admin_pids
,
$pid
);
}
# We wait blocking, we wait for the last one anyway
foreach
my
$pid
(
@mysql_admin_pids
)
{
waitpid
(
$pid
,
0
);
# FIXME no need to check -1 or 0?
}
# If we trusted "mysqladmin --shutdown_timeout= ..." we could just
# terminate now, but we don't (FIXME should be debugged).
# So we try again to ping and at least wait the same amount of time
# mysqladmin would for all to die.
my
$timeout
=
20
;
# 20 seconds max
my
$res
=
1
;
# If we just fall through, we are done
TIME:
while
(
$timeout
--
)
{
foreach
my
$srv
(
@to_kill_specs
)
{
$res
=
1
;
# We are optimistic
if
(
mtr_ping_mysqld_server
(
$srv
->
{'
port
'},
$srv
->
{'
sockfile
'})
)
{
mtr_debug
("
Sleep 1 second waiting for processes to stop using port
");
sleep
(
1
);
# One second
$res
=
0
;
next
TIME
;
}
}
last
;
# If we got here, we are done
}
return
$res
;
}
##############################################################################
#
# The operating system will keep information about dead children,
# we read this information here, and if we have records the process
# is alive, we mark it as dead.
#
##############################################################################
sub
mtr_record_dead_children
()
{
my
$ret_pid
;
# FIXME the man page says to wait for -1 to terminate,
# but on OS X we get '0' all the time...
while
(
(
$ret_pid
=
waitpid
(
-
1
,
&
WNOHANG
))
>
0
)
{
mtr_debug
("
waitpid() catched exit of child
$ret_pid
");
foreach
my
$idx
(
0
..
1
)
{
if
(
$::master
->
[
$idx
]
->
{'
pid
'}
eq
$ret_pid
)
{
mtr_debug
("
child
$ret_pid
was master[
$idx
]
");
$::master
->
[
$idx
]
->
{'
pid
'}
=
0
;
}
}
foreach
my
$idx
(
0
..
2
)
{
if
(
$::slave
->
[
$idx
]
->
{'
pid
'}
eq
$ret_pid
)
{
mtr_debug
("
child
$ret_pid
was slave[
$idx
]
");
$::slave
->
[
$idx
]
->
{'
pid
'}
=
0
;
last
;
}
}
}
}
}
sub
start_reap_all
{
sub
start_reap_all
{
...
@@ -467,6 +694,32 @@ sub stop_reap_all {
...
@@ -467,6 +694,32 @@ sub stop_reap_all {
$SIG
{
CHLD
}
=
'
DEFAULT
';
$SIG
{
CHLD
}
=
'
DEFAULT
';
}
}
sub
mtr_ping_mysqld_server
()
{
my
$port
=
shift
;
my
$remote
=
"
localhost
";
my
$iaddr
=
inet_aton
(
$remote
);
if
(
!
$iaddr
)
{
mtr_error
("
can't find IP number for
$remote
");
}
my
$paddr
=
sockaddr_in
(
$port
,
$iaddr
);
my
$proto
=
getprotobyname
('
tcp
');
if
(
!
socket
(
SOCK
,
PF_INET
,
SOCK_STREAM
,
$proto
)
)
{
mtr_error
("
can't create socket: $!
");
}
if
(
connect
(
SOCK
,
$paddr
)
)
{
close
(
SOCK
);
# FIXME check error?
return
1
;
}
else
{
return
0
;
}
}
##############################################################################
##############################################################################
#
#
# Wait for a file to be created
# Wait for a file to be created
...
@@ -474,33 +727,38 @@ sub stop_reap_all {
...
@@ -474,33 +727,38 @@ sub stop_reap_all {
##############################################################################
##############################################################################
sub
sleep_until_file_created
($$)
{
sub
sleep_until_file_created
($$
$
)
{
my
$pidfile
=
shift
;
my
$pidfile
=
shift
;
my
$timeout
=
shift
;
my
$timeout
=
shift
;
my
$pid
=
shift
;
my
$loop
=
$timeout
;
for
(
my
$loop
=
1
;
$loop
<=
$timeout
;
$loop
++
)
while
(
$loop
--
)
{
{
if
(
-
r
$pidfile
)
if
(
-
r
$pidfile
)
{
{
return
;
return
1
;
}
}
mtr_debug
("
Sleep for 1 second waiting for creation of
$pidfile
");
if
(
$loop
%
20
==
1
)
# Check if it died after the fork() was successful
if
(
waitpid
(
$pid
,
&
WNOHANG
)
==
$pid
)
{
{
mtr_warning
("
Waiting for
$pidfile
to be created, still trying for
$loop
seconds...
")
;
return
0
;
}
}
sleep
(
1
);
mtr_debug
("
Sleep 1 second waiting for creation of
$pidfile
");
}
if
(
!
-
r
$pidfile
)
if
(
$loop
%
60
==
0
)
{
{
mtr_error
("
No
$pidfile
was created
");
my
$left
=
$timeout
-
$loop
;
mtr_warning
("
Waited
$loop
seconds for
$pidfile
to be created,
"
.
"
still waiting for
$left
seconds...
");
}
}
}
sleep
(
1
);
}
return
0
;
}
1
;
1
;
mysql-test/lib/mtr_report.pl
View file @
58e33676
...
@@ -10,6 +10,7 @@ sub mtr_report_test_name($);
...
@@ -10,6 +10,7 @@ sub mtr_report_test_name($);
sub
mtr_report_test_passed
($);
sub
mtr_report_test_passed
($);
sub
mtr_report_test_failed
($);
sub
mtr_report_test_failed
($);
sub
mtr_report_test_skipped
($);
sub
mtr_report_test_skipped
($);
sub
mtr_report_test_disabled
($);
sub
mtr_show_failed_diff
($);
sub
mtr_show_failed_diff
($);
sub
mtr_report_stats
($);
sub
mtr_report_stats
($);
...
@@ -72,7 +73,14 @@ sub mtr_report_test_skipped ($) {
...
@@ -72,7 +73,14 @@ sub mtr_report_test_skipped ($) {
my
$tinfo
=
shift
;
my
$tinfo
=
shift
;
$tinfo
->
{'
result
'}
=
'
MTR_RES_SKIPPED
';
$tinfo
->
{'
result
'}
=
'
MTR_RES_SKIPPED
';
if
(
$tinfo
->
{'
disable
'}
)
{
print
"
[ disabled ]
$tinfo
->{'comment'}
\n
";
}
else
{
print
"
[ skipped ]
\n
";
print
"
[ skipped ]
\n
";
}
}
}
sub
mtr_report_test_passed
($)
{
sub
mtr_report_test_passed
($)
{
...
@@ -95,9 +103,18 @@ sub mtr_report_test_failed ($) {
...
@@ -95,9 +103,18 @@ sub mtr_report_test_failed ($) {
$tinfo
->
{'
result
'}
=
'
MTR_RES_FAILED
';
$tinfo
->
{'
result
'}
=
'
MTR_RES_FAILED
';
print
"
[ fail ]
\n
";
print
"
[ fail ]
\n
";
# FIXME Instead of this test, and meaningless error message in 'else'
# we should write out into $::path_timefile when the error occurs.
if
(
-
f
$::path_timefile
)
{
print
"
Errors are (from $::path_timefile) :
\n
";
print
"
Errors are (from $::path_timefile) :
\n
";
print
mtr_fromfile
(
$::path_timefile
);
# FIXME print_file() instead
print
mtr_fromfile
(
$::path_timefile
);
# FIXME print_file() instead
print
"
\n
(the last lines may be the most important ones)
\n
";
print
"
\n
(the last lines may be the most important ones)
\n
";
}
else
{
print
"
Unexpected termination, probably when starting mysqld
\n
";
}
}
}
sub
mtr_report_stats
($)
{
sub
mtr_report_stats
($)
{
...
...
mysql-test/mysql-test-run.pl
View file @
58e33676
...
@@ -84,10 +84,11 @@ use Sys::Hostname;
...
@@ -84,10 +84,11 @@ use Sys::Hostname;
#use Carp;
#use Carp;
use
IO::
Socket
;
use
IO::
Socket
;
use
IO::Socket::
INET
;
use
IO::Socket::
INET
;
use
Data::
Dumper
;
#
use Data::Dumper;
use
strict
;
use
strict
;
#use diagnostics;
#use diagnostics;
require
"
lib/mtr_cases.pl
";
require
"
lib/mtr_process.pl
";
require
"
lib/mtr_process.pl
";
require
"
lib/mtr_io.pl
";
require
"
lib/mtr_io.pl
";
require
"
lib/mtr_gcov.pl
";
require
"
lib/mtr_gcov.pl
";
...
@@ -165,14 +166,12 @@ our $glob_user= 'test';
...
@@ -165,14 +166,12 @@ our $glob_user= 'test';
our
$glob_use_embedded_server
=
0
;
our
$glob_use_embedded_server
=
0
;
our
$glob_basedir
;
our
$glob_basedir
;
our
$glob_do_test
;
# The total result
# The total result
our
$path_charsetsdir
;
our
$path_charsetsdir
;
our
$path_client_bindir
;
our
$path_client_bindir
;
our
$path_language
;
our
$path_language
;
our
$path_tests_bindir
;
our
$path_timefile
;
our
$path_timefile
;
our
$path_manager_log
;
# Used by mysqldadmin
our
$path_manager_log
;
# Used by mysqldadmin
our
$path_slave_load_tmpdir
;
# What is this?!
our
$path_slave_load_tmpdir
;
# What is this?!
...
@@ -192,8 +191,10 @@ our $exe_master_mysqld;
...
@@ -192,8 +191,10 @@ our $exe_master_mysqld;
our
$exe_mysql
;
our
$exe_mysql
;
our
$exe_mysqladmin
;
our
$exe_mysqladmin
;
our
$exe_mysqlbinlog
;
our
$exe_mysqlbinlog
;
our
$exe_mysql_client_test
;
our
$exe_mysqld
;
our
$exe_mysqld
;
our
$exe_mysqldump
;
# Called from test case
our
$exe_mysqldump
;
# Called from test case
our
$exe_mysql_fix_system_tables
;
our
$exe_mysqltest
;
our
$exe_mysqltest
;
our
$exe_slave_mysqld
;
our
$exe_slave_mysqld
;
...
@@ -208,6 +209,7 @@ our $opt_current_test;
...
@@ -208,6 +209,7 @@ our $opt_current_test;
our
$opt_ddd
;
our
$opt_ddd
;
our
$opt_debug
;
our
$opt_debug
;
our
$opt_do_test
;
our
$opt_do_test
;
our
@opt_cases
;
# The test cases names in argv
our
$opt_embedded_server
;
our
$opt_embedded_server
;
our
$opt_extern
;
our
$opt_extern
;
our
$opt_fast
;
our
$opt_fast
;
...
@@ -232,8 +234,6 @@ our $opt_local_master;
...
@@ -232,8 +234,6 @@ our $opt_local_master;
our
$master
;
# Will be struct in C
our
$master
;
# Will be struct in C
our
$slave
;
our
$slave
;
our
$opt_master_myport
;
our
$opt_slave_myport
;
our
$opt_ndbcluster_port
;
our
$opt_ndbcluster_port
;
our
$opt_ndbconnectstring
;
our
$opt_ndbconnectstring
;
...
@@ -297,8 +297,6 @@ sub command_line_setup ();
...
@@ -297,8 +297,6 @@ sub command_line_setup ();
sub
executable_setup
();
sub
executable_setup
();
sub
environment_setup
();
sub
environment_setup
();
sub
kill_and_cleanup
();
sub
kill_and_cleanup
();
sub
collect_test_cases
($);
sub
sleep_until_file_created
($$);
sub
ndbcluster_start
();
sub
ndbcluster_start
();
sub
ndbcluster_stop
();
sub
ndbcluster_stop
();
sub
run_benchmarks
($);
sub
run_benchmarks
($);
...
@@ -306,6 +304,7 @@ sub run_tests ();
...
@@ -306,6 +304,7 @@ sub run_tests ();
sub
mysql_install_db
();
sub
mysql_install_db
();
sub
install_db
($$);
sub
install_db
($$);
sub
run_testcase
($);
sub
run_testcase
($);
sub
report_failure_and_restart
($);
sub
do_before_start_master
($$);
sub
do_before_start_master
($$);
sub
do_before_start_slave
($$);
sub
do_before_start_slave
($$);
sub
mysqld_start
($$$$);
sub
mysqld_start
($$$$);
...
@@ -357,10 +356,18 @@ sub main () {
...
@@ -357,10 +356,18 @@ sub main () {
}
}
if
(
$opt_start_and_exit
)
if
(
$opt_start_and_exit
)
{
# FIXME what about ndb?
if
(
mysqld_start
('
master
',
0
,
[]
,
[]
)
)
{
{
mtr_report
("
Servers started, exiting
");
mtr_report
("
Servers started, exiting
");
}
}
else
else
{
mtr_error
("
Can't start the mysqld server
");
}
}
else
{
{
if
(
$opt_bench
)
if
(
$opt_bench
)
{
{
...
@@ -447,8 +454,8 @@ sub command_line_setup () {
...
@@ -447,8 +454,8 @@ sub command_line_setup () {
$path_manager_log
=
"
$glob_mysql_test_dir
/var/log/manager.log
";
$path_manager_log
=
"
$glob_mysql_test_dir
/var/log/manager.log
";
$opt_current_test
=
"
$glob_mysql_test_dir
/var/log/current_test
";
$opt_current_test
=
"
$glob_mysql_test_dir
/var/log/current_test
";
$opt_master_myport
=
9306
;
my
$opt_master_myport
=
9306
;
$opt_slave_myport
=
9308
;
my
$opt_slave_myport
=
9308
;
$opt_ndbcluster_port
=
9350
;
$opt_ndbcluster_port
=
9350
;
# Read the command line
# Read the command line
...
@@ -532,6 +539,8 @@ sub command_line_setup () {
...
@@ -532,6 +539,8 @@ sub command_line_setup () {
usage
("");
usage
("");
}
}
@opt_cases
=
@ARGV
;
# Put this into a hash, will be a C struct
# Put this into a hash, will be a C struct
$master
->
[
0
]
->
{'
path_myddir
'}
=
"
$glob_mysql_test_dir
/var/master-data
";
$master
->
[
0
]
->
{'
path_myddir
'}
=
"
$glob_mysql_test_dir
/var/master-data
";
...
@@ -598,7 +607,7 @@ sub command_line_setup () {
...
@@ -598,7 +607,7 @@ sub command_line_setup () {
# Look at the command line options and set script flags
# Look at the command line options and set script flags
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
if
(
$opt_record
and
!
@
ARGV
)
if
(
$opt_record
and
!
@
opt_cases
)
{
{
mtr_error
("
Will not run in record mode without a specific test case
");
mtr_error
("
Will not run in record mode without a specific test case
");
}
}
...
@@ -733,7 +742,8 @@ sub executable_setup () {
...
@@ -733,7 +742,8 @@ sub executable_setup () {
{
{
mtr_error
("
Can't find embedded server 'mysqltest'
");
mtr_error
("
Can't find embedded server 'mysqltest'
");
}
}
$path_tests_bindir
=
"
$glob_basedir
/libmysqld/examples
";
$exe_mysql_client_test
=
"
$glob_basedir
/libmysqld/examples/mysql_client_test_embedded
";
}
}
else
else
{
{
...
@@ -749,7 +759,8 @@ sub executable_setup () {
...
@@ -749,7 +759,8 @@ sub executable_setup () {
{
{
$exe_mysqltest
=
"
$glob_basedir
/client/mysqltest
";
$exe_mysqltest
=
"
$glob_basedir
/client/mysqltest
";
}
}
$path_tests_bindir
=
"
$glob_basedir
/tests
";
$exe_mysql_client_test
=
"
$glob_basedir
/tests/mysql_client_test
";
}
}
if
(
-
f
"
$glob_basedir
/client/.libs/mysqldump
"
)
if
(
-
f
"
$glob_basedir
/client/.libs/mysqldump
"
)
{
{
...
@@ -768,22 +779,26 @@ sub executable_setup () {
...
@@ -768,22 +779,26 @@ sub executable_setup () {
$exe_mysqlbinlog
=
"
$glob_basedir
/client/mysqlbinlog
";
$exe_mysqlbinlog
=
"
$glob_basedir
/client/mysqlbinlog
";
}
}
$exe_mysqld
=
"
$glob_basedir
/sql/mysqld
";
$path_client_bindir
=
"
$glob_basedir
/client
";
$path_client_bindir
=
"
$glob_basedir
/client
";
$exe_mysqld
=
"
$glob_basedir
/sql/mysqld
";
$exe_mysqladmin
=
"
$path_client_bindir
/mysqladmin
";
$exe_mysqladmin
=
"
$path_client_bindir
/mysqladmin
";
$exe_mysql
=
"
$path_client_bindir
/mysql
";
$exe_mysql
=
"
$path_client_bindir
/mysql
";
$exe_mysql_fix_system_tables
=
"
$glob_basedir
/scripts/mysql_fix_privilege_tables
";
$path_language
=
"
$glob_basedir
/sql/share/english/
";
$path_language
=
"
$glob_basedir
/sql/share/english/
";
$path_charsetsdir
=
"
$glob_basedir
/sql/share/charsets
";
$path_charsetsdir
=
"
$glob_basedir
/sql/share/charsets
";
}
}
else
else
{
{
my
$path_tests_bindir
=
"
$glob_basedir
/tests
";
$path_client_bindir
=
"
$glob_basedir
/bin
";
$path_client_bindir
=
"
$glob_basedir
/bin
";
$path_tests_bindir
=
"
$glob_basedir
/tests
";
$exe_mysqltest
=
"
$path_client_bindir
/mysqltest
";
$exe_mysqltest
=
"
$path_client_bindir
/mysqltest
";
$exe_mysqldump
=
"
$path_client_bindir
/mysqldump
";
$exe_mysqldump
=
"
$path_client_bindir
/mysqldump
";
$exe_mysqlbinlog
=
"
$path_client_bindir
/mysqlbinlog
";
$exe_mysqlbinlog
=
"
$path_client_bindir
/mysqlbinlog
";
$exe_mysqladmin
=
"
$path_client_bindir
/mysqladmin
";
$exe_mysqladmin
=
"
$path_client_bindir
/mysqladmin
";
$exe_mysql
=
"
$path_client_bindir
/mysql
";
$exe_mysql
=
"
$path_client_bindir
/mysql
";
$exe_mysql_fix_system_tables
=
"
$path_client_bindir
/scripts/mysql_fix_privilege_tables
";
if
(
-
d
"
$glob_basedir
/share/mysql/english
"
)
if
(
-
d
"
$glob_basedir
/share/mysql/english
"
)
{
{
$path_language
=
"
$glob_basedir
/share/mysql/english/
";
$path_language
=
"
$glob_basedir
/share/mysql/english/
";
...
@@ -804,6 +819,33 @@ sub executable_setup () {
...
@@ -804,6 +819,33 @@ sub executable_setup () {
$exe_mysqld
=
"
$glob_basedir
/bin/mysqld
";
$exe_mysqld
=
"
$glob_basedir
/bin/mysqld
";
}
}
if
(
$glob_use_embedded_server
)
{
if
(
-
f
"
$path_client_bindir
/mysqltest_embedded
"
)
{
# FIXME valgrind?
$exe_mysqltest
=
"
$path_client_bindir
/mysqltest_embedded
";
}
else
{
error
("
Cannot find embedded server 'mysqltest_embedded'
");
}
if
(
-
d
"
$path_tests_bindir
/mysql_client_test_embedded
"
)
{
$exe_mysql_client_test
=
"
$path_tests_bindir
/mysql_client_test_embedded
";
}
else
{
$exe_mysql_client_test
=
"
$path_client_bindir
/mysql_client_test_embedded
";
}
}
else
{
$exe_mysqltest
=
"
$path_client_bindir
/mysqltest
";
$exe_mysql_client_test
=
"
$path_client_bindir
/mysql_client_test
";
}
}
}
# FIXME special $exe_master_mysqld and $exe_slave_mysqld
# FIXME special $exe_master_mysqld and $exe_slave_mysqld
...
@@ -846,13 +888,18 @@ sub environment_setup () {
...
@@ -846,13 +888,18 @@ sub environment_setup () {
# Also command lines in .opt files may contain env vars
# Also command lines in .opt files may contain env vars
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
$ENV
{'
UMASK
'}
=
"
0660
";
# The octal *string*
$ENV
{'
UMASK_DIR
'}
=
"
0770
";
# The octal *string*
$ENV
{'
LC_COLLATE
'}
=
"
C
";
$ENV
{'
LC_COLLATE
'}
=
"
C
";
$ENV
{'
USE_RUNNING_SERVER
'}
=
$glob_use_running_server
;
$ENV
{'
MYSQL_TEST_DIR
'}
=
$glob_mysql_test_dir
;
$ENV
{'
MYSQL_TEST_DIR
'}
=
$glob_mysql_test_dir
;
$ENV
{'
MASTER_MYPORT
'}
=
$opt_master_myport
;
$ENV
{'
MASTER_MYSOCK
'}
=
$master
->
[
0
]
->
{'
path_mysock
'};
$ENV
{'
SLAVE_MYPORT
'}
=
$opt_slave_myport
;
$ENV
{'
MASTER_MYSOCK1
'}
=
$master
->
[
1
]
->
{'
path_mysock
'};
$ENV
{'
MASTER_MYPORT
'}
=
$master
->
[
0
]
->
{'
path_myport
'};
$ENV
{'
MASTER_MYPORT1
'}
=
$master
->
[
1
]
->
{'
path_myport
'};
$ENV
{'
SLAVE_MYPORT
'}
=
$slave
->
[
0
]
->
{'
path_myport
'};
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV
{'
MYSQL_TCP_PORT
'}
=
3306
;
$ENV
{'
MYSQL_TCP_PORT
'}
=
3306
;
$ENV
{'
MASTER_MYSOCK
'}
=
$master
->
[
0
]
->
{'
path_mysock
'};
}
}
...
@@ -875,203 +922,6 @@ sub handle_int_signal () {
...
@@ -875,203 +922,6 @@ sub handle_int_signal () {
}
}
##############################################################################
#
# Collect information about test cases we are to run
#
##############################################################################
sub
collect_test_cases
($)
{
my
$suite
=
shift
;
# Test suite name
my
$testdir
;
my
$resdir
;
if
(
$suite
eq
"
main
"
)
{
$testdir
=
"
$glob_mysql_test_dir
/t
";
$resdir
=
"
$glob_mysql_test_dir
/r
";
}
else
{
$testdir
=
"
$glob_mysql_test_dir
/suite/
$suite
/t
";
$resdir
=
"
$glob_mysql_test_dir
/suite/
$suite
/r
";
}
my
@tests
;
# Array of hash, will be array of C struct
opendir
(
TESTDIR
,
$testdir
)
or
mtr_error
("
Can't open dir
\"
$testdir
\"
: $!
");
foreach
my
$elem
(
sort
readdir
(
TESTDIR
)
)
{
my
$tname
=
mtr_match_extension
(
$elem
,"
test
");
next
if
!
defined
$tname
;
next
if
$opt_do_test
and
!
defined
mtr_match_prefix
(
$elem
,
$opt_do_test
);
my
$path
=
"
$testdir
/
$elem
";
# ----------------------------------------------------------------------
# Skip some tests silently
# ----------------------------------------------------------------------
if
(
$opt_start_from
and
$tname
lt
$opt_start_from
)
{
next
;
}
# ----------------------------------------------------------------------
# Skip some tests but include in list, just mark them to skip
# ----------------------------------------------------------------------
my
$tinfo
=
{};
$tinfo
->
{'
name
'}
=
$tname
;
$tinfo
->
{'
result_file
'}
=
"
$resdir
/
$tname
.result
";
push
(
@tests
,
$tinfo
);
if
(
$opt_skip_test
and
defined
mtr_match_prefix
(
$tname
,
$opt_skip_test
)
)
{
$tinfo
->
{'
skip
'}
=
1
;
next
;
}
# FIXME temporary solution, we have a hard coded list of test cases to
# skip if we are using the embedded server
if
(
$glob_use_embedded_server
and
mtr_match_any_exact
(
$tname
,
\
@skip_if_embedded_server
)
)
{
$tinfo
->
{'
skip
'}
=
1
;
next
;
}
# ----------------------------------------------------------------------
# Collect information about test case
# ----------------------------------------------------------------------
$tinfo
->
{'
path
'}
=
$path
;
$tinfo
->
{'
timezone
'}
=
"
GMT-3
";
# for UNIX_TIMESTAMP tests to work
if
(
defined
mtr_match_prefix
(
$tname
,"
rpl
")
)
{
if
(
$opt_skip_rpl
)
{
$tinfo
->
{'
skip
'}
=
1
;
next
;
}
# FIXME currently we always restart slaves
$tinfo
->
{'
slave_restart
'}
=
1
;
if
(
$tname
eq
'
rpl_failsafe
'
or
$tname
eq
'
rpl_chain_temp_table
'
)
{
$tinfo
->
{'
slave_num
'}
=
3
;
}
else
{
$tinfo
->
{'
slave_num
'}
=
1
;
}
}
# FIXME what about embedded_server + ndbcluster, skip ?!
my
$master_opt_file
=
"
$testdir
/
$tname
-master.opt
";
my
$slave_opt_file
=
"
$testdir
/
$tname
-slave.opt
";
my
$slave_mi_file
=
"
$testdir
/
$tname
.slave-mi
";
my
$master_sh
=
"
$testdir
/
$tname
-master.sh
";
my
$slave_sh
=
"
$testdir
/
$tname
-slave.sh
";
if
(
-
f
$master_opt_file
)
{
$tinfo
->
{'
master_restart
'}
=
1
;
# We think so for now
# This is a dirty hack from old mysql-test-run, we use the opt file
# to flag other things as well, it is not a opt list at all
my
$extra_master_opt
=
mtr_get_opts_from_file
(
$master_opt_file
);
foreach
my
$opt
(
@$extra_master_opt
)
{
my
$value
;
$value
=
mtr_match_prefix
(
$opt
,
"
--timezone=
");
if
(
defined
$value
)
{
$tinfo
->
{'
timezone
'}
=
$value
;
$extra_master_opt
=
[]
;
$tinfo
->
{'
master_restart
'}
=
0
;
last
;
}
$value
=
mtr_match_prefix
(
$opt
,
"
--result-file=
");
if
(
defined
$value
)
{
$tinfo
->
{'
result_file
'}
=
"
r/
$value
.result
";
if
(
$opt_result_ext
and
$opt_record
or
-
f
"
$tinfo
->{'result_file'}
$opt_result_ext
")
{
$tinfo
->
{'
result_file
'}
.=
$opt_result_ext
;
}
$extra_master_opt
=
[]
;
$tinfo
->
{'
master_restart
'}
=
0
;
last
;
}
}
$tinfo
->
{'
master_opt
'}
=
$extra_master_opt
;
}
if
(
-
f
$slave_opt_file
)
{
$tinfo
->
{'
slave_opt
'}
=
mtr_get_opts_from_file
(
$slave_opt_file
);
$tinfo
->
{'
slave_restart
'}
=
1
;
}
if
(
-
f
$slave_mi_file
)
{
$tinfo
->
{'
slave_mi
'}
=
mtr_get_opts_from_file
(
$slave_mi_file
);
$tinfo
->
{'
slave_restart
'}
=
1
;
}
if
(
-
f
$master_sh
)
{
if
(
$glob_win32_perl
)
{
$tinfo
->
{'
skip
'}
=
1
;
}
else
{
$tinfo
->
{'
master_sh
'}
=
$master_sh
;
$tinfo
->
{'
master_restart
'}
=
1
;
}
}
if
(
-
f
$slave_sh
)
{
if
(
$glob_win32_perl
)
{
$tinfo
->
{'
skip
'}
=
1
;
}
else
{
$tinfo
->
{'
slave_sh
'}
=
$slave_sh
;
$tinfo
->
{'
slave_restart
'}
=
1
;
}
}
# We can't restart a running server that may be in use
if
(
$glob_use_running_server
and
(
$tinfo
->
{'
master_restart
'}
or
$tinfo
->
{'
slave_restart
'}
)
)
{
$tinfo
->
{'
skip
'}
=
1
;
}
}
closedir
TESTDIR
;
return
\
@tests
;
}
##############################################################################
##############################################################################
#
#
# Handle left overs from previous runs
# Handle left overs from previous runs
...
@@ -1189,6 +1039,10 @@ sub run_benchmarks ($) {
...
@@ -1189,6 +1039,10 @@ sub run_benchmarks ($) {
if
(
!
$glob_use_embedded_server
and
!
$opt_local_master
)
if
(
!
$glob_use_embedded_server
and
!
$opt_local_master
)
{
{
$master
->
[
0
]
->
{'
pid
'}
=
mysqld_start
('
master
',
0
,
[]
,
[]
);
$master
->
[
0
]
->
{'
pid
'}
=
mysqld_start
('
master
',
0
,
[]
,
[]
);
if
(
!
$master
->
[
0
]
->
{'
pid
'}
)
{
mtr_error
("
Can't start the mysqld server
");
}
}
}
mtr_init_args
(
\
$args
);
mtr_init_args
(
\
$args
);
...
@@ -1301,10 +1155,12 @@ sub run_suite () {
...
@@ -1301,10 +1155,12 @@ sub run_suite () {
sub
mysql_install_db
()
{
sub
mysql_install_db
()
{
mtr_report
("
Installing Test Databases
");
# FIXME not exactly true I think, needs improvements
install_db
('
master
',
$master
->
[
0
]
->
{'
path_myddir
'});
install_db
('
master
',
$master
->
[
0
]
->
{'
path_myddir
'});
install_db
('
master
',
$master
->
[
1
]
->
{'
path_myddir
'});
install_db
('
slave
',
$slave
->
[
0
]
->
{'
path_myddir
'});
install_db
('
slave
',
$slave
->
[
0
]
->
{'
path_myddir
'});
install_db
('
slave
',
$slave
->
[
1
]
->
{'
path_myddir
'});
install_db
('
slave
',
$slave
->
[
2
]
->
{'
path_myddir
'});
return
0
;
return
0
;
}
}
...
@@ -1422,6 +1278,12 @@ sub run_testcase ($) {
...
@@ -1422,6 +1278,12 @@ sub run_testcase ($) {
mtr_tofile
(
$master
->
[
0
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
mtr_tofile
(
$master
->
[
0
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
do_before_start_master
(
$tname
,
$tinfo
->
{'
master_sh
'});
do_before_start_master
(
$tname
,
$tinfo
->
{'
master_sh
'});
# ----------------------------------------------------------------------
# If any mysqld servers running died, we have to know
# ----------------------------------------------------------------------
mtr_record_dead_children
();
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Start masters
# Start masters
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
@@ -1439,14 +1301,24 @@ sub run_testcase ($) {
...
@@ -1439,14 +1301,24 @@ sub run_testcase ($) {
{
{
$master
->
[
0
]
->
{'
pid
'}
=
$master
->
[
0
]
->
{'
pid
'}
=
mysqld_start
('
master
',
0
,
$tinfo
->
{'
master_opt
'},
[]
);
mysqld_start
('
master
',
0
,
$tinfo
->
{'
master_opt
'},
[]
);
if
(
!
$master
->
[
0
]
->
{'
pid
'}
)
{
report_failure_and_restart
(
$tinfo
);
return
;
}
}
}
if
(
$opt_with_ndbcluster
and
!
$master
->
[
1
]
->
{'
pid
'}
)
if
(
$opt_with_ndbcluster
and
!
$master
->
[
1
]
->
{'
pid
'}
)
{
{
$master
->
[
1
]
->
{'
pid
'}
=
$master
->
[
1
]
->
{'
pid
'}
=
mysqld_start
('
master
',
1
,
$tinfo
->
{'
master_opt
'},
[]
);
mysqld_start
('
master
',
1
,
$tinfo
->
{'
master_opt
'},
[]
);
if
(
!
$master
->
[
1
]
->
{'
pid
'}
)
{
report_failure_and_restart
(
$tinfo
);
return
;
}
}
}
if
(
$tinfo
->
{'
master_opt
'
}
)
if
(
@
{
$tinfo
->
{'
master_opt
'}
}
)
{
{
$master
->
[
0
]
->
{'
uses_special_flags
'}
=
1
;
$master
->
[
0
]
->
{'
uses_special_flags
'}
=
1
;
}
}
...
@@ -1469,6 +1341,11 @@ sub run_testcase ($) {
...
@@ -1469,6 +1341,11 @@ sub run_testcase ($) {
$slave
->
[
$idx
]
->
{'
pid
'}
=
$slave
->
[
$idx
]
->
{'
pid
'}
=
mysqld_start
('
slave
',
$idx
,
mysqld_start
('
slave
',
$idx
,
$tinfo
->
{'
slave_opt
'},
$tinfo
->
{'
slave_mi
'});
$tinfo
->
{'
slave_opt
'},
$tinfo
->
{'
slave_mi
'});
if
(
!
$slave
->
[
$idx
]
->
{'
pid
'}
)
{
report_failure_and_restart
(
$tinfo
);
return
;
}
}
}
}
}
}
}
...
@@ -1502,12 +1379,21 @@ sub run_testcase ($) {
...
@@ -1502,12 +1379,21 @@ sub run_testcase ($) {
"
mysqltest returned unexpected code
$res
,
"
.
"
mysqltest returned unexpected code
$res
,
"
.
"
it has probably crashed
");
"
it has probably crashed
");
}
}
report_failure_and_restart
(
$tinfo
);
}
}
}
sub
report_failure_and_restart
($)
{
my
$tinfo
=
shift
;
mtr_report_test_failed
(
$tinfo
);
mtr_report_test_failed
(
$tinfo
);
mtr_show_failed_diff
(
$tname
);
mtr_show_failed_diff
(
$tinfo
->
{'
name
'}
);
print
"
\n
";
print
"
\n
";
if
(
!
$opt_force
)
if
(
!
$opt_force
)
{
{
print
"
Aborting:
$tname
failed. To continue, re-run with '--force'.
";
print
"
Aborting:
$tinfo
->{'name'}
failed. To continue, re-run with '--force'.
";
print
"
\n
";
print
"
\n
";
if
(
!
$opt_gdb
and
!
$glob_use_running_server
and
if
(
!
$opt_gdb
and
!
$glob_use_running_server
and
!
$opt_ddd
and
!
$glob_use_embedded_server
)
!
$opt_ddd
and
!
$glob_use_embedded_server
)
...
@@ -1524,8 +1410,6 @@ sub run_testcase ($) {
...
@@ -1524,8 +1410,6 @@ sub run_testcase ($) {
stop_masters_slaves
();
stop_masters_slaves
();
}
}
print
"
Resuming Tests
\n\n
";
print
"
Resuming Tests
\n\n
";
}
}
}
}
...
@@ -1609,6 +1493,8 @@ sub mysqld_arguments ($$$$$) {
...
@@ -1609,6 +1493,8 @@ sub mysqld_arguments ($$$$$) {
my
$extra_opt
=
shift
;
my
$extra_opt
=
shift
;
my
$slave_master_info
=
shift
;
my
$slave_master_info
=
shift
;
# print STDERR Dumper($extra_opt);
my
$sidx
=
"";
# Index as string, 0 is empty string
my
$sidx
=
"";
# Index as string, 0 is empty string
if
(
$idx
>
0
)
if
(
$idx
>
0
)
{
{
...
@@ -1893,9 +1779,8 @@ sub mysqld_start ($$$$) {
...
@@ -1893,9 +1779,8 @@ sub mysqld_start ($$$$) {
$master
->
[
$idx
]
->
{'
path_myerr
'},
$master
->
[
$idx
]
->
{'
path_myerr
'},
$master
->
[
$idx
]
->
{'
path_myerr
'},
"")
)
$master
->
[
$idx
]
->
{'
path_myerr
'},
"")
)
{
{
sleep_until_file_created
(
$master
->
[
$idx
]
->
{'
path_mypid
'},
return
sleep_until_file_created
(
$master
->
[
$idx
]
->
{'
path_mypid
'},
$master
->
[
$idx
]
->
{'
start_timeout
'});
$master
->
[
$idx
]
->
{'
start_timeout
'},
$pid
);
return
$pid
;
}
}
}
}
...
@@ -1905,13 +1790,12 @@ sub mysqld_start ($$$$) {
...
@@ -1905,13 +1790,12 @@ sub mysqld_start ($$$$) {
$slave
->
[
$idx
]
->
{'
path_myerr
'},
$slave
->
[
$idx
]
->
{'
path_myerr
'},
$slave
->
[
$idx
]
->
{'
path_myerr
'},
"")
)
$slave
->
[
$idx
]
->
{'
path_myerr
'},
"")
)
{
{
sleep_until_file_created
(
$slave
->
[
$idx
]
->
{'
path_mypid
'},
return
sleep_until_file_created
(
$slave
->
[
$idx
]
->
{'
path_mypid
'},
$master
->
[
$idx
]
->
{'
start_timeout
'});
$master
->
[
$idx
]
->
{'
start_timeout
'},
$pid
);
return
$pid
;
}
}
}
}
mtr_error
("
Can't start mysqld FIXME
")
;
return
0
;
}
}
sub
stop_masters_slaves
()
{
sub
stop_masters_slaves
()
{
...
@@ -1944,7 +1828,7 @@ sub stop_masters () {
...
@@ -1944,7 +1828,7 @@ sub stop_masters () {
}
}
}
}
mtr_stop_mysqld_servers
(
\
@args
,
0
);
mtr_stop_mysqld_servers
(
\
@args
);
}
}
sub
stop_slaves
()
{
sub
stop_slaves
()
{
...
@@ -1966,7 +1850,7 @@ sub stop_slaves () {
...
@@ -1966,7 +1850,7 @@ sub stop_slaves () {
}
}
}
}
mtr_stop_mysqld_servers
(
\
@args
,
0
);
mtr_stop_mysqld_servers
(
\
@args
);
}
}
...
@@ -1992,17 +1876,32 @@ sub run_mysqltest ($$) {
...
@@ -1992,17 +1876,32 @@ sub run_mysqltest ($$) {
}
}
my
$cmdline_mysql
=
my
$cmdline_mysql
=
"
$exe_mysql
--host=localhost --port=
$master
->[0]->{'path_myport'}
"
.
"
$exe_mysql
--host=localhost --user=root --password=
"
.
"
--socket=
$master
->[0]->{'path_mysock'} --user=root --password=
";
"
--port=
$master
->[0]->{'path_myport'}
"
.
"
--socket=
$master
->[0]->{'path_mysock'}
";
my
$cmdline_mysql_client_test
=
"
$exe_mysql_client_test
--no-defaults --testcase --user=root --silent
"
.
"
--port=
$master
->[0]->{'path_myport'}
"
.
"
--socket=
$master
->[0]->{'path_mysock'}
";
my
$cmdline_mysql_fix_system_tables
=
"
$exe_mysql_fix_system_tables
--no-defaults --host=localhost --user=root --password=
"
.
"
--basedir=
$glob_basedir
--bindir=
$path_client_bindir
--verbose
"
.
"
--port=
$master
->[0]->{'path_myport'}
"
.
"
--socket=
$master
->[0]->{'path_mysock'}
";
# FIXME really needing a PATH???
# FIXME really needing a PATH???
# $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}";
# $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}";
$ENV
{'
MYSQL
'}
=
$
ex
e_mysql
;
$ENV
{'
MYSQL
'}
=
$
cmdlin
e_mysql
;
$ENV
{'
MYSQL_DUMP
'}
=
$cmdline_mysqldump
;
$ENV
{'
MYSQL_DUMP
'}
=
$cmdline_mysqldump
;
$ENV
{'
MYSQL_BINLOG
'}
=
$exe_mysqlbinlog
;
$ENV
{'
MYSQL_BINLOG
'}
=
$cmdline_mysqlbinlog
;
$ENV
{'
CLIENT_BINDIR
'}
=
$path_client_bindir
;
$ENV
{'
MYSQL_FIX_SYSTEM_TABLES
'}
=
$cmdline_mysql_fix_system_tables
;
$ENV
{'
TESTS_BINDIR
'}
=
$path_tests_bindir
;
$ENV
{'
MYSQL_CLIENT_TEST
'}
=
$cmdline_mysql_client_test
;
$ENV
{'
CHARSETSDIR
'}
=
$path_charsetsdir
;
my
$exe
=
$exe_mysqltest
;
my
$exe
=
$exe_mysqltest
;
my
$args
;
my
$args
;
...
...
mysql-test/r/update.result
View file @
58e33676
...
@@ -212,3 +212,10 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
...
@@ -212,3 +212,10 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
drop table t1, t2;
drop table t1, t2;
create table t1 (id int not null auto_increment primary key, id_str varchar(32));
insert into t1 (id_str) values ("test");
update t1 set id_str = concat(id_str, id) where id = last_insert_id();
select * from t1;
id id_str
1 test1
drop table t1;
mysql-test/t/update.test
View file @
58e33676
...
@@ -170,3 +170,12 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
...
@@ -170,3 +170,12 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
where
t1
.
c3
=
10
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
where
t1
.
c3
=
10
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug #8057
#
create
table
t1
(
id
int
not
null
auto_increment
primary
key
,
id_str
varchar
(
32
));
insert
into
t1
(
id_str
)
values
(
"test"
);
update
t1
set
id_str
=
concat
(
id_str
,
id
)
where
id
=
last_insert_id
();
select
*
from
t1
;
drop
table
t1
;
ndb/include/portlib/NdbThread.h
View file @
58e33676
...
@@ -76,7 +76,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status);
...
@@ -76,7 +76,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status);
*
*
* * status: exit code
* * status: exit code
*/
*/
void
NdbThread_Exit
(
int
status
);
void
NdbThread_Exit
(
void
*
status
);
/**
/**
* Set thread concurrency level
* Set thread concurrency level
...
...
ndb/src/common/portlib/NdbPortLibTest.cpp
View file @
58e33676
...
@@ -54,10 +54,7 @@ extern "C" void* thread1func(void* arg)
...
@@ -54,10 +54,7 @@ extern "C" void* thread1func(void* arg)
if
(
arg1
!=
7
)
if
(
arg1
!=
7
)
fail
(
"TEST1"
,
"Wrong arg"
);
fail
(
"TEST1"
,
"Wrong arg"
);
NdbThread_Exit
(
returnvalue
);
return
returnvalue
;
return
NULL
;
}
}
// test 2 variables and funcs
// test 2 variables and funcs
...
@@ -80,10 +77,7 @@ extern "C" void* test2func(void* arg)
...
@@ -80,10 +77,7 @@ extern "C" void* test2func(void* arg)
fail
(
"TEST2"
,
"Failed to unlock mutex"
);
fail
(
"TEST2"
,
"Failed to unlock mutex"
);
int
returnvalue
=
arg1
;
int
returnvalue
=
arg1
;
NdbThread_Exit
(
returnvalue
);
return
returnvalue
;
return
NULL
;
}
}
...
@@ -129,8 +123,7 @@ extern "C" void* testfunc(void* arg)
...
@@ -129,8 +123,7 @@ extern "C" void* testfunc(void* arg)
}
}
while
(
tmpVar
<
100
);
while
(
tmpVar
<
100
);
NdbThread_Exit
(
0
);
return
0
;
return
NULL
;
}
}
extern
"C"
void
*
testTryLockfunc
(
void
*
arg
)
extern
"C"
void
*
testTryLockfunc
(
void
*
arg
)
...
@@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg)
...
@@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg)
}
}
while
(
tmpVar
<
100
);
while
(
tmpVar
<
100
);
NdbThread_Exit
(
0
);
return
0
;
return
NULL
;
}
}
...
...
ndb/src/common/portlib/NdbThread.c
View file @
58e33676
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include <ndb_global.h>
#include <ndb_global.h>
#include <NdbThread.h>
#include <NdbThread.h>
#include <pthread.h>
#include <
my_
pthread.h>
#include <NdbMem.h>
#include <NdbMem.h>
#define MAX_THREAD_NAME 16
#define MAX_THREAD_NAME 16
...
@@ -39,8 +39,8 @@ struct NdbThread
...
@@ -39,8 +39,8 @@ struct NdbThread
static
static
void
*
void
*
ndb_thread_wrapper
(
void
*
_ss
){
ndb_thread_wrapper
(
void
*
_ss
){
void
*
ret
;
my_thread_init
()
;
struct
NdbThread
*
ss
=
(
struct
NdbThread
*
)
_ss
;
{
DBUG_ENTER
(
"ndb_thread_wrapper"
);
DBUG_ENTER
(
"ndb_thread_wrapper"
);
#ifdef NDB_SHM_TRANSPORTER
#ifdef NDB_SHM_TRANSPORTER
if
(
g_ndb_shm_signum
)
if
(
g_ndb_shm_signum
)
...
@@ -52,8 +52,15 @@ ndb_thread_wrapper(void* _ss){
...
@@ -52,8 +52,15 @@ ndb_thread_wrapper(void* _ss){
pthread_sigmask
(
SIG_BLOCK
,
&
mask
,
0
);
pthread_sigmask
(
SIG_BLOCK
,
&
mask
,
0
);
}
}
#endif
#endif
{
void
*
ret
;
struct
NdbThread
*
ss
=
(
struct
NdbThread
*
)
_ss
;
ret
=
(
*
ss
->
func
)(
ss
->
object
);
ret
=
(
*
ss
->
func
)(
ss
->
object
);
DBUG_RETURN
(
ret
);
NdbThread_Exit
(
ret
);
}
/* will never be reached */
DBUG_RETURN
(
0
);
}
}
}
...
@@ -130,9 +137,10 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
...
@@ -130,9 +137,10 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
}
}
void
NdbThread_Exit
(
int
status
)
void
NdbThread_Exit
(
void
*
status
)
{
{
pthread_exit
(
&
status
);
my_thread_end
();
pthread_exit
(
status
);
}
}
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
58e33676
...
@@ -1104,11 +1104,8 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) {
...
@@ -1104,11 +1104,8 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) {
static
void
*
static
void
*
run_start_clients_C
(
void
*
me
)
run_start_clients_C
(
void
*
me
)
{
{
my_thread_init
();
((
TransporterRegistry
*
)
me
)
->
start_clients_thread
();
((
TransporterRegistry
*
)
me
)
->
start_clients_thread
();
my_thread_end
();
return
0
;
NdbThread_Exit
(
0
);
return
me
;
}
}
// Run by kernel thread
// Run by kernel thread
...
...
ndb/src/common/util/NdbSqlUtil.cpp
View file @
58e33676
...
@@ -526,6 +526,7 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32
...
@@ -526,6 +526,7 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32
union
{
const
Uint32
*
p
;
const
unsigned
char
*
v
;
}
u1
,
u2
;
union
{
const
Uint32
*
p
;
const
unsigned
char
*
v
;
}
u1
,
u2
;
u1
.
p
=
p1
;
u1
.
p
=
p1
;
u2
.
p
=
p2
;
u2
.
p
=
p2
;
#ifdef ndb_date_sol9x86_cc_xO3_madness
// from Field_newdate::val_int
// from Field_newdate::val_int
Uint64
j1
=
uint3korr
(
u1
.
v
);
Uint64
j1
=
uint3korr
(
u1
.
v
);
Uint64
j2
=
uint3korr
(
u2
.
v
);
Uint64
j2
=
uint3korr
(
u2
.
v
);
...
@@ -536,6 +537,33 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32
...
@@ -536,6 +537,33 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32
if
(
j1
>
j2
)
if
(
j1
>
j2
)
return
+
1
;
return
+
1
;
return
0
;
return
0
;
#else
uint
j1
=
uint3korr
(
u1
.
v
);
uint
j2
=
uint3korr
(
u2
.
v
);
uint
d1
=
(
j1
&
31
);
uint
d2
=
(
j2
&
31
);
j1
=
(
j1
>>
5
);
j2
=
(
j2
>>
5
);
uint
m1
=
(
j1
&
15
);
uint
m2
=
(
j2
&
15
);
j1
=
(
j1
>>
4
);
j2
=
(
j2
>>
4
);
uint
y1
=
j1
;
uint
y2
=
j2
;
if
(
y1
<
y2
)
return
-
1
;
if
(
y1
>
y2
)
return
+
1
;
if
(
m1
<
m2
)
return
-
1
;
if
(
m1
>
m2
)
return
+
1
;
if
(
d1
<
d2
)
return
-
1
;
if
(
d1
>
d2
)
return
+
1
;
return
0
;
#endif
#endif
#endif
}
}
...
...
ndb/src/common/util/SocketServer.cpp
View file @
58e33676
...
@@ -186,11 +186,7 @@ extern "C"
...
@@ -186,11 +186,7 @@ extern "C"
void
*
void
*
socketServerThread_C
(
void
*
_ss
){
socketServerThread_C
(
void
*
_ss
){
SocketServer
*
ss
=
(
SocketServer
*
)
_ss
;
SocketServer
*
ss
=
(
SocketServer
*
)
_ss
;
my_thread_init
();
ss
->
doRun
();
ss
->
doRun
();
my_thread_end
();
NdbThread_Exit
(
0
);
return
0
;
return
0
;
}
}
...
@@ -309,11 +305,8 @@ void*
...
@@ -309,11 +305,8 @@ void*
sessionThread_C
(
void
*
_sc
){
sessionThread_C
(
void
*
_sc
){
SocketServer
::
Session
*
si
=
(
SocketServer
::
Session
*
)
_sc
;
SocketServer
::
Session
*
si
=
(
SocketServer
::
Session
*
)
_sc
;
my_thread_init
();
if
(
!
transfer
(
si
->
m_socket
)){
if
(
!
transfer
(
si
->
m_socket
)){
si
->
m_stopped
=
true
;
si
->
m_stopped
=
true
;
my_thread_end
();
NdbThread_Exit
(
0
);
return
0
;
return
0
;
}
}
...
@@ -325,8 +318,6 @@ sessionThread_C(void* _sc){
...
@@ -325,8 +318,6 @@ sessionThread_C(void* _sc){
}
}
si
->
m_stopped
=
true
;
si
->
m_stopped
=
true
;
my_thread_end
();
NdbThread_Exit
(
0
);
return
0
;
return
0
;
}
}
...
...
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
View file @
58e33676
...
@@ -82,7 +82,6 @@ static int numAsyncFiles = 0;
...
@@ -82,7 +82,6 @@ static int numAsyncFiles = 0;
extern
"C"
void
*
runAsyncFile
(
void
*
arg
)
extern
"C"
void
*
runAsyncFile
(
void
*
arg
)
{
{
my_thread_init
();
((
AsyncFile
*
)
arg
)
->
run
();
((
AsyncFile
*
)
arg
)
->
run
();
return
(
NULL
);
return
(
NULL
);
}
}
...
@@ -876,8 +875,6 @@ void AsyncFile::endReq()
...
@@ -876,8 +875,6 @@ void AsyncFile::endReq()
{
{
// Thread is ended with return
// Thread is ended with return
if
(
theWriteBuffer
)
NdbMem_Free
(
theWriteBuffer
);
if
(
theWriteBuffer
)
NdbMem_Free
(
theWriteBuffer
);
my_thread_end
();
NdbThread_Exit
(
0
);
}
}
...
...
ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp
View file @
58e33676
...
@@ -40,7 +40,6 @@ extern "C" void* runProducer(void*arg)
...
@@ -40,7 +40,6 @@ extern "C" void* runProducer(void*arg)
NdbSleep_MilliSleep
(
i
);
NdbSleep_MilliSleep
(
i
);
i
++
;
i
++
;
}
}
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
@@ -58,7 +57,6 @@ extern "C" void* runConsumer(void* arg)
...
@@ -58,7 +57,6 @@ extern "C" void* runConsumer(void* arg)
delete
p
;
delete
p
;
}
}
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
@@ -92,7 +90,6 @@ extern "C" void* runProducer2(void*arg)
...
@@ -92,7 +90,6 @@ extern "C" void* runProducer2(void*arg)
NdbSleep_MilliSleep
(
i
);
NdbSleep_MilliSleep
(
i
);
i
++
;
i
++
;
}
}
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
@@ -111,7 +108,6 @@ extern "C" void* runConsumer2(void* arg)
...
@@ -111,7 +108,6 @@ extern "C" void* runConsumer2(void* arg)
delete
p
;
delete
p
;
}
}
ndbout
<<
"Consumer2: "
<<
count
<<
" received"
<<
endl
;
ndbout
<<
"Consumer2: "
<<
count
<<
" received"
<<
endl
;
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
...
ndb/src/kernel/vm/FastScheduler.cpp
View file @
58e33676
...
@@ -76,11 +76,16 @@ FastScheduler::activateSendPacked()
...
@@ -76,11 +76,16 @@ FastScheduler::activateSendPacked()
globalData
.
loopMax
=
2048
;
globalData
.
loopMax
=
2048
;
}
//FastScheduler::activateSendPacked()
}
//FastScheduler::activateSendPacked()
//------------------------------------------------------------------------
// sendPacked is executed at the end of the loop.
// To ensure that we don't send any messages before executing all local
// packed signals we do another turn in the loop (unless we have already
// executed too many signals in the loop).
//------------------------------------------------------------------------
void
void
FastScheduler
::
doJob
()
FastScheduler
::
doJob
()
{
{
do
{
Uint32
init_loopCount
=
0
;
Uint32
loopCount
=
0
;
Uint32
TminLoops
=
getBOccupancy
()
+
EXTRA_SIGNALS_PER_DO_JOB
;
Uint32
TminLoops
=
getBOccupancy
()
+
EXTRA_SIGNALS_PER_DO_JOB
;
Uint32
TloopMax
=
(
Uint32
)
globalData
.
loopMax
;
Uint32
TloopMax
=
(
Uint32
)
globalData
.
loopMax
;
if
(
TminLoops
<
TloopMax
)
{
if
(
TminLoops
<
TloopMax
)
{
...
@@ -89,6 +94,8 @@ FastScheduler::doJob()
...
@@ -89,6 +94,8 @@ FastScheduler::doJob()
if
(
TloopMax
<
MIN_NUMBER_OF_SIG_PER_DO_JOB
)
{
if
(
TloopMax
<
MIN_NUMBER_OF_SIG_PER_DO_JOB
)
{
TloopMax
=
MIN_NUMBER_OF_SIG_PER_DO_JOB
;
TloopMax
=
MIN_NUMBER_OF_SIG_PER_DO_JOB
;
}
//if
}
//if
do
{
Uint32
loopCount
=
init_loopCount
;
register
Uint32
tHighPrio
=
globalData
.
highestAvailablePrio
;
register
Uint32
tHighPrio
=
globalData
.
highestAvailablePrio
;
register
Signal
*
signal
=
getVMSignals
();
register
Signal
*
signal
=
getVMSignals
();
while
((
tHighPrio
<
LEVEL_IDLE
)
&&
(
loopCount
<
TloopMax
))
{
while
((
tHighPrio
<
LEVEL_IDLE
)
&&
(
loopCount
<
TloopMax
))
{
...
@@ -151,7 +158,7 @@ FastScheduler::doJob()
...
@@ -151,7 +158,7 @@ FastScheduler::doJob()
if
(
globalData
.
sendPackedActivated
==
1
)
{
if
(
globalData
.
sendPackedActivated
==
1
)
{
Uint32
t1
=
theDoJobTotalCounter
;
Uint32
t1
=
theDoJobTotalCounter
;
Uint32
t2
=
theDoJobCallCounter
;
Uint32
t2
=
theDoJobCallCounter
;
t1
+=
loopCount
;
t1
+=
(
loopCount
-
init_loopCount
)
;
t2
++
;
t2
++
;
theDoJobTotalCounter
=
t1
;
theDoJobTotalCounter
=
t1
;
theDoJobCallCounter
=
t2
;
theDoJobCallCounter
=
t2
;
...
@@ -161,7 +168,11 @@ FastScheduler::doJob()
...
@@ -161,7 +168,11 @@ FastScheduler::doJob()
theDoJobTotalCounter
=
0
;
theDoJobTotalCounter
=
0
;
}
//if
}
//if
}
//if
}
//if
}
while
(
getBOccupancy
()
>
MAX_OCCUPANCY
);
init_loopCount
=
loopCount
;
sendPacked
();
}
while
((
getBOccupancy
()
>
MAX_OCCUPANCY
)
||
((
init_loopCount
<
TloopMax
)
&&
(
globalData
.
highestAvailablePrio
<
LEVEL_IDLE
)));
}
//FastScheduler::doJob()
}
//FastScheduler::doJob()
void
FastScheduler
::
sendPacked
()
void
FastScheduler
::
sendPacked
()
...
...
ndb/src/kernel/vm/ThreadConfig.cpp
View file @
58e33676
...
@@ -173,9 +173,6 @@ void ThreadConfig::ipControlLoop()
...
@@ -173,9 +173,6 @@ void ThreadConfig::ipControlLoop()
// until all buffers are empty or until we have executed 2048 signals.
// until all buffers are empty or until we have executed 2048 signals.
//--------------------------------------------------------------------
//--------------------------------------------------------------------
globalScheduler
.
doJob
();
globalScheduler
.
doJob
();
globalScheduler
.
sendPacked
();
}
//while
}
//while
globalData
.
incrementWatchDogCounter
(
6
);
globalData
.
incrementWatchDogCounter
(
6
);
...
...
ndb/src/kernel/vm/WatchDog.cpp
View file @
58e33676
...
@@ -27,10 +27,7 @@
...
@@ -27,10 +27,7 @@
extern
"C"
extern
"C"
void
*
void
*
runWatchDog
(
void
*
w
){
runWatchDog
(
void
*
w
){
my_thread_init
();
((
WatchDog
*
)
w
)
->
run
();
((
WatchDog
*
)
w
)
->
run
();
my_thread_end
();
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
...
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
58e33676
...
@@ -457,8 +457,6 @@ event_thread_run(void* m)
...
@@ -457,8 +457,6 @@ event_thread_run(void* m)
{
{
NdbMgmHandle
handle
=
*
(
NdbMgmHandle
*
)
m
;
NdbMgmHandle
handle
=
*
(
NdbMgmHandle
*
)
m
;
my_thread_init
();
int
filter
[]
=
{
15
,
NDB_MGM_EVENT_CATEGORY_BACKUP
,
0
};
int
filter
[]
=
{
15
,
NDB_MGM_EVENT_CATEGORY_BACKUP
,
0
};
int
fd
=
ndb_mgm_listen_event
(
handle
,
filter
);
int
fd
=
ndb_mgm_listen_event
(
handle
,
filter
);
if
(
fd
>
0
)
if
(
fd
>
0
)
...
@@ -478,9 +476,7 @@ event_thread_run(void* m)
...
@@ -478,9 +476,7 @@ event_thread_run(void* m)
do_event_thread
=
-
1
;
do_event_thread
=
-
1
;
}
}
my_thread_end
();
return
NULL
;
NdbThread_Exit
(
0
);
return
0
;
}
}
bool
bool
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
58e33676
...
@@ -3192,13 +3192,27 @@ fixShmKey(InitConfigFileParser::Context & ctx, const char *)
...
@@ -3192,13 +3192,27 @@ fixShmKey(InitConfigFileParser::Context & ctx, const char *)
{
{
DBUG_ENTER
(
"fixShmKey"
);
DBUG_ENTER
(
"fixShmKey"
);
{
{
static
int
last_signum
=
-
1
;
Uint32
signum
;
Uint32
signum
;
if
(
!
ctx
.
m_currentSection
->
get
(
"Signum"
,
&
signum
))
if
(
!
ctx
.
m_currentSection
->
get
(
"Signum"
,
&
signum
))
{
{
signum
=
OPT_NDB_SHM_SIGNUM_DEFAULT
;
signum
=
OPT_NDB_SHM_SIGNUM_DEFAULT
;
if
(
signum
<=
0
)
{
ctx
.
reportError
(
"Unable to set default parameter for [SHM]Signum"
" please specify [SHM DEFAULT]Signum"
);
return
false
;
}
ctx
.
m_currentSection
->
put
(
"Signum"
,
signum
);
ctx
.
m_currentSection
->
put
(
"Signum"
,
signum
);
DBUG_PRINT
(
"info"
,(
"Added Signum=%u"
,
signum
));
DBUG_PRINT
(
"info"
,(
"Added Signum=%u"
,
signum
));
}
}
if
(
last_signum
!=
(
int
)
signum
&&
last_signum
>=
0
)
{
ctx
.
reportError
(
"All shared memory transporters must have same [SHM]Signum defined."
" Use [SHM DEFAULT]Signum"
);
return
false
;
}
last_signum
=
(
int
)
signum
;
}
}
{
{
Uint32
id1
=
0
,
id2
=
0
,
key
=
0
;
Uint32
id1
=
0
,
id2
=
0
,
key
=
0
;
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
58e33676
...
@@ -70,12 +70,7 @@ void *
...
@@ -70,12 +70,7 @@ void *
MgmtSrvr
::
logLevelThread_C
(
void
*
m
)
MgmtSrvr
::
logLevelThread_C
(
void
*
m
)
{
{
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
my_thread_init
();
mgm
->
logLevelThreadRun
();
mgm
->
logLevelThreadRun
();
my_thread_end
();
NdbThread_Exit
(
0
);
/* NOTREACHED */
return
0
;
return
0
;
}
}
...
@@ -83,12 +78,7 @@ void *
...
@@ -83,12 +78,7 @@ void *
MgmtSrvr
::
signalRecvThread_C
(
void
*
m
)
MgmtSrvr
::
signalRecvThread_C
(
void
*
m
)
{
{
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
MgmtSrvr
*
mgm
=
(
MgmtSrvr
*
)
m
;
my_thread_init
();
mgm
->
signalRecvThreadRun
();
mgm
->
signalRecvThreadRun
();
my_thread_end
();
NdbThread_Exit
(
0
);
/* NOTREACHED */
return
0
;
return
0
;
}
}
...
...
ndb/src/ndbapi/ClusterMgr.cpp
View file @
58e33676
...
@@ -54,7 +54,6 @@ runClusterMgr_C(void * me)
...
@@ -54,7 +54,6 @@ runClusterMgr_C(void * me)
#ifdef NDB_OSE
#ifdef NDB_OSE
NdbSleep_MilliSleep
(
50
);
NdbSleep_MilliSleep
(
50
);
#endif
#endif
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
@@ -560,10 +559,7 @@ extern "C"
...
@@ -560,10 +559,7 @@ extern "C"
void
*
void
*
runArbitMgr_C
(
void
*
me
)
runArbitMgr_C
(
void
*
me
)
{
{
my_thread_init
();
((
ArbitMgr
*
)
me
)
->
threadMain
();
((
ArbitMgr
*
)
me
)
->
threadMain
();
my_thread_end
();
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
...
ndb/src/ndbapi/TransporterFacade.cpp
View file @
58e33676
...
@@ -405,11 +405,8 @@ extern "C"
...
@@ -405,11 +405,8 @@ extern "C"
void
*
void
*
runSendRequest_C
(
void
*
me
)
runSendRequest_C
(
void
*
me
)
{
{
my_thread_init
();
((
TransporterFacade
*
)
me
)
->
threadMainSend
();
((
TransporterFacade
*
)
me
)
->
threadMainSend
();
my_thread_end
();
return
0
;
NdbThread_Exit
(
0
);
return
me
;
}
}
void
TransporterFacade
::
threadMainSend
(
void
)
void
TransporterFacade
::
threadMainSend
(
void
)
...
@@ -443,11 +440,8 @@ extern "C"
...
@@ -443,11 +440,8 @@ extern "C"
void
*
void
*
runReceiveResponse_C
(
void
*
me
)
runReceiveResponse_C
(
void
*
me
)
{
{
my_thread_init
();
((
TransporterFacade
*
)
me
)
->
threadMainReceive
();
((
TransporterFacade
*
)
me
)
->
threadMainReceive
();
my_thread_end
();
return
0
;
NdbThread_Exit
(
0
);
return
me
;
}
}
void
TransporterFacade
::
threadMainReceive
(
void
)
void
TransporterFacade
::
threadMainReceive
(
void
)
...
...
ndb/src/ndbapi/ndb_cluster_connection.cpp
View file @
58e33676
...
@@ -87,11 +87,8 @@ const char *Ndb_cluster_connection::get_connectstring(char *buf,
...
@@ -87,11 +87,8 @@ const char *Ndb_cluster_connection::get_connectstring(char *buf,
extern
"C"
pthread_handler_decl
(
run_ndb_cluster_connection_connect_thread
,
me
)
extern
"C"
pthread_handler_decl
(
run_ndb_cluster_connection_connect_thread
,
me
)
{
{
my_thread_init
();
g_run_connect_thread
=
1
;
g_run_connect_thread
=
1
;
((
Ndb_cluster_connection_impl
*
)
me
)
->
connect_thread
();
((
Ndb_cluster_connection_impl
*
)
me
)
->
connect_thread
();
my_thread_end
();
NdbThread_Exit
(
0
);
return
me
;
return
me
;
}
}
...
...
ndb/test/ndbapi/benchronja.cpp
View file @
58e33676
...
@@ -984,7 +984,6 @@ void* ThreadExec(void* ThreadData){
...
@@ -984,7 +984,6 @@ void* ThreadExec(void* ThreadData){
delete
pMyNdb
;
delete
pMyNdb
;
pMyNdb
=
NULL
;
pMyNdb
=
NULL
;
ThreadReady
[
thread_no
]
=
1
;
ThreadReady
[
thread_no
]
=
1
;
NdbThread_Exit
(
0
)
;
return
0
;
return
0
;
}
//if
}
//if
...
@@ -1197,7 +1196,6 @@ void* ThreadExec(void* ThreadData){
...
@@ -1197,7 +1196,6 @@ void* ThreadExec(void* ThreadData){
}
// for(;;)
}
// for(;;)
delete
pMyNdb
;
delete
pMyNdb
;
NdbThread_Exit
(
0
)
;
return
0
;
return
0
;
// Compiler is happy now
}
}
ndb/test/ndbapi/flexAsynch.cpp
View file @
58e33676
...
@@ -494,8 +494,7 @@ threadLoop(void* ThreadData)
...
@@ -494,8 +494,7 @@ threadLoop(void* ThreadData)
delete
localNdb
;
delete
localNdb
;
ThreadReady
[
threadNo
]
=
1
;
ThreadReady
[
threadNo
]
=
1
;
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
// Just to keep compiler happy
}
//threadLoop()
}
//threadLoop()
static
static
...
...
ndb/test/ndbapi/flexBench.cpp
View file @
58e33676
...
@@ -617,7 +617,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -617,7 +617,7 @@ static void* flexBenchThread(void* pArg)
free
(
attrRefValue
)
;
free
(
attrRefValue
)
;
free
(
pOps
)
;
free
(
pOps
)
;
delete
pNdb
;
delete
pNdb
;
NdbThread_Exit
(
0
)
;
return
0
;
// thread exits
}
}
pNdb
->
init
();
pNdb
->
init
();
...
@@ -934,8 +934,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -934,8 +934,7 @@ static void* flexBenchThread(void* pArg)
free
(
longKeyAttrValue
);
free
(
longKeyAttrValue
);
}
// if
}
// if
NdbThread_Exit
(
0
);
return
NULL
;
// Thread exits
return
NULL
;
// Just to keep compiler happy
}
}
...
...
ndb/test/ndbapi/flexHammer.cpp
View file @
58e33676
...
@@ -612,10 +612,7 @@ flexHammerThread(void* pArg)
...
@@ -612,10 +612,7 @@ flexHammerThread(void* pArg)
flexHammerErrorData
->
resetErrorCounters
();
flexHammerErrorData
->
resetErrorCounters
();
// And exit using NDBT
return
NULL
;
// thread exits
NdbThread_Exit
(
0
);
return
NULL
;
}
// flexHammerThread
}
// flexHammerThread
...
...
ndb/test/ndbapi/flexScan.cpp
View file @
58e33676
...
@@ -701,8 +701,7 @@ flexScanThread(void* ThreadData)
...
@@ -701,8 +701,7 @@ flexScanThread(void* ThreadData)
free
(
pkValue
);
free
(
pkValue
);
}
// if
}
// if
NdbThread_Exit
(
0
);
return
NULL
;
// thread exits
return
NULL
;
}
// flexScanThread
}
// flexScanThread
...
...
ndb/test/ndbapi/flexTT.cpp
View file @
58e33676
...
@@ -389,8 +389,7 @@ threadLoop(void* ThreadData)
...
@@ -389,8 +389,7 @@ threadLoop(void* ThreadData)
delete
localNdb
;
delete
localNdb
;
ThreadReady
[
loc_threadNo
]
=
1
;
ThreadReady
[
loc_threadNo
]
=
1
;
NdbThread_Exit
(
0
);
return
NULL
;
// Thread exits
return
NULL
;
// Just to keep compiler happy
}
//threadLoop()
}
//threadLoop()
static
static
...
...
ndb/test/ndbapi/flexTimedAsynch.cpp
View file @
58e33676
...
@@ -406,9 +406,8 @@ threadLoop(void* ThreadData)
...
@@ -406,9 +406,8 @@ threadLoop(void* ThreadData)
delete
localNdb
;
delete
localNdb
;
ThreadReady
[
threadNo
]
=
1
;
ThreadReady
[
threadNo
]
=
1
;
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
// thread exits
}
}
void
executeThread
(
StartType
aType
,
Ndb
*
aNdbObject
,
ThreadNdb
*
threadInfo
)
void
executeThread
(
StartType
aType
,
Ndb
*
aNdbObject
,
ThreadNdb
*
threadInfo
)
...
...
ndb/test/ndbapi/flex_bench_mysql.cpp
View file @
58e33676
...
@@ -710,7 +710,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -710,7 +710,7 @@ static void* flexBenchThread(void* pArg)
the_socket_name
,
the_socket_name
,
0
)
==
NULL
)
{
0
)
==
NULL
)
{
ndbout
<<
"failed"
<<
endl
;
ndbout
<<
"failed"
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
ndbout
<<
"ok"
<<
endl
;
ndbout
<<
"ok"
<<
endl
;
...
@@ -722,7 +722,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -722,7 +722,7 @@ static void* flexBenchThread(void* pArg)
if
(
r
)
{
if
(
r
)
{
ndbout
<<
"autocommit on/off failed"
<<
endl
;
ndbout
<<
"autocommit on/off failed"
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
}
}
#endif
#endif
...
@@ -741,7 +741,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -741,7 +741,7 @@ static void* flexBenchThread(void* pArg)
ndbout
<<
threadNo
<<
endl
;
ndbout
<<
threadNo
<<
endl
;
ndbout
<<
"Thread #"
<<
threadNo
<<
" will now exit"
<<
endl
;
ndbout
<<
"Thread #"
<<
threadNo
<<
" will now exit"
<<
endl
;
tResult
=
13
;
tResult
=
13
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
if
(
use_ndb
)
{
if
(
use_ndb
)
{
...
@@ -750,7 +750,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -750,7 +750,7 @@ static void* flexBenchThread(void* pArg)
ndbout
<<
"Failed to get an NDB object"
<<
endl
;
ndbout
<<
"Failed to get an NDB object"
<<
endl
;
ndbout
<<
"Thread #"
<<
threadNo
<<
" will now exit"
<<
endl
;
ndbout
<<
"Thread #"
<<
threadNo
<<
" will now exit"
<<
endl
;
tResult
=
13
;
tResult
=
13
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
pNdb
->
waitUntilReady
();
pNdb
->
waitUntilReady
();
return_ndb_object
(
pNdb
,
ndb_id
);
return_ndb_object
(
pNdb
,
ndb_id
);
...
@@ -900,11 +900,11 @@ static void* flexBenchThread(void* pArg)
...
@@ -900,11 +900,11 @@ static void* flexBenchThread(void* pArg)
prep_insert
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
prep_insert
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
if
(
prep_insert
[
i
]
==
0
)
{
if
(
prep_insert
[
i
]
==
0
)
{
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
if
(
mysql_bind_param
(
prep_insert
[
i
],
bind_insert
))
{
if
(
mysql_bind_param
(
prep_insert
[
i
],
bind_insert
))
{
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
}
}
...
@@ -926,11 +926,11 @@ static void* flexBenchThread(void* pArg)
...
@@ -926,11 +926,11 @@ static void* flexBenchThread(void* pArg)
prep_update
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
prep_update
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
if
(
prep_update
[
i
]
==
0
)
{
if
(
prep_update
[
i
]
==
0
)
{
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
if
(
mysql_bind_param
(
prep_update
[
i
],
bind_update
))
{
if
(
mysql_bind_param
(
prep_update
[
i
],
bind_update
))
{
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
}
}
...
@@ -953,15 +953,15 @@ static void* flexBenchThread(void* pArg)
...
@@ -953,15 +953,15 @@ static void* flexBenchThread(void* pArg)
prep_read
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
prep_read
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
if
(
prep_read
[
i
]
==
0
)
{
if
(
prep_read
[
i
]
==
0
)
{
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
if
(
mysql_bind_param
(
prep_read
[
i
],
bind_read
))
{
if
(
mysql_bind_param
(
prep_read
[
i
],
bind_read
))
{
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
if
(
mysql_bind_result
(
prep_read
[
i
],
&
bind_read
[
1
]))
{
if
(
mysql_bind_result
(
prep_read
[
i
],
&
bind_read
[
1
]))
{
ndbout
<<
"mysql_bind_result: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_bind_result: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
}
}
...
@@ -978,11 +978,11 @@ static void* flexBenchThread(void* pArg)
...
@@ -978,11 +978,11 @@ static void* flexBenchThread(void* pArg)
prep_delete
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
prep_delete
[
i
]
=
mysql_prepare
(
&
mysql
,
buf
,
pos
);
if
(
prep_delete
[
i
]
==
0
)
{
if
(
prep_delete
[
i
]
==
0
)
{
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_prepare: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
if
(
mysql_bind_param
(
prep_delete
[
i
],
bind_delete
))
{
if
(
mysql_bind_param
(
prep_delete
[
i
],
bind_delete
))
{
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
ndbout
<<
"mysql_bind_param: "
<<
mysql_error
(
&
mysql
)
<<
endl
;
NdbThread_Exit
(
0
)
;
return
0
;
}
}
}
}
}
}
...
@@ -1431,8 +1431,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -1431,8 +1431,7 @@ static void* flexBenchThread(void* pArg)
ndbout
<<
"I got here "
<<
endl
;
ndbout
<<
"I got here "
<<
endl
;
return_ndb_object
(
pNdb
,
ndb_id
);
return_ndb_object
(
pNdb
,
ndb_id
);
}
}
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
// Just to keep compiler happy
}
}
...
...
ndb/test/ndbapi/mainAsyncGenerator.cpp
View file @
58e33676
...
@@ -274,8 +274,6 @@ threadRoutine(void *arg)
...
@@ -274,8 +274,6 @@ threadRoutine(void *arg)
asyncDbDisconnect
(
pNDB
);
asyncDbDisconnect
(
pNDB
);
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
...
ndb/test/src/NDBT_Test.cpp
View file @
58e33676
...
@@ -479,7 +479,6 @@ void *
...
@@ -479,7 +479,6 @@ void *
runStep_C
(
void
*
s
)
runStep_C
(
void
*
s
)
{
{
runStep
(
s
);
runStep
(
s
);
NdbThread_Exit
(
0
);
return
NULL
;
return
NULL
;
}
}
...
...
ndb/test/tools/transproxy.cpp
View file @
58e33676
...
@@ -291,7 +291,6 @@ extern "C" void*
...
@@ -291,7 +291,6 @@ extern "C" void*
copyrun_C
(
void
*
copy
)
copyrun_C
(
void
*
copy
)
{
{
((
Copy
*
)
copy
)
->
run
();
((
Copy
*
)
copy
)
->
run
();
NdbThread_Exit
(
0
);
return
0
;
return
0
;
}
}
...
@@ -322,7 +321,6 @@ extern "C" void*
...
@@ -322,7 +321,6 @@ extern "C" void*
connrun_C
(
void
*
conn
)
connrun_C
(
void
*
conn
)
{
{
((
Conn
*
)
conn
)
->
run
();
((
Conn
*
)
conn
)
->
run
();
NdbThread_Exit
(
0
);
return
0
;
return
0
;
}
}
...
...
sql/item_func.cc
View file @
58e33676
...
@@ -2298,14 +2298,10 @@ longlong Item_func_last_insert_id::val_int()
...
@@ -2298,14 +2298,10 @@ longlong Item_func_last_insert_id::val_int()
longlong
value
=
args
[
0
]
->
val_int
();
longlong
value
=
args
[
0
]
->
val_int
();
current_thd
->
insert_id
(
value
);
current_thd
->
insert_id
(
value
);
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
null_value
;
return
value
;
}
}
else
else
{
current_thd
->
lex
->
uncacheable
(
UNCACHEABLE_SIDEEFFECT
);
Item
*
it
=
get_system_var
(
current_thd
,
OPT_SESSION
,
"last_insert_id"
,
14
,
return
current_thd
->
insert_id
();
"last_insert_id()"
);
return
it
->
val_int
();
}
}
}
/* This function is just used to test speed of different functions */
/* This function is just used to test speed of different functions */
...
...
support-files/Makefile.am
View file @
58e33676
...
@@ -27,7 +27,8 @@ EXTRA_DIST = mysql.spec.sh \
...
@@ -27,7 +27,8 @@ EXTRA_DIST = mysql.spec.sh \
mysql.server.sh
\
mysql.server.sh
\
binary-configure.sh
\
binary-configure.sh
\
magic
\
magic
\
MySQL-shared-compat.spec.sh
MySQL-shared-compat.spec.sh
\
ndb-config-2-node.ini.sh
SUBDIRS
=
MacOSX
SUBDIRS
=
MacOSX
...
@@ -38,7 +39,8 @@ pkgdata_DATA = my-small.cnf \
...
@@ -38,7 +39,8 @@ pkgdata_DATA = my-small.cnf \
my-innodb-heavy-4G.cnf
\
my-innodb-heavy-4G.cnf
\
mysql-log-rotate
\
mysql-log-rotate
\
mysql-@VERSION@.spec
\
mysql-@VERSION@.spec
\
MySQL-shared-compat.spec
MySQL-shared-compat.spec
\
ndb-config-2-node.ini
pkgdata_SCRIPTS
=
mysql.server
pkgdata_SCRIPTS
=
mysql.server
...
@@ -52,7 +54,8 @@ CLEANFILES = my-small.cnf \
...
@@ -52,7 +54,8 @@ CLEANFILES = my-small.cnf \
mysql-log-rotate
\
mysql-log-rotate
\
mysql.server
\
mysql.server
\
binary-configure
\
binary-configure
\
MySQL-shared-compat.spec
MySQL-shared-compat.spec
\
ndb-config-2-node.ini
mysql-@VERSION@.spec
:
mysql.spec
mysql-@VERSION@.spec
:
mysql.spec
rm
-f
$@
rm
-f
$@
...
...
support-files/mysql.spec.sh
View file @
58e33676
...
@@ -104,6 +104,53 @@ This package contains the standard MySQL clients and administration tools.
...
@@ -104,6 +104,53 @@ This package contains the standard MySQL clients and administration tools.
%description client
-l
pt_BR
%description client
-l
pt_BR
Este pacote contm os clientes padro para o MySQL.
Este pacote contm os clientes padro para o MySQL.
%package ndb-storage
Release: %
{
release
}
Summary: MySQL - ndbcluster storage engine
Group: Applications/Databases
%description ndb-storage
This package contains the ndbcluster storage engine.
It is necessary to have this package installed on all
computers that should store ndbcluster table data.
Note that this storage engine can only be used
in
conjunction
with the MySQL Max server.
%
{
see_base
}
%package ndb-management
Release: %
{
release
}
Summary: MySQL - ndbcluster storage engine management
Group: Applications/Databases
%description ndb-management
This package contains ndbcluster storage engine management.
It is necessary to have this package installed on at least
one computer
in
the cluster.
%
{
see_base
}
%package ndb-tools
Release: %
{
release
}
Summary: MySQL - ndbcluster storage engine basic tools
Group: Applications/Databases
%description ndb-tools
This package contains ndbcluster storage engine basic tools.
%
{
see_base
}
%package ndb-extra
Release: %
{
release
}
Summary: MySQL - ndbcluster storage engine extra tools
Group: Applications/Databases
%description ndb-extra
This package contains some extra ndbcluster storage engine tools
for
the advanced user.
They should be used with caution.
%
{
see_base
}
%package bench
%package bench
Release: %
{
release
}
Release: %
{
release
}
Requires: %
{
name
}
-client
perl-DBI perl
Requires: %
{
name
}
-client
perl-DBI perl
...
@@ -162,6 +209,7 @@ Requires: MySQL-server >= 4.0
...
@@ -162,6 +209,7 @@ Requires: MySQL-server >= 4.0
Optional MySQL server binary that supports additional features like:
Optional MySQL server binary that supports additional features like:
- Berkeley DB Storage Engine
- Berkeley DB Storage Engine
- Ndbcluster Storage Engine interface
- Archive Storage Engine
- Archive Storage Engine
- CSV Storage Engine
- CSV Storage Engine
- Example Storage Engine
- Example Storage Engine
...
@@ -279,6 +327,7 @@ BuildMySQL "--enable-shared \
...
@@ -279,6 +327,7 @@ BuildMySQL "--enable-shared \
--without-openssl
\
--without-openssl
\
--with-berkeley-db
\
--with-berkeley-db
\
--with-innodb
\
--with-innodb
\
--with-ndbcluster
\
--with-raid
\
--with-raid
\
--with-archive
\
--with-archive
\
--with-csv-storage-engine
\
--with-csv-storage-engine
\
...
@@ -293,6 +342,9 @@ BuildMySQL "--enable-shared \
...
@@ -293,6 +342,9 @@ BuildMySQL "--enable-shared \
mv
sql/mysqld sql/mysqld-max
mv
sql/mysqld sql/mysqld-max
nm
--numeric-sort
sql/mysqld-max
>
sql/mysqld-max.sym
nm
--numeric-sort
sql/mysqld-max
>
sql/mysqld-max.sym
# Install the ndb binaries
(
cd
ndb
;
make
install
DESTDIR
=
$RBR
)
# Install embedded server library in the build root
# Install embedded server library in the build root
install
-m
644 libmysqld/libmysqld.a
$RBR
%
{
_libdir
}
/mysql/
install
-m
644 libmysqld/libmysqld.a
$RBR
%
{
_libdir
}
/mysql/
...
@@ -435,6 +487,21 @@ chmod -R og-rw $mysql_datadir/mysql
...
@@ -435,6 +487,21 @@ chmod -R og-rw $mysql_datadir/mysql
# Allow safe_mysqld to start mysqld and print a message before we exit
# Allow safe_mysqld to start mysqld and print a message before we exit
sleep
2
sleep
2
%pre ndb-storage
mysql_clusterdir
=
/var/lib/mysql-cluster
# Create cluster directory if needed
if
test
!
-d
$mysql_clusterdir
;
then
mkdir
-m755
$mysql_clusterdir
;
fi
%pre ndb-storage
mysql_clusterdir
=
/var/lib/mysql-cluster
# Create cluster directory if needed
if
test
!
-d
$mysql_clusterdir
;
then
mkdir
-m755
$mysql_clusterdir
;
fi
%post Max
%post Max
# Restart mysqld, to use the new binary.
# Restart mysqld, to use the new binary.
echo
"Restarting mysqld."
echo
"Restarting mysqld."
...
@@ -475,6 +542,7 @@ fi
...
@@ -475,6 +542,7 @@ fi
%doc Docs/manual.
{
html,ps,texi,txt
}
%doc Docs/manual.
{
html,ps,texi,txt
}
%doc Docs/manual_toc.html
%doc Docs/manual_toc.html
%doc support-files/my-
*
.cnf
%doc support-files/my-
*
.cnf
%doc support-files/ndb-
*
.ini
%doc %attr
(
644, root, root
)
%
{
_infodir
}
/mysql.info
*
%doc %attr
(
644, root, root
)
%
{
_infodir
}
/mysql.info
*
...
@@ -556,6 +624,32 @@ fi
...
@@ -556,6 +624,32 @@ fi
%postun shared
%postun shared
/sbin/ldconfig
/sbin/ldconfig
%files ndb-storage
%defattr
(
-,root,root,0755
)
%attr
(
755, root, root
)
%
{
_sbindir
}
/ndbd
%files ndb-management
%defattr
(
-,root,root,0755
)
%attr
(
755, root, root
)
%
{
_sbindir
}
/ndb_mgmd
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_mgm
%files ndb-tools
%defattr
(
-,root,root,0755
)
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_mgm
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_restore
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_waiter
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_select_all
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_select_count
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_desc
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_show_tables
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_test_platform
%files ndb-extra
%defattr
(
-,root,root,0755
)
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_drop_index
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_drop_table
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_delete_all
%files devel
%files devel
%defattr
(
-, root, root, 0755
)
%defattr
(
-, root, root, 0755
)
%doc EXCEPTIONS-CLIENT
%doc EXCEPTIONS-CLIENT
...
...
support-files/ndb-config-2-node.ini.sh
0 → 100644
View file @
58e33676
# Example Ndbcluster storage engine config file.
#
[
ndbd default]
NoOfReplicas
=
2
MaxNoOfConcurrentOperations
=
10000
DataMemory
=
80M
IndexMemory
=
24M
TimeBetweenWatchDogCheck
=
30000
DataDir
=
/var/lib/mysql-cluster
MaxNoOfOrderedIndexes
=
512
[
ndb_mgmd default]
DataDir
=
/var/lib/mysql-cluster
[
ndb_mgmd]
Id
=
1
HostName
=
localhost
[
ndbd]
Id
=
2
HostName
=
localhost
[
ndbd]
Id
=
3
HostName
=
localhost
[
mysqld]
Id
=
4
[
mysqld]
Id
=
5
[
mysqld]
Id
=
6
[
mysqld]
Id
=
7
# choose an unused port number
# in this configuration 63132, 63133, and 63134
# will be used
[
tcp default]
PortNumber
=
63132
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment