List:Commits« Previous MessageNext Message »
From:knielsen Date:June 23 2006 1:58pm
Subject:bk commit into 5.1 tree (knielsen:1.2211)
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/23 13:58:42 knielsen@stripped +4 -0
  Merge mysql.com:/usr/local/mysql/mysql-5.1
  into  mysql.com:/usr/local/mysql/mysql-5.1-test

  sql/sql_class.cc
    1.270 06/06/23 13:58:36 knielsen@stripped +0 -0
    Auto merged

  sql/mysqld.cc
    1.564 06/06/23 13:58:34 knielsen@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster_binlog.cc
    1.70 06/06/23 13:58:34 knielsen@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.cc
    1.334 06/06/23 13:58:34 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/mysql-5.1-test/RESYNC

--- 1.563/sql/mysqld.cc	2006-06-23 01:49:15 +02:00
+++ 1.564/sql/mysqld.cc	2006-06-23 13:58:34 +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.269/sql/sql_class.cc	2006-06-22 11:37:43 +02:00
+++ 1.270/sql/sql_class.cc	2006-06-23 13:58:36 +02:00
@@ -2506,15 +2506,19 @@
   int n_null_bytes= table->s->null_bytes;
   byte *ptr;
   uint i;
-  my_ptrdiff_t const offset= (my_ptrdiff_t) (record - (byte*)
-                                             table->record[0]);
+  my_ptrdiff_t const rec_offset= record - table->record[0];
+  my_ptrdiff_t const def_offset= table->s->default_values - table->record[0];
   memcpy(row_data, record, n_null_bytes);
   ptr= row_data+n_null_bytes;
 
   for (i= 0 ; (field= *p_field) ; i++, p_field++)
   {
     if (bitmap_is_set(cols,i))
+    {
+      my_ptrdiff_t const offset=
+        field->is_null(rec_offset) ? def_offset : rec_offset;
       ptr= (byte*)field->pack((char *) ptr, field->ptr + offset);
+    }
   }
   return (static_cast<my_size_t>(ptr - row_data));
 }

--- 1.333/sql/ha_ndbcluster.cc	2006-06-22 21:59:42 +02:00
+++ 1.334/sql/ha_ndbcluster.cc	2006-06-23 13:58:34 +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.69/sql/ha_ndbcluster_binlog.cc	2006-06-23 01:49:15 +02:00
+++ 1.70/sql/ha_ndbcluster_binlog.cc	2006-06-23 13:58:34 +02:00
@@ -311,8 +311,10 @@
   if (!reopen)
   {
     // 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);
+    (void)multi_alloc_root(&share->mem_root,
+                           &(share->record[0]), table->s->rec_buff_length,
+                           &(share->record[1]), table->s->rec_buff_length,
+                           NULL);
   }
   {
     my_ptrdiff_t row_offset= share->record[0] - table->record[0];
@@ -2159,6 +2161,9 @@
     break;
   }
 
+  // Set all fields non-null.
+  if(binlog_index->s->null_bytes > 0)
+    bzero(binlog_index->record[0], binlog_index->s->null_bytes);
   binlog_index->field[0]->store(row.master_log_pos);
   binlog_index->field[1]->store(row.master_log_file,
                                 strlen(row.master_log_file),
@@ -3275,6 +3280,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 +3319,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;
@@ -3643,6 +3654,10 @@
             injector::transaction::table tbl(table, TRUE);
             int ret= trans.use_table(::server_id, tbl);
             DBUG_ASSERT(ret == 0);
+
+            // Set all fields non-null.
+            if(table->s->null_bytes > 0)
+              bzero(table->record[0], table->s->null_bytes);
             table->field[0]->store((longlong)::server_id);
             table->field[1]->store((longlong)gci);
             trans.write_row(::server_id,
Thread
bk commit into 5.1 tree (knielsen:1.2211)knielsen23 Jun