Commit 48892844 authored by unknown's avatar unknown
Browse files

Clear field_alloc when it's moved to result set (allows us to always call free_root on field_alloc)

Change to use remove_file instead of 'system rm' in a lot of tests. (Should fix some windows test problems)
Removed memory leak in mysql_test if sync_with_master fails.
Do not terminate ndb_cluster_binary_log before the util thread has finnished. This should fix a shutdown bug where a thread is accessing injector_mutex after it's freed.
Patch may fix Bug#27622 "mysqld shutdown, util thread continues, while binlog thread exits"


client/mysqltest.c:
  Added missing 'mysql_free_result' (fixed confusing memory leak when sync_with_master fails)ug
mysql-test/mysql-test-run.pl:
  Add the test case name to the instance manager log files
mysql-test/r/rpl_log_pos.result:
  Made test more portable (for powermac)
mysql-test/t/disabled.def:
  Disabled im_life_cycle (added bug#27851)
mysql-test/t/myisam-system.test:
  Use remove_file instead of "system rm"
mysql-test/t/ndb_autodiscover.test:
  Use remove_file instead of "system rm"
mysql-test/t/ndb_loaddatalocal.test:
  Use remove_file instead of "system rm"
mysql-test/t/rpl_loaddatalocal.test:
  Use remove_file instead of "system rm"
mysql-test/t/rpl_log_pos.test:
  Made test more portable (for powermac)
mysql-test/t/rpl_misc_functions.test:
  Use remove_file instead of "system rm"
mysql-test/t/rpl_rbr_to_sbr.test:
  Use remove_file instead of "system rm"
mysql-test/t/rpl_row_NOW.test:
  Use remove_file instead of "system rm"
mysql-test/t/rpl_row_sp001.test:
  Use remove_file instead of "system rm"
mysql-test/t/rpl_row_sp011.test:
  Use remove_file instead of "system rm"
mysql-test/t/show_check.test:
  Use remove_file instead of "system rm"
mysys/my_alloc.c:
  Don't return on zero argument, as this may hide other errors
server-tools/instance-manager/log.cc:
  Log errors to both stdout and stderr (to know in which context we got the error)
server-tools/instance-manager/thread_registry.cc:
  Log error before common assert (to know in which context we fail)
sql/ha_ndbcluster.cc:
  Do not terminate ndb_cluster_binary_log before the util thread has finnished.
sql/ha_ndbcluster.h:
  Do not terminate ndb_cluster_binary_log before the util thread has finnished.
sql/ha_ndbcluster_binlog.cc:
  Do not terminate ndb_cluster_binary_log before the util thread has finnished.
sql-common/client.c:
  Clear field_alloc when it's moved to result set (allows us to always call free_root on field_alloc)
parent 0a3abcf2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2498,17 +2498,20 @@ void do_sync_with_master2(long offset)
  if (!(res= mysql_store_result(mysql)))
    die("mysql_store_result() returned NULL for '%s'", query_buf);
  if (!(row= mysql_fetch_row(res)))
  {
    mysql_free_result(res);
    die("empty result in %s", query_buf);
  }
  if (!row[0])
  {
    /*
      It may be that the slave SQL thread has not started yet, though START
      SLAVE has been issued ?
    */
    mysql_free_result(res);
    if (tries++ == 30)
      die("could not sync with master ('%s' returned NULL)", query_buf);
    sleep(1); /* So at most we will wait 30 seconds and make 31 tries */
    mysql_free_result(res);
    goto wait_for_position;
  }
  mysql_free_result(res);
+10 −4
Original line number Diff line number Diff line
@@ -3278,9 +3278,9 @@ sub do_after_run_mysqltest($)
}


sub run_testcase_mark_logs($)
sub run_testcase_mark_logs($$)
{
  my ($log_msg)= @_;
  my ($tinfo, $log_msg)= @_;

  # Write a marker to all log files

@@ -3293,6 +3293,12 @@ sub run_testcase_mark_logs($)
    mtr_tofile($mysqld->{path_myerr}, $log_msg);
  }

  if ( $tinfo->{'component_id'} eq 'im')
  {
    mtr_tofile($instance_manager->{path_err}, $log_msg);
    mtr_tofile($instance_manager->{path_log}, $log_msg);
  }

  # ndbcluster log file
  mtr_tofile($path_ndb_testrun_log, $log_msg);

@@ -3419,7 +3425,7 @@ sub run_testcase ($) {
  }

  # Write to all log files to indicate start of testcase
  run_testcase_mark_logs("CURRENT_TEST: $tinfo->{name}\n");
  run_testcase_mark_logs($tinfo, "CURRENT_TEST: $tinfo->{name}\n");

  my $died= mtr_record_dead_children();
  if ($died or $master_restart or $slave_restart)
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ change master to master_log_pos=178;
start slave;
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert
#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	178	#	#	master-bin.000001	No	Yes							0		0	178	#	None		0	No						#	No
#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	178	#	#	master-bin.000001	#	Yes							0		0	178	#	None		0	No						#	No
show master status;
File	Position	Binlog_Do_DB	Binlog_Ignore_DB
master-bin.000001	106	<Binlog_Ignore_DB>	
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
user_limits     : Bug#23921 random failure of user_limits.test

im_options                : Bug#20294 2006-07-24 stewart   Instance manager test im_options fails randomly
im_life_cycle            : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance.
concurrent_innodb        : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
ndb_autodiscover         : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2        : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+3 −3
Original line number Diff line number Diff line
@@ -7,14 +7,14 @@ drop table if exists t1,t2;
--enable_warnings

create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
drop table if exists t1;
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI
--error 1051,6
drop table t1;
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYD ;
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD
--error 1105,6,29
drop table t1;
--error 1051
Loading