Commit 197f1748 authored by msvensson@shellback.(none)'s avatar msvensson@shellback.(none)

Merge shellback.(none):/home/msvensson/mysql/mysql-5.0-maint

into  shellback.(none):/home/msvensson/mysql/mysql-5.1-maint
parents a74123d1 9c737b9b
...@@ -1498,6 +1498,7 @@ void do_exec(struct st_command *command) ...@@ -1498,6 +1498,7 @@ void do_exec(struct st_command *command)
DBUG_ENTER("do_exec"); DBUG_ENTER("do_exec");
DBUG_PRINT("enter", ("cmd: '%s'", cmd)); DBUG_PRINT("enter", ("cmd: '%s'", cmd));
/* Skip leading space */
while (*cmd && my_isspace(charset_info, *cmd)) while (*cmd && my_isspace(charset_info, *cmd))
cmd++; cmd++;
if (!*cmd) if (!*cmd)
...@@ -1507,7 +1508,6 @@ void do_exec(struct st_command *command) ...@@ -1507,7 +1508,6 @@ void do_exec(struct st_command *command)
init_dynamic_string(&ds_cmd, 0, command->query_len+256, 256); init_dynamic_string(&ds_cmd, 0, command->query_len+256, 256);
/* Eval the command, thus replacing all environment variables */ /* Eval the command, thus replacing all environment variables */
do_eval(&ds_cmd, cmd, command->end, TRUE); do_eval(&ds_cmd, cmd, command->end, TRUE);
cmd= ds_cmd.str;
DBUG_PRINT("info", ("Executing '%s' as '%s'", DBUG_PRINT("info", ("Executing '%s' as '%s'",
command->first_argument, cmd)); command->first_argument, cmd));
...@@ -2544,11 +2544,11 @@ void do_get_errcodes(struct st_command *command) ...@@ -2544,11 +2544,11 @@ void do_get_errcodes(struct st_command *command)
- May contain only digits[0-9] and _uppercase_ letters - May contain only digits[0-9] and _uppercase_ letters
*/ */
p++; /* Step past the S */ p++; /* Step past the S */
if (end - p != SQLSTATE_LENGTH) if ((end - p) != SQLSTATE_LENGTH)
die("The sqlstate must be exactly %d chars long", SQLSTATE_LENGTH); die("The sqlstate must be exactly %d chars long", SQLSTATE_LENGTH);
/* Check sqlstate string validity */ /* Check sqlstate string validity */
while (*p && p != end) while (*p && p < end)
{ {
if (my_isdigit(charset_info, *p) || my_isupper(charset_info, *p)) if (my_isdigit(charset_info, *p) || my_isupper(charset_info, *p))
*to_ptr++= *p++; *to_ptr++= *p++;
...@@ -4652,7 +4652,8 @@ void handle_error(struct st_command *command, ...@@ -4652,7 +4652,8 @@ void handle_error(struct st_command *command,
*/ */
if (err_errno == CR_SERVER_LOST || if (err_errno == CR_SERVER_LOST ||
err_errno == CR_SERVER_GONE_ERROR) err_errno == CR_SERVER_GONE_ERROR)
die("require query '%s' failed: %d: %s", command->query, err_errno, err_error); die("require query '%s' failed: %d: %s", command->query,
err_errno, err_error);
/* Abort the run of this test, pass the failed query as reason */ /* Abort the run of this test, pass the failed query as reason */
abort_not_supported_test("Query '%s' failed, required functionality" \ abort_not_supported_test("Query '%s' failed, required functionality" \
...@@ -4669,8 +4670,8 @@ void handle_error(struct st_command *command, ...@@ -4669,8 +4670,8 @@ void handle_error(struct st_command *command,
if (((command->expected_errors.err[i].type == ERR_ERRNO) && if (((command->expected_errors.err[i].type == ERR_ERRNO) &&
(command->expected_errors.err[i].code.errnum == err_errno)) || (command->expected_errors.err[i].code.errnum == err_errno)) ||
((command->expected_errors.err[i].type == ERR_SQLSTATE) && ((command->expected_errors.err[i].type == ERR_SQLSTATE) &&
(strcmp(command->expected_errors.err[i].code.sqlstate, (strncmp(command->expected_errors.err[i].code.sqlstate,
err_sqlstate) == 0))) err_sqlstate, SQLSTATE_LENGTH) == 0)))
{ {
if (!disable_result_log) if (!disable_result_log)
{ {
...@@ -4695,7 +4696,7 @@ void handle_error(struct st_command *command, ...@@ -4695,7 +4696,7 @@ void handle_error(struct st_command *command,
} }
DBUG_PRINT("info",("i: %d expected_errors: %d", i, DBUG_PRINT("info",("i: %d expected_errors: %d", i,
command->expected_errors)); command->expected_errors.count));
if (!disable_result_log) if (!disable_result_log)
{ {
...@@ -5423,6 +5424,9 @@ int main(int argc, char **argv) ...@@ -5423,6 +5424,9 @@ int main(int argc, char **argv)
save_file[0]= 0; save_file[0]= 0;
TMPDIR[0]= 0; TMPDIR[0]= 0;
/* Init expected errors */
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
/* Init connections */ /* Init connections */
memset(connections, 0, sizeof(connections)); memset(connections, 0, sizeof(connections));
connections_end= connections + connections_end= connections +
......
...@@ -311,8 +311,8 @@ our $used_binlog_format; ...@@ -311,8 +311,8 @@ our $used_binlog_format;
our $debug_compiled_binaries; our $debug_compiled_binaries;
our $glob_tot_real_time= 0; our $glob_tot_real_time= 0;
# Default values read from mysqld our %mysqld_variables;
our $default_mysqld_port;
###################################################################### ######################################################################
# #
...@@ -368,7 +368,13 @@ sub main () { ...@@ -368,7 +368,13 @@ sub main () {
initial_setup(); initial_setup();
command_line_setup(); command_line_setup();
check_ndbcluster_support(\%mysqld_variables);
check_ssl_support(\%mysqld_variables);
check_debug_support(\%mysqld_variables);
executable_setup(); executable_setup();
environment_setup(); environment_setup();
signal_setup(); signal_setup();
...@@ -501,7 +507,7 @@ sub initial_setup () { ...@@ -501,7 +507,7 @@ sub initial_setup () {
$exe_slave_mysqld= $exe_slave_mysqld || $exe_mysqld; $exe_slave_mysqld= $exe_slave_mysqld || $exe_mysqld;
# Use the mysqld found above to find out what features are available # Use the mysqld found above to find out what features are available
check_mysqld_features(); collect_mysqld_features();
} }
...@@ -721,7 +727,6 @@ sub command_line_setup () { ...@@ -721,7 +727,6 @@ sub command_line_setup () {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Find out type of logging that are being used # Find out type of logging that are being used
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# NOTE if the default binlog format is changed, this has to be changed # NOTE if the default binlog format is changed, this has to be changed
$used_binlog_format= "stmt"; $used_binlog_format= "stmt";
foreach my $arg ( @opt_extra_mysqld_opt ) foreach my $arg ( @opt_extra_mysqld_opt )
...@@ -762,7 +767,6 @@ sub command_line_setup () { ...@@ -762,7 +767,6 @@ sub command_line_setup () {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Set the "var/" directory, as it is the base for everything else # Set the "var/" directory, as it is the base for everything else
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
$default_vardir= "$glob_mysql_test_dir/var"; $default_vardir= "$glob_mysql_test_dir/var";
if ( ! $opt_vardir ) if ( ! $opt_vardir )
{ {
...@@ -792,25 +796,46 @@ sub command_line_setup () { ...@@ -792,25 +796,46 @@ sub command_line_setup () {
} }
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# If not set, set these to defaults # Set tmpdir
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
$opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir; $opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir;
$opt_tmpdir =~ s,/+$,,; # Remove ending slash if any $opt_tmpdir =~ s,/+$,,; # Remove ending slash if any
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Do sanity checks of command line arguments # Set socket
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if (!$opt_socket)
{
$opt_socket= $mysqld_variables{'socket'};
}
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Look at the command line options and set script flags # Check im suport
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if ( $mysql_version_id < 50000 )
{
# Instance manager is not supported until 5.0
$opt_skip_im= 1;
}
if ( $glob_win32 )
{
mtr_report("Disable Instance manager - not supported on Windows");
$opt_skip_im= 1;
}
# --------------------------------------------------------------------------
# Record flag
# --------------------------------------------------------------------------
if ( $opt_record and ! @opt_cases ) 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");
} }
# --------------------------------------------------------------------------
# Embedded server flag
# --------------------------------------------------------------------------
if ( $opt_embedded_server ) if ( $opt_embedded_server )
{ {
$glob_use_embedded_server= 1; $glob_use_embedded_server= 1;
...@@ -825,11 +850,18 @@ sub command_line_setup () { ...@@ -825,11 +850,18 @@ sub command_line_setup () {
} }
} }
# --------------------------------------------------------------------------
# ps protcol flag
# --------------------------------------------------------------------------
if ( $opt_ps_protocol ) if ( $opt_ps_protocol )
{ {
push(@glob_test_mode, "ps-protocol"); push(@glob_test_mode, "ps-protocol");
} }
# --------------------------------------------------------------------------
# Ndb cluster flags
# --------------------------------------------------------------------------
if ( $opt_with_ndbcluster and $opt_skip_ndbcluster) if ( $opt_with_ndbcluster and $opt_skip_ndbcluster)
{ {
mtr_error("Can't specify both --with-ndbcluster and --skip-ndbcluster"); mtr_error("Can't specify both --with-ndbcluster and --skip-ndbcluster");
...@@ -865,22 +897,33 @@ sub command_line_setup () { ...@@ -865,22 +897,33 @@ sub command_line_setup () {
$opt_ndbconnectstring_slave= "host=localhost:$opt_ndbcluster_port_slave"; $opt_ndbconnectstring_slave= "host=localhost:$opt_ndbcluster_port_slave";
} }
# --------------------------------------------------------------------------
# Bench flags
# --------------------------------------------------------------------------
if ( $opt_small_bench ) if ( $opt_small_bench )
{ {
$opt_bench= 1; $opt_bench= 1;
} }
# --------------------------------------------------------------------------
# Sleep flag
# --------------------------------------------------------------------------
if ( $opt_sleep ) if ( $opt_sleep )
{ {
$opt_sleep_time_after_restart= $opt_sleep; $opt_sleep_time_after_restart= $opt_sleep;
} }
# --------------------------------------------------------------------------
# Gcov flag
# --------------------------------------------------------------------------
if ( $opt_gcov and ! $opt_source_dist ) if ( $opt_gcov and ! $opt_source_dist )
{ {
mtr_error("Coverage test needs the source - please use source dist"); mtr_error("Coverage test needs the source - please use source dist");
} }
# --------------------------------------------------------------------------
# Check debug related options # Check debug related options
# --------------------------------------------------------------------------
if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd ||
$opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug ||
$opt_debugger || $opt_client_debugger ) $opt_debugger || $opt_client_debugger )
...@@ -895,13 +938,9 @@ sub command_line_setup () { ...@@ -895,13 +938,9 @@ sub command_line_setup () {
} }
} }
# Check IM arguments # --------------------------------------------------------------------------
if ( $glob_win32 )
{
mtr_report("Disable Instance manager - not supported on Windows");
$opt_skip_im= 1;
}
# Check valgrind arguments # Check valgrind arguments
# --------------------------------------------------------------------------
if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options) if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options)
{ {
mtr_report("Turning on valgrind for all executables"); mtr_report("Turning on valgrind for all executables");
...@@ -1185,7 +1224,7 @@ sub datadir_setup () { ...@@ -1185,7 +1224,7 @@ sub datadir_setup () {
############################################################################## ##############################################################################
sub check_mysqld_features () { sub collect_mysqld_features () {
# #
# Execute "mysqld --no-defaults --help --verbose", that will # Execute "mysqld --no-defaults --help --verbose", that will
# print out version and a list of all features and settings # print out version and a list of all features and settings
...@@ -1202,7 +1241,6 @@ sub check_mysqld_features () { ...@@ -1202,7 +1241,6 @@ sub check_mysqld_features () {
$exe_mysqld); $exe_mysqld);
} }
my %mysqld_variables;
my $F= IO::File->new($spec_file) or my $F= IO::File->new($spec_file) or
mtr_error("can't open file \"$spec_file\": $!"); mtr_error("can't open file \"$spec_file\": $!");
...@@ -1263,27 +1301,6 @@ sub check_mysqld_features () { ...@@ -1263,27 +1301,6 @@ sub check_mysqld_features () {
mtr_error("Could not find version of MySQL") unless $mysql_version_id; mtr_error("Could not find version of MySQL") unless $mysql_version_id;
mtr_error("Could not find variabes list") unless $found_variable_list_start; mtr_error("Could not find variabes list") unless $found_variable_list_start;
check_ndbcluster_support(\%mysqld_variables);
check_ssl_support(\%mysqld_variables);
check_debug_support(\%mysqld_variables);
if ( $mysql_version_id < 50000 )
{
# Instance manager is not supported until 5.0
$opt_skip_im= 1;
}
if ( $mysql_version_id < 50100 )
{
# Slave cluster is not supported until 5.1
$opt_skip_ndbcluster_slave= 1;
}
# Set default values from mysqld_variables
$opt_socket= $mysqld_variables{'socket'};
$default_mysqld_port = $mysqld_variables{'port'};
} }
...@@ -1516,7 +1533,7 @@ sub environment_setup () { ...@@ -1516,7 +1533,7 @@ sub environment_setup () {
$ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'}; $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'port'};
$ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'}; $ENV{'SLAVE_MYPORT1'}= $slave->[1]->{'port'};
$ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'}; $ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
$ENV{'MYSQL_TCP_PORT'}= $default_mysqld_port; $ENV{'MYSQL_TCP_PORT'}= $mysqld_variables{'port'};
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
...@@ -2006,6 +2023,14 @@ sub check_ndbcluster_support ($) { ...@@ -2006,6 +2023,14 @@ sub check_ndbcluster_support ($) {
} }
$opt_ndbcluster_supported= 1; $opt_ndbcluster_supported= 1;
mtr_report("Using ndbcluster when necessary, mysqld supports it"); mtr_report("Using ndbcluster when necessary, mysqld supports it");
if ( $mysql_version_id < 50100 )
{
# Slave cluster is not supported until 5.1
$opt_skip_ndbcluster_slave= 1;
}
return; return;
} }
......
...@@ -19,7 +19,7 @@ start slave; ...@@ -19,7 +19,7 @@ start slave;
connection master; connection master;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warning --enable_warnings
create table t1 (n int); create table t1 (n int);
insert into t1 values (1); insert into t1 values (1);
save_master_pos; save_master_pos;
......
...@@ -42,7 +42,7 @@ CREATE TABLE db ( ...@@ -42,7 +42,7 @@ CREATE TABLE db (
KEY User (User) KEY User (User)
) )
engine=MyISAM; engine=MyISAM;
--enable-warnings --enable_warnings
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
...@@ -60,7 +60,7 @@ CREATE TABLE host ( ...@@ -60,7 +60,7 @@ CREATE TABLE host (
PRIMARY KEY Host (Host,Db) PRIMARY KEY Host (Host,Db)
) )
engine=MyISAM; engine=MyISAM;
--enable-warnings --enable_warnings
--disable_warnings --disable_warnings
CREATE TABLE user ( CREATE TABLE user (
...@@ -79,7 +79,7 @@ CREATE TABLE user ( ...@@ -79,7 +79,7 @@ CREATE TABLE user (
PRIMARY KEY Host (Host,User) PRIMARY KEY Host (Host,User)
) )
engine=MyISAM; engine=MyISAM;
--enable-warnings --enable_warnings
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y'); INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N'); INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment