List:Commits« Previous MessageNext Message »
From:monty Date:April 16 2007 1:34pm
Subject:bk commit into 5.1 tree (monty:1.2580)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-04-16 14:34:53+03:00, monty@stripped +21 -0
  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.

  client/mysqltest.c@stripped, 2007-04-16 14:34:50+03:00, monty@stripped +4 -1
    Added missing 'mysql_free_result' (fixed confusing memory leak when sync_with_master
fails)

  mysql-test/mysql-test-run.pl@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +10 -4
    Add the test case name to the instance manager log files

  mysql-test/r/rpl_log_pos.result@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +1 -1
    Made test more portable (for powermac)

  mysql-test/t/myisam-system.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +3 -3
    Use remove_file instead of "system rm"

  mysql-test/t/ndb_autodiscover.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +16
-16
    Use remove_file instead of "system rm"

  mysql-test/t/ndb_loaddatalocal.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +4
-4
    Use remove_file instead of "system rm"

  mysql-test/t/rpl_loaddatalocal.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2
-2
    Use remove_file instead of "system rm"

  mysql-test/t/rpl_log_pos.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +1 -1
    Made test more portable (for powermac)

  mysql-test/t/rpl_misc_functions.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2
-2
    Use remove_file instead of "system rm"

  mysql-test/t/rpl_rbr_to_sbr.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2 -2
    Use remove_file instead of "system rm"

  mysql-test/t/rpl_row_NOW.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2 -2
    Use remove_file instead of "system rm"

  mysql-test/t/rpl_row_sp001.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2 -2
    Use remove_file instead of "system rm"

  mysql-test/t/rpl_row_sp011.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2 -2
    Use remove_file instead of "system rm"

  mysql-test/t/show_check.test@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +2 -1
    Use remove_file instead of "system rm"

  mysys/my_alloc.c@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +0 -2
    Don't return on zero argument, as this may hide other errors

  server-tools/instance-manager/log.cc@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +7
-1
    Log errors to both stdout and stderr (to know in which context we got the error)

  server-tools/instance-manager/thread_registry.cc@stripped, 2007-04-16 14:34:51+03:00,
monty@stripped +3 -4
    Log error before common assert (to know in which context we fail)

  sql-common/client.c@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +3 -1
    Clear field_alloc when it's moved to result set (allows us to always call free_root on
field_alloc)

  sql/ha_ndbcluster.cc@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +1 -1
    Do not terminate ndb_cluster_binary_log before the util thread has finnished.

  sql/ha_ndbcluster.h@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +3 -1
    Do not terminate ndb_cluster_binary_log before the util thread has finnished.

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-04-16 14:34:51+03:00, monty@stripped +21 -1
    Do not terminate ndb_cluster_binary_log before the util thread has finnished.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-5.1

