Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson 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, 2006-11-21 13:58:26+01:00, msvensson@neptunus.(none) +1 -0
No need for ndb_util_thread to have two different ndb objects allocated. Use the thd_ndb
one and remove the other one.
sql/ha_ndbcluster.cc@stripped, 2006-11-21 13:58:22+01:00, msvensson@neptunus.(none) +14 -19
No need for ndb_util_thread to have two different ndb objects allocated. Use the
thd_ndb one and remove the other one.
# 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: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.1
--- 1.370/sql/ha_ndbcluster.cc 2006-11-21 13:58:38 +01:00
+++ 1.371/sql/ha_ndbcluster.cc 2006-11-21 13:58:38 +01:00
@@ -8156,9 +8156,9 @@ ha_ndbcluster::update_table_comment(
pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
{
THD *thd; /* needs to be first for thread_stack */
- Ndb* ndb;
struct timespec abstime;
List<NDB_SHARE> util_open_tables;
+ Thd_ndb *thd_ndb;
my_thread_init();
DBUG_ENTER("ndb_util_thread");
@@ -8166,17 +8166,15 @@ pthread_handler_t ndb_util_thread_func(v
thd= new THD; /* note that contructor of THD uses DBUG_ */
THD_CHECK_SENTRY(thd);
- ndb= new Ndb(g_ndb_cluster_connection, "");
pthread_detach_this_thread();
ndb_util_thread= pthread_self();
thd->thread_stack= (char*)&thd; /* remember where our stack is */
- if (thd->store_globals() || (ndb->init() != 0))
+ if (thd->store_globals())
{
thd->cleanup();
delete thd;
- delete ndb;
DBUG_RETURN(NULL);
}
thd->init_for_queries();
@@ -8218,16 +8216,14 @@ pthread_handler_t ndb_util_thread_func(v
}
pthread_mutex_unlock(&LOCK_ndb_util_thread);
+ /* Get thd_ndb for this thread */
+ if (!(thd_ndb= ha_ndbcluster::seize_thd_ndb()))
{
- Thd_ndb *thd_ndb;
- if (!(thd_ndb= ha_ndbcluster::seize_thd_ndb()))
- {
- sql_print_error("Could not allocate Thd_ndb object");
- goto ndb_util_thread_end;
- }
- set_thd_ndb(thd, thd_ndb);
- thd_ndb->options|= TNO_NO_LOG_SCHEMA_OP;
+ sql_print_error("Could not allocate Thd_ndb object");
+ goto ndb_util_thread_end;
}
+ set_thd_ndb(thd, thd_ndb);
+ thd_ndb->options|= TNO_NO_LOG_SCHEMA_OP;
#ifdef HAVE_NDB_BINLOG
if (ndb_extra_logging && ndb_binlog_running)
@@ -8310,22 +8306,22 @@ pthread_handler_t ndb_util_thread_func(v
}
#endif /* HAVE_NDB_BINLOG */
DBUG_PRINT("ndb_util_thread",
- ("Fetching commit count for: %s",
- share->key));
+ ("Fetching commit count for: %s", share->key));
- /* Contact NDB to get commit count for table */
- ndb->setDatabaseName(share->db);
struct Ndb_statistics stat;
-
uint lock;
pthread_mutex_lock(&share->mutex);
lock= share->commit_count_lock;
pthread_mutex_unlock(&share->mutex);
{
+ /* Contact NDB to get commit count for table */
+ Ndb* ndb= thd_ndb->ndb;
+ ndb->setDatabaseName(share->db);
Ndb_table_guard ndbtab_g(ndb->getDictionary(), share->table_name);
if (ndbtab_g.get_table() &&
- ndb_get_table_statistics(NULL, false, ndb, ndbtab_g.get_table(), &stat)
== 0)
+ ndb_get_table_statistics(NULL, false, ndb,
+ ndbtab_g.get_table(), &stat) == 0)
{
char buff[22], buff2[22];
DBUG_PRINT("ndb_util_thread",
@@ -8381,7 +8377,6 @@ ndb_util_thread_end:
net_end(&thd->net);
thd->cleanup();
delete thd;
- delete ndb;
DBUG_PRINT("exit", ("ndb_util_thread"));
my_thread_end();
pthread_exit(0);
| Thread |
|---|
| • bk commit into 5.1 tree (msvensson:1.2369) | msvensson | 21 Nov |