Skip to content

Commit becf45c

Browse files
Merge mysql.com:/home/my/mysql-5.0
into mysql.com:/home/my/mysql-5.1
2 parents fa81a82 + 501333f commit becf45c

6 files changed

Lines changed: 145 additions & 49 deletions

File tree

include/errmsg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ extern const char *client_errors[]; /* Error messages */
9595
#define CR_NO_STMT_METADATA 2052
9696
#define CR_NO_RESULT_SET 2053
9797
#define CR_NOT_IMPLEMENTED 2054
98-
#define CR_ERROR_LAST /*Copy last error nr:*/ 2054
98+
#define CR_SERVER_LOST_EXTENDED 2055
99+
#define CR_ERROR_LAST /*Copy last error nr:*/ 2055
99100
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
100101

libmysql/errmsg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const char *client_errors[]=
8282
"Prepared statement contains no metadata",
8383
"Attempt to read a row while there is no result set associated with the statement",
8484
"This feature is not implemented yet",
85+
"Lost connection to MySQL server at '%s', system error: %d",
8586
""
8687
};
8788

@@ -145,6 +146,7 @@ const char *client_errors[]=
145146
"Prepared statement contains no metadata",
146147
"Attempt to read a row while there is no result set associated with the statement",
147148
"This feature is not implemented yet",
149+
"Lost connection to MySQL server at '%s', system error: %d",
148150
""
149151
};
150152

@@ -206,6 +208,7 @@ const char *client_errors[]=
206208
"Prepared statement contains no metadata",
207209
"Attempt to read a row while there is no result set associated with the statement",
208210
"This feature is not implemented yet",
211+
"Lost connection to MySQL server at '%s', system error: %d",
209212
""
210213
};
211214
#endif

mysql-test/mysql-test-run-shell.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ find_valgrind()
129129
fi
130130
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
131131
valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && FIND_VALGRIND="$FIND_VALGRIND --tool=memcheck"
132-
FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$CWD/valgrind.supp"
132+
FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$MYSQL_TEST_DIR/valgrind.supp"
133133
}
134134

135135
# No paths below as we can't be sure where the program is!
@@ -2177,7 +2177,7 @@ then
21772177
# Remove files that can cause problems
21782178
$RM -rf $MYSQL_TEST_DIR/var/ndbcluster
21792179
$RM -rf $MYSQL_TEST_DIR/var/tmp/snapshot*
2180-
$RM -f $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
2180+
$RM -rf $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
21812181

21822182
# Remove old berkeley db log files that can confuse the server
21832183
$RM -f $MASTER_MYDDIR/log.*

mysql-test/mysql-test-run.pl

Lines changed: 67 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
our $opt_manual_gdb;
200200
our $opt_manual_ddd;
201201
our $opt_manual_debug;
202+
our $opt_mtr_build_thread=0;
202203
our $opt_debugger;
203204
our $opt_client_debugger;
204205

@@ -213,6 +214,11 @@
213214

214215
our $instance_manager;
215216

217+
our $opt_master_myport;
218+
our $opt_slave_myport;
219+
our $im_port;
220+
our $im_mysqld1_port;
221+
our $im_mysqld2_port;
216222
our $opt_ndbcluster_port;
217223
our $opt_ndbconnectstring;
218224
our $opt_ndbcluster_port_slave;
@@ -313,6 +319,7 @@
313319
sub main ();
314320
sub initial_setup ();
315321
sub command_line_setup ();
322+
sub set_mtr_build_thread_ports($);
316323
sub datadir_setup ();
317324
sub executable_setup ();
318325
sub environment_setup ();
@@ -455,45 +462,17 @@ ()
455462
$opt_suite= "main"; # Special default suite
456463
my $opt_comment;
457464

458-
my $opt_master_myport= 9306;
459-
my $opt_slave_myport= 9308;
465+
$opt_master_myport= 9306;
466+
$opt_slave_myport= 9308;
460467
$opt_ndbcluster_port= 9310;
461468
$opt_ndbcluster_port_slave= 9311;
462-
my $im_port= 9312;
463-
my $im_mysqld1_port= 9313;
464-
my $im_mysqld2_port= 9314;
469+
$im_port= 9312;
470+
$im_mysqld1_port= 9313;
471+
$im_mysqld2_port= 9314;
465472

466-
#
467-
# To make it easier for different devs to work on the same host,
468-
# an environment variable can be used to control all ports. A small
469-
# number is to be used, 0 - 16 or similar.
470-
#
471-
# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
472-
# versions of this script, else a 4.0 test run might conflict with a
473-
# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
474-
# all port numbers might not be used in this version of the script.
475-
#
476-
# Also note the limiteation of ports we are allowed to hand out. This
477-
# differs between operating systems and configuration, see
478-
# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
479-
# But a fairly safe range seems to be 5001 - 32767
480473
if ( $ENV{'MTR_BUILD_THREAD'} )
481474
{
482-
# Up to two masters, up to three slaves
483-
$opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 10 + 10000; # and 1
484-
$opt_slave_myport= $opt_master_myport + 2; # and 3 4
485-
$opt_ndbcluster_port= $opt_master_myport + 5;
486-
$opt_ndbcluster_port_slave= $opt_master_myport + 6;
487-
$im_port= $opt_master_myport + 7;
488-
$im_mysqld1_port= $opt_master_myport + 8;
489-
$im_mysqld2_port= $opt_master_myport + 9;
490-
}
491-
492-
if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
493-
{
494-
mtr_error("MTR_BUILD_THREAD number results in a port",
495-
"outside 5001 - 32767",
496-
"($opt_master_myport - $opt_master_myport + 10)");
475+
set_mtr_build_thread_ports($ENV{'MTR_BUILD_THREAD'});
497476
}
498477