--- 1.36/mysys/my_alloc.c	2007-03-28 21:05:01 +03:00
+++ 1.37/mysys/my_alloc.c	2007-04-16 14:34:51 +03:00
@@ -330,8 +330,6 @@ void free_root(MEM_ROOT *root, myf MyFla
   DBUG_ENTER("free_root");
   DBUG_PRINT("enter",("root: 0x%lx  flags: %u", (long) root, (uint) MyFlags));
 
-  if (!root)					/* QQ: Should be deleted */
-    DBUG_VOID_RETURN; /* purecov: inspected */
   if (MyFlags & MY_MARK_BLOCKS_FREE)
   {
     mark_blocks_free(root);

--- 1.8/mysql-test/t/rpl_misc_functions.test	2007-03-22 16:58:46 +02:00
+++ 1.9/mysql-test/t/rpl_misc_functions.test	2007-04-16 14:34:51 +03:00
@@ -99,5 +99,5 @@ DROP TABLE IF EXISTS t1;
 --sync_slave_with_master
 
 # If all is good, when can cleanup our dump files.
---system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
---system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql

--- 1.131/sql-common/client.c	2007-04-13 09:25:45 +03:00
+++ 1.132/sql-common/client.c	2007-04-16 14:34:51 +03:00
@@ -2604,7 +2604,7 @@ static void mysql_close_free(MYSQL *mysq
 */
 
 void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)),
-                            const char *func_name)
+                            const char *func_name __attribute__((unused)))
 {
 #ifdef MYSQL_CLIENT
   /* Reset connection handle in all prepared statements. */
@@ -2828,6 +2828,7 @@ MYSQL_RES * STDCALL mysql_store_result(M
   result->field_count=	mysql->field_count;
   /* The rest of result members is bzeroed in malloc */
   mysql->fields=0;				/* fields is now in result */
+  clear_alloc_root(&mysql->field_alloc);
   /* just in case this was mistakenly called after mysql_stmt_execute() */
   mysql->unbuffered_fetch_owner= 0;
   DBUG_RETURN(result);				/* Data fetched */
@@ -2877,6 +2878,7 @@ static MYSQL_RES * cli_use_result(MYSQL 
   result->handle=	mysql;
   result->current_row=	0;
   mysql->fields=0;			/* fields is now in result */
+  clear_alloc_root(&mysql->field_alloc);
   mysql->status=MYSQL_STATUS_USE_RESULT;
   mysql->unbuffered_fetch_owner= &result->unbuffered_fetch_cancelled;
   DBUG_RETURN(result);			/* Data is read to be fetched */

--- 1.293/mysql-test/mysql-test-run.pl	2007-04-04 12:37:58 +03:00
+++ 1.294/mysql-test/mysql-test-run.pl	2007-04-16 14:34:51 +03:00
@@ -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)
@@ -3493,7 +3499,7 @@ sub run_testcase ($) {
   # Stop Instance Manager if we are processing an IM-test case.
   # ----------------------------------------------------------------------
   if ( $tinfo->{'component_id'} eq 'im' and
-       !mtr_im_stop($instance_manager, $tinfo->{'name'}) )
+       !mtr_im_stop($instance_manager, $tinfo->{'name'}))
   {
     mtr_error("Failed to stop Instance Manager.")
   }

--- 1.15/server-tools/instance-manager/log.cc	2006-12-31 02:06:33 +02:00
+++ 1.16/server-tools/instance-manager/log.cc	2007-04-16 14:34:51 +03:00
@@ -134,7 +134,10 @@ void log_init()
 
 /*
   The function is intended to log error messages. It precedes a message
-  with date, time and [ERROR] tag and print it to the stderr.
+  with date, time and [ERROR] tag and print it to the stderr and stdout.
+
+  We want to print it on stdout to be able to know in which context we got the
+  error
 
   SYNOPSIS
     log_error()
@@ -146,7 +149,10 @@ void log_error(const char *format, ...)
 {
   va_list args;
   va_start(args, format);
+  log(stdout, "ERROR", format, args);
+  fflush(stdout);
   log(stderr, "ERROR", format, args);
+  fflush(stderr);
   va_end(args);
 }
 

--- 1.4/mysql-test/t/rpl_row_NOW.test	2007-03-01 15:16:36 +02:00
+++ 1.5/mysql-test/t/rpl_row_NOW.test	2007-04-16 14:34:51 +03:00
@@ -67,8 +67,8 @@ DROP DATABASE mysqltest1;
 diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.sql;
 
 # If all is good, when can cleanup our dump files.
-system rm $MYSQLTEST_VARDIR/tmp/NOW_master.sql;
-system rm $MYSQLTEST_VARDIR/tmp/NOW_slave.sql;
+--remove_file $MYSQLTEST_VARDIR/tmp/NOW_master.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/NOW_slave.sql
 
 sync_slave_with_master;
 # End of 5.1 test case

--- 1.5/mysql-test/t/rpl_row_sp001.test	2007-02-20 19:47:45 +02:00
+++ 1.6/mysql-test/t/rpl_row_sp001.test	2007-04-16 14:34:51 +03:00
@@ -140,7 +140,7 @@ sync_slave_with_master;
 diff_files $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_slave.sql;
 
 # If all is good, when can cleanup our dump files.
-system rm $MYSQLTEST_VARDIR/tmp/sp001_master.sql;
-system rm $MYSQLTEST_VARDIR/tmp/sp001_slave.sql;
+--remove_file $MYSQLTEST_VARDIR/tmp/sp001_master.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/sp001_slave.sql
 
 # End of 5.0 test case

--- 1.4/mysql-test/t/rpl_row_sp011.test	2007-02-20 19:47:45 +02:00
+++ 1.5/mysql-test/t/rpl_row_sp011.test	2007-04-16 14:34:51 +03:00
@@ -105,7 +105,7 @@ sync_slave_with_master;
 diff_files $MYSQLTEST_VARDIR/tmp/sp011_master.sql $MYSQLTEST_VARDIR/tmp/sp011_slave.sql;
 
 # If all is good, when can cleanup our dump files.
-system rm $MYSQLTEST_VARDIR/tmp/sp011_master.sql;
-system rm $MYSQLTEST_VARDIR/tmp/sp011_slave.sql;
+--remove_file $MYSQLTEST_VARDIR/tmp/sp011_master.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/sp011_slave.sql
 
 # End of 5.0 test case

--- 1.24/mysql-test/t/ndb_autodiscover.test	2006-01-24 14:56:45 +02:00
+++ 1.25/mysql-test/t/ndb_autodiscover.test	2007-04-16 14:34:51 +03:00
@@ -24,7 +24,7 @@ create table t1(
 
 insert into t1 values(1, "Autodiscover");
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 select * from t1;
 show status like 'handler_discover%';
 
@@ -33,13 +33,13 @@ show status like 'handler_discover%';
 #
 
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 insert into t1 values (2, "Auto 2");
 show status like 'handler_discover%';
 insert into t1 values (3, "Discover 3");
 show status like 'handler_discover%';
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 select * from t1 order by id;
 show status like 'handler_discover%';
 
@@ -48,7 +48,7 @@ show status like 'handler_discover%';
 #
 
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 update t1 set name="Autodiscover" where id = 2;
 show status like 'handler_discover%';
 select * from t1 order by id;
@@ -59,7 +59,7 @@ show status like 'handler_discover%';
 #
 
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 delete from  t1 where id = 3;
 select * from t1 order by id;
 show status like 'handler_discover%';
@@ -111,7 +111,7 @@ show status like 'handler_discover%';
 flush tables;
 
 # Remove the frm file from disk
-system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm
 
 --error 1050
 create table t3(
@@ -168,14 +168,14 @@ show status like 'handler_discover%';
 
 # Remove the frm file from disk
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
 
 show tables from test;
 show status like 'handler_discover%';
 
 # Remove the frm file from disk again
 flush tables;
-system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
 
 --replace_column 6 # 7 # 8 # 9 # 12 # 13 # 15 # 18 #
 show table status;
@@ -290,8 +290,8 @@ insert into t9 values (9);
 system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >>
$NDB_TOOLS_OUTPUT ;
 system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >>
$NDB_TOOLS_OUTPUT ;
 # Remove t6, t7 from disk
-system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ; 
-system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ; 
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
 
 SHOW TABLES;
 
@@ -332,8 +332,8 @@ insert into t9 values (9);
 system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null  ;
 system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null  ;
 # Remove t6, t7 from disk
-system rm $MYSQLTEST_VARDIR/master-data/test/t6.frm > /dev/null ; 
-system rm $MYSQLTEST_VARDIR/master-data/test/t7.frm > /dev/null ; 
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
 
 
 SHOW TABLES LIKE 't6';
@@ -375,9 +375,9 @@ insert into t3 values (3, "ndb table 3")
 insert into t4 values (4);
 
 # Remove t1, t2, t3 from disk
-system rm $MYSQLTEST_VARDIR/master-data/test/t1.frm > /dev/null ; 
-system rm $MYSQLTEST_VARDIR/master-data/test/t2.frm > /dev/null ; 
-system rm $MYSQLTEST_VARDIR/master-data/test/t3.frm > /dev/null ; 
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm
 flush tables;
 
 # Select from the table which only exists in NDB.
@@ -530,7 +530,7 @@ CREATE TABLE t9 (
 insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
 
 #Don't drop the table, instead remove the frm file
-system rm $MYSQLTEST_VARDIR/master-data/test/t9.frm ;
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t9.frm
 
 # Now leave test case, when ndb_autodiscover2 will  run, this 
 # MySQL Server will have been restarted because it has a 

--- 1.443/sql/ha_ndbcluster.cc	2007-04-13 09:25:36 +03:00
+++ 1.444/sql/ha_ndbcluster.cc	2007-04-16 14:34:51 +03:00
@@ -133,7 +133,7 @@ static uint ndbcluster_alter_table_flags
 }
 
 static int ndbcluster_inited= 0;
-static int ndbcluster_terminating= 0;
+int ndbcluster_terminating= 0;
 
 static Ndb* g_ndb= NULL;
 Ndb_cluster_connection* g_ndb_cluster_connection= NULL;

--- 1.175/sql/ha_ndbcluster.h	2007-04-05 12:17:46 +03:00
+++ 1.176/sql/ha_ndbcluster.h	2007-04-16 14:34:51 +03:00
@@ -1004,4 +1004,6 @@ void ndbcluster_print_error(int error, c
 
 static const char ndbcluster_hton_name[]= "ndbcluster";
 static const int ndbcluster_hton_name_length=sizeof(ndbcluster_hton_name)-1;
-
+extern int ndbcluster_terminating;
+extern int ndb_util_thread_running;
+extern pthread_cond_t COND_ndb_util_ready;

--- 1.7/mysql-test/t/rpl_rbr_to_sbr.test	2007-02-20 19:47:45 +02:00
+++ 1.8/mysql-test/t/rpl_rbr_to_sbr.test	2007-04-16 14:34:51 +03:00
@@ -43,5 +43,5 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr
 
 # If all is good, we can remove the files
 
-system rm $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql;
-system rm $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql

--- 1.75/mysql-test/t/show_check.test	2007-03-06 15:44:10 +02:00
+++ 1.76/mysql-test/t/show_check.test	2007-04-16 14:34:51 +03:00
@@ -392,7 +392,8 @@ SHOW TABLE STATUS like 't1';
 --error 1033
 show create table t1;
 drop table if exists t1;
-system rm -f $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
+--error 1,0
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 
 #
 # BUG 12183 -  SHOW OPEN TABLES behavior doesn't match grammar

--- 1.1/mysql-test/t/myisam-system.test	2006-05-03 15:59:13 +03:00
+++ 1.2/mysql-test/t/myisam-system.test	2007-04-16 14:34:51 +03:00
@@ -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

--- 1.10/mysql-test/t/rpl_loaddatalocal.test	2006-10-05 19:52:26 +03:00
+++ 1.11/mysql-test/t/rpl_loaddatalocal.test	2007-04-16 14:34:51 +03:00
@@ -25,7 +25,7 @@ eval select * into outfile '$MYSQLTEST_V
 truncate table t1;
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 eval load data local infile
'$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
-system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
+--remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
 save_master_pos;
 connection slave;
 sync_with_master;
@@ -52,7 +52,7 @@ drop table t1;
 create table t1(a int primary key);
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 eval load data local infile
'$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
-system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
+--remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
 SELECT * FROM t1 ORDER BY a;
 save_master_pos;
 connection slave;

--- 1.285/client/mysqltest.c	2007-03-27 20:26:26 +03:00
+++ 1.286/client/mysqltest.c	2007-04-16 14:34:50 +03:00
@@ -2498,17 +2498,20 @@ wait_for_position:
   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);

--- 1.19/server-tools/instance-manager/thread_registry.cc	2007-02-22 20:59:41 +02:00
+++ 1.20/server-tools/instance-manager/thread_registry.cc	2007-04-16 14:34:51 +03:00
@@ -18,12 +18,9 @@
 #endif
 
 #include "thread_registry.h"
-
-#include <my_global.h>
 #include <thr_alarm.h>
-
 #include <signal.h>
-
+#include "log.h"
 
 #ifndef __WIN__
 /* Kick-off signal handler */
@@ -67,6 +64,8 @@ Thread_registry::~Thread_registry()
   /* Check that no one uses the repository. */
   pthread_mutex_lock(&LOCK_thread_registry);
 
+  if (head.next != &head)
+    log_error("Not all threads died properly\n");
   /* All threads must unregister */
   DBUG_ASSERT(head.next == &head);
 

--- 1.48/mysql-test/r/rpl_log_pos.result	2007-04-02 12:15:07 +03:00
+++ 1.49/mysql-test/r/rpl_log_pos.result	2007-04-16 14:34:51 +03:00
@@ -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.38/mysql-test/t/rpl_log_pos.test	2007-03-29 22:37:59 +03:00
+++ 1.39/mysql-test/t/rpl_log_pos.test	2007-04-16 14:34:51 +03:00
@@ -37,7 +37,7 @@ change master to master_log_pos=178;
 start slave;
 sleep 2;
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 11 # 23 # 33 #
 show slave status;
 connection master;
 --replace_column 3 <Binlog_Ignore_DB>

--- 1.1/mysql-test/t/ndb_loaddatalocal.test	2006-06-14 21:16:28 +03:00
+++ 1.2/mysql-test/t/ndb_loaddatalocal.test	2007-04-16 14:34:51 +03:00
@@ -25,7 +25,7 @@ create table t1(a int) engine=ndb;
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 eval load data local infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
 select count(*) from t1;
-system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile ;
+--remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
 drop table t1;
 
 create table t1(a int) engine=myisam;
@@ -37,7 +37,7 @@ drop table t1;
 create table t1(a int primary key) engine=ndb;
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 eval load data local infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
-system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
+--remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
 select * from t1 order by a;
 drop table t1;
 
@@ -50,7 +50,7 @@ drop table t1;
 create table t1(a int primary key) engine=ndb;
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 eval load data local infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
-system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
+--remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
 select * from t1 order by a;
 drop table t1;
 
@@ -63,7 +63,7 @@ drop table t1;
 create table t1(a int primary key) engine=ndb;
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 eval load data local infile
'$MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile' into table t1;
-system rm $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile;
+--remove_file $MYSQLTEST_VARDIR/master-data/ndb_loaddatalocal.select_outfile
 select * from t1 order by a;
 drop table t1;
 

--- 1.110/sql/ha_ndbcluster_binlog.cc	2007-04-05 16:59:11 +03:00
+++ 1.111/sql/ha_ndbcluster_binlog.cc	2007-04-16 14:34:51 +03:00
@@ -582,10 +582,30 @@ static int ndbcluster_binlog_end(THD *th
   ndbcluster_binlog_inited= 0;
 
 #ifdef HAVE_NDB_BINLOG
+  if (ndb_util_thread_running > 0)
+  {
+    /*
+      Wait for util thread to die (as this uses the injector mutex)
+      There is a very small change that ndb_util_thread dies and the
+      following mutex is freed before it's accessed. This shouldn't
+      however be a likely case as the ndbcluster_binlog_end is supposed to
+      be called before ndb_cluster_end().
+    */
+    pthread_mutex_lock(&LOCK_ndb_util_thread);
+    /* Ensure mutex are not freed if ndb_cluster_end is running at same time */
+    ndb_util_thread_running++;
+    ndbcluster_terminating= 1;
+    pthread_cond_signal(&COND_ndb_util_thread);
+    while (ndb_util_thread_running > 1)
+      pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread);
+    ndb_util_thread_running--;
+    pthread_mutex_unlock(&LOCK_ndb_util_thread);
+  }
+
   /* wait for injector thread to finish */
   ndbcluster_binlog_terminating= 1;
-  pthread_cond_signal(&injector_cond);
   pthread_mutex_lock(&injector_mutex);
+  pthread_cond_signal(&injector_cond);
   while (ndb_binlog_thread_running > 0)
     pthread_cond_wait(&injector_cond, &injector_mutex);
   pthread_mutex_unlock(&injector_mutex);
Thread
bk commit into 5.1 tree (monty:1.2580)monty16 Apr