List:Commits« Previous MessageNext Message »
From:knielsen Date:June 19 2006 10:23pm
Subject:bk commit into 5.1 tree (knielsen:1.2211) BUG#20549
View as plain text  
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/20 00:23:01 knielsen@stripped +1 -0
  BUG#20549: Fix missing memory initialization.
  
  Some values were not initialized:
  
   - NDB binlog thread thd->variables.pseudo_thread_id.
   - Table null bytes.

  sql/ha_ndbcluster_binlog.cc
    1.66 06/06/20 00:22:57 knielsen@stripped +11 -1
    BUG#20549: Fix missing memory initialization.

# 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/mysql-5.1tmp

--- 1.65/sql/ha_ndbcluster_binlog.cc	2006-06-14 01:20:29 +02:00
+++ 1.66/sql/ha_ndbcluster_binlog.cc	2006-06-20 00:22:57 +02:00
@@ -313,6 +313,10 @@
     // allocate memory on ndb share so it can be reused after online alter table
     share->record[0]= (byte*) alloc_root(&share->mem_root, table->s->rec_buff_length);
     share->record[1]= (byte*) alloc_root(&share->mem_root, table->s->rec_buff_length);
+    // We will store the fields explicitly later, but the null_bytes must be
+    // initialized here.
+    bzero(share->record[0], table->s->null_bytes);
+    bzero(share->record[1], table->s->null_bytes);
   }
   {
     my_ptrdiff_t row_offset= share->record[0] - table->record[0];
@@ -3275,6 +3279,13 @@
   thd= new THD; /* note that contructor of THD uses DBUG_ */
   THD_CHECK_SENTRY(thd);
 
+  /* We need to set thd->thread_id before thd->store_globals, or it will
+     set an invalid value for thd->variables.pseudo_thread_id.
+  */
+  pthread_mutex_lock(&LOCK_thread_count);
+  thd->thread_id= thread_id++;
+  pthread_mutex_unlock(&LOCK_thread_count);
+
   thd->thread_stack= (char*) &thd; /* remember where our stack is */
   if (thd->store_globals())
   {
@@ -3307,7 +3318,6 @@
   pthread_detach_this_thread();
   thd->real_id= pthread_self();
   pthread_mutex_lock(&LOCK_thread_count);
-  thd->thread_id= thread_id++;
   threads.append(thd);
   pthread_mutex_unlock(&LOCK_thread_count);
   thd->lex->start_transaction_opt= 0;
Thread
bk commit into 5.1 tree (knielsen:1.2211) BUG#20549knielsen20 Jun