499478
# This is needed for test log evaluation in "gen-build-status-page"
@@ -545,6 +524,7 @@ ()
545524
'im-port=i' => \$im_port, # Instance Manager port.
546525
'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
547526
'im-mysqld2-port=i' => \$im_mysqld2_port, # Port of mysqld, controlled by IM
527+
'mtr-build-thread=i' => \$opt_mtr_build_thread,
548528

549529
# Test case authoring
550530
'record' => \$opt_record,
@@ -627,6 +607,15 @@ ()
627607

628608
$glob_scriptname= basename($0);
629609

610+
if ($opt_mtr_build_thread != 0)
611+
{
612+
set_mtr_build_thread_ports($opt_mtr_build_thread)
613+
}
614+
elsif ($ENV{'MTR_BUILD_THREAD'})
615+
{
616+
$opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
617+
}
618+
630619
# We require that we are in the "mysql-test" directory
631620
# to run mysql-test-run
632621
if (! -f $glob_scriptname)
@@ -775,7 +764,7 @@ ()
775764
{
776765
mtr_report("Using tmpfs in $fs");
777766
$opt_mem= "$fs/var";
778-
$opt_mem .= $ENV{'MTR_BUILD_THREAD'} if $ENV{'MTR_BUILD_THREAD'};
767+
$opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
779768
last;
780769
}
781770
}
@@ -1230,6 +1219,43 @@ ()
12301219
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
12311220
}
12321221

1222+
#
1223+
# To make it easier for different devs to work on the same host,
1224+
# an environment variable can be used to control all ports. A small
1225+
# number is to be used, 0 - 16 or similar.
1226+
#
1227+
# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
1228+
# versions of this script, else a 4.0 test run might conflict with a
1229+
# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
1230+
# all port numbers might not be used in this version of the script.
1231+
#
1232+
# Also note the limitation of ports we are allowed to hand out. This
1233+
# differs between operating systems and configuration, see
1234+
# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
1235+
# But a fairly safe range seems to be 5001 - 32767
1236+
#
1237+
1238+
sub set_mtr_build_thread_ports() {
1239+
my $mtr_build_thread= shift;
1240+
1241+
# Up to two masters, up to three slaves
1242+
$opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
1243+
$opt_slave_myport= $opt_master_myport + 2; # and 3 4
1244+
$opt_ndbcluster_port= $opt_master_myport + 5;
1245+
$opt_ndbcluster_port_slave= $opt_master_myport + 6;
1246+
$im_port= $opt_master_myport + 7;
1247+
$im_mysqld1_port= $opt_master_myport + 8;
1248+
$im_mysqld2_port= $opt_master_myport + 9;
1249+
1250+
if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
1251+
{
1252+
mtr_error("MTR_BUILD_THREAD number results in a port",
1253+
"outside 5001 - 32767",
1254+
"($opt_master_myport - $opt_master_myport + 10)");
1255+
}
1256+
}
1257+
1258+
12331259
sub datadir_setup () {
12341260

12351261
# Make a list of all data_dirs
@@ -1648,7 +1674,7 @@ ()
16481674
$ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
16491675
$ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
16501676
$ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
1651-
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
1677+
$ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
16521678

16531679
$ENV{'EXE_MYSQL'}= $exe_mysql;
16541680

@@ -2048,7 +2074,7 @@ ()
20482074
}
20492075

20502076
# Remove old log files
2051-
foreach my $name (glob("r/*.reject r/*.progress r/*.log r/*.warnings"))
2077+
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
20522078
{
20532079
unlink($name);
20542080
}
@@ -3000,14 +3026,14 @@ ($)
30003026
{
30013027
my ($tinfo)= @_;
30023028

3003-
# Open mysqltest.log
3029+
# Open mysqltest-time
30043030
my $F= IO::File->new($path_timefile) or
30053031
mtr_error("can't open file \"$path_timefile\": $!");
30063032
my $reason;
30073033

30083034
while ( my $line= <$F> )
30093035
{
3010-
# Look for "reason: <reason fo skiping test>"
3036+
# Look for "reason: <reason for skipping test>"
30113037
if ( $line =~ /reason: (.*)/ )
30123038
{
30133039
$reason= $1;
@@ -4762,6 +4788,8 @@ ($)
47624788
slave_port=PORT Specify the port number used by the first slave
47634789
ndbcluster-port=PORT Specify the port number used by cluster
47644790
ndbcluster-port-slave=PORT Specify the port number used by slave cluster
4791+
mtr-build-thread=# Specify unique collection of ports. Can also be set by
4792+
setting the environment variable MTR_BUILD_THREAD.
47654793
47664794
Options for test case authoring
47674795

mysql-test/t/wait_for_socket.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333

3434
###########################################################################
3535

36-
client_args="--silent --socket=$socket_path "
36+
client_args="--silent --socket=$socket_path --connect_timeout=1 "
3737

3838
[ -n "$username" ] && client_args="$client_args --user=$username "
3939
[ -n "$password" ] && client_args="$client_args --password=$password "

0 commit comments

Comments
 (0)