List:Commits« Previous MessageNext Message »
From:John David Duncan Date:October 1 2011 1:06am
Subject:bzr push into mysql-5.5-cluster branch (john.duncan:3578 to 3579)
View as plain text  
 3579 John David Duncan	2011-09-30
      Coerce workitem.inline_buffer to be suitably aligned to hold a bigint.

    modified:
      storage/ndb/memcache/include/workitem.h
      storage/ndb/memcache/src/Record.cc
      storage/ndb/memcache/src/workitem.c
 3578 John David Duncan	2011-09-30
      Online reconfiguration.  
      This revision compiles and passes the test suite on my laptop.

    modified:
      mysql-test/lib/My/Memcache.pm
      mysql-test/suite/ndb_memcache/include/datatypes_tables.inc
      mysql-test/suite/ndb_memcache/t/type_char.test
      storage/ndb/memcache/sandbox.sh.in
      storage/ndb/memcache/src/ConnQueryPlanSet.cc
      storage/ndb/memcache/src/ndb_worker.cc
      storage/ndb/memcache/src/schedulers/S_sched.cc
      storage/ndb/memcache/src/schedulers/S_sched.h
=== modified file 'storage/ndb/memcache/include/workitem.h'
--- a/storage/ndb/memcache/include/workitem.h	2011-09-23 18:29:30 +0000
+++ b/storage/ndb/memcache/include/workitem.h	2011-10-01 01:01:07 +0000
@@ -77,7 +77,10 @@ typedef struct workitem {
   unsigned char rowbuf2_cls;   /*! Slab class id for row_buffer_2 */
   unsigned char keybuf1_cls;   /*! Slab class of ndb key; 0 = stored inline */
   unsigned char keybuf2_cls;   /*! Slab class id for key_buffer_2 */
-  char inline_buffer[WORKITEM_MIN_INLINE_BUF];  /*! Must be the final item */
+  union {
+    char buffer[WORKITEM_MIN_INLINE_BUF];  
+    uint64_t coerce_8byte_alignment;
+  } inline_buffer;             /*! Must be the final item */
 } workitem;
 
 

=== modified file 'storage/ndb/memcache/src/Record.cc'
--- a/storage/ndb/memcache/src/Record.cc	2011-09-29 19:13:43 +0000
+++ b/storage/ndb/memcache/src/Record.cc	2011-10-01 01:01:07 +0000
@@ -297,7 +297,6 @@ void Record::pad_offset_for_alignment() 
     alignment = 8;
   }
   else if(! handlers[index]->contains_string) {
-//    alignment = specs[index].column->getSize();
      alignment = specs[index].column->getSizeInBytes();
   }
 

=== modified file 'storage/ndb/memcache/src/workitem.c'
--- a/storage/ndb/memcache/src/workitem.c	2011-09-23 18:29:30 +0000
+++ b/storage/ndb/memcache/src/workitem.c	2011-10-01 01:01:07 +0000
@@ -79,7 +79,7 @@ void workitem__initialize(workitem *item
     item->ndb_key_buffer = pipeline_alloc(pipeline, item->keybuf1_cls);
   }
   else {
-    item->ndb_key_buffer = & item->inline_buffer[0];
+    item->ndb_key_buffer = & item->inline_buffer.buffer[0];
   }
 }
 
@@ -133,7 +133,7 @@ workitem *new_workitem_for_get_op(workit
   if((workitem_actual_inline_buffer_size - 3) > (2 * nkey)) {    
    /* use space at the end of the inline buffer */
     newitem->key_buffer_2 = 
-        & newitem->inline_buffer[0] + workitem_actual_inline_buffer_size - nkey;
+        & newitem->inline_buffer.buffer[0] + workitem_actual_inline_buffer_size - nkey;
   }
   else {
     newitem->keybuf2_cls = pipeline_get_size_class_id(nkey);
@@ -211,7 +211,7 @@ void workitem_free(workitem *item)
 
 size_t workitem_get_key_buf_size(int nkey) {
   size_t bufsz;
-  bufsz = nkey + 3;
-  return (bufsz < 9) ? 9 : bufsz;
+  bufsz = nkey + 3;       // at least key + 2 length bytes + null terminator
+  return (bufsz < 9) ? 9 : bufsz;  // A packed DECIMAL could ned 9 bytes
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster branch (john.duncan:3578 to 3579) John David Duncan2 Oct