From: knielsen Date: June 23 2006 1:05pm Subject: bk commit into 5.1 tree (knielsen:1.2211) List-Archive: http://lists.mysql.com/commits/8141 Message-Id: Below is the list of changes that have just been committed into a local 5.1 repository of knielsen. When knielsen 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 1.2211 06/06/23 15:05:15 knielsen@stripped +5 -0 Merge mysql.com:/usr/local/mysql/mysql-5.1-vg-apr2 into mysql.com:/usr/local/mysql/tmp-5.1 sql/rpl_injector.h 1.5 06/06/23 15:05:09 knielsen@stripped +0 -0 Auto merged sql/rpl_injector.cc 1.5 06/06/23 15:05:09 knielsen@stripped +0 -0 Auto merged sql/mysqld.cc 1.564 06/06/23 15:05:09 knielsen@stripped +0 -0 Auto merged sql/ha_ndbcluster.cc 1.334 06/06/23 15:05:08 knielsen@stripped +0 -0 Auto merged server-tools/instance-manager/instance_options.cc 1.36 06/06/23 15:05:08 knielsen@stripped +0 -0 Auto merged # 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: knielsen # Host: rt.int.sifira.dk # Root: /usr/local/mysql/tmp-5.1/RESYNC --- 1.563/sql/mysqld.cc 2006-06-23 01:49:15 +02:00 +++ 1.564/sql/mysqld.cc 2006-06-23 15:05:09 +02:00 @@ -28,6 +28,10 @@ #include "ha_myisam.h" +#ifdef HAVE_ROW_BASED_REPLICATION +#include "rpl_injector.h" +#endif + #ifdef WITH_INNOBASE_STORAGE_ENGINE #define OPT_INNODB_DEFAULT 1 #else @@ -1185,6 +1189,9 @@ what they have that is dependent on the binlog */ ha_binlog_end(current_thd); +#ifdef HAVE_ROW_BASED_REPLICATION + injector::free_instance(); +#endif mysql_bin_log.cleanup(); #ifdef HAVE_REPLICATION @@ -1263,13 +1270,13 @@ MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); DBUG_PRINT("quit", ("Error messages freed")); /* Tell main we are ready */ + logger.cleanup_end(); (void) pthread_mutex_lock(&LOCK_thread_count); DBUG_PRINT("quit", ("got thread count lock")); ready_to_exit=1; /* do the broadcast inside the lock to ensure that my_end() is not called */ (void) pthread_cond_broadcast(&COND_thread_count); (void) pthread_mutex_unlock(&LOCK_thread_count); - logger.cleanup_end(); /* The following lines may never be executed as the main thread may have --- 1.333/sql/ha_ndbcluster.cc 2006-06-22 21:59:42 +02:00 +++ 1.334/sql/ha_ndbcluster.cc 2006-06-23 15:05:08 +02:00 @@ -317,7 +317,7 @@ my_bool not_used __attribute__((unused))) { *length= sizeof(thd_ndb_share->key); - return (byte*) thd_ndb_share->key; + return (byte*) &thd_ndb_share->key; } Thd_ndb::Thd_ndb() @@ -371,9 +371,9 @@ DBUG_ENTER("Thd_ndb::get_open_table"); HASH_SEARCH_STATE state; THD_NDB_SHARE *thd_ndb_share= - (THD_NDB_SHARE*)hash_first(&open_tables, (byte *)key, sizeof(key), &state); + (THD_NDB_SHARE*)hash_first(&open_tables, (byte *)&key, sizeof(key), &state); while (thd_ndb_share && thd_ndb_share->key != key) - thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (byte *)key, sizeof(key), &state); + thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (byte *)&key, sizeof(key), &state); if (thd_ndb_share == 0) { thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root, --- 1.35/server-tools/instance-manager/instance_options.cc 2006-06-19 13:17:09 +02:00 +++ 1.36/server-tools/instance-manager/instance_options.cc 2006-06-23 15:05:08 +02:00 @@ -420,8 +420,13 @@ const char *tmp; char *end; - if (!mysqld_path.str && !(mysqld_path.str= strdup_root(&alloc, default_path))) - goto err; + if (!mysqld_path.str) + { + // Need one extra byte, as convert_dirname() adds a slash at the end. + if (!(mysqld_path.str= alloc_root(&alloc, strlen(default_path) + 2))) + goto err; + strcpy(mysqld_path.str, default_path); + } // it's safe to cast this to char* since this is a buffer we are allocating end= convert_dirname((char*)mysqld_path.str, mysqld_path.str, NullS); --- 1.4/sql/rpl_injector.cc 2006-05-05 08:45:53 +02:00 +++ 1.5/sql/rpl_injector.cc 2006-06-23 15:05:09 +02:00 @@ -155,6 +155,16 @@ return s_injector; } +void injector::free_instance() +{ + injector *inj = s_injector; + + if (inj != 0) + { + s_injector= 0; + delete inj; + } +} injector::transaction injector::new_trans(THD *thd) --- 1.4/sql/rpl_injector.h 2006-05-05 08:45:53 +02:00 +++ 1.5/sql/rpl_injector.h 2006-06-23 15:05:09 +02:00 @@ -59,6 +59,11 @@ */ static injector *instance(); + /* + Delete the singleton instance (if allocated). Used during server shutdown. + */ + static void free_instance(); + /* A transaction where rows can be added.