MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Stewart Smith Date:June 4 2005 8:14am
Subject:bk commit into 4.1 tree (stewart:1.2313) BUG#9826
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of stewart. When stewart 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.2313 05/06/04 18:14:34 stewart@stripped +2 -0
  BUG#10948 NDB Replication: Race condition with ALTER/DROP table
  BUG#9826  Server crash on schema change ("drop table", "alter table") with NDB
  
  See note on 10948 for detailed explanation.
  
  struct a { void* a; long long b[1]; };
  
  on PPC32 (and 32bit pa risc): 16
  on x86: 12
  
  so a malloc(sizeof(void*)+extra_bits) is wrong.
  
  Assuming that the long long is 64 bit aligned as non-aligned 64bit accesses
  are rather expensive on ppc.
  
  Thanks to paulus for doing the PPC port of valgrind.
  Without which I would no doubt still be trying to find this.

  ndb/src/ndbapi/DictCache.hpp
    1.7 05/06/04 18:14:28 stewart@stripped +1 -1
    Add warning about having to be the last member in the structure

  ndb/src/ndbapi/DictCache.cpp
    1.12 05/06/04 18:14:28 stewart@stripped +2 -1
    Fix allocation size for Ndb_local_table_info for architectures such as PPC and PA-RISC (32bit)
    where
    struct a { void* a; long long b;};
    is 64 bit aligned (i.e. sizeof(struct a)==16)

# 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:	stewart
# Host:	kennedy.(none)
# Root:	/home/stewart/Documents/MySQL/4.1/bug10948

--- 1.11/ndb/src/ndbapi/DictCache.cpp	2005-03-23 08:12:07 +11:00
+++ 1.12/ndb/src/ndbapi/DictCache.cpp	2005-06-04 18:14:28 +10:00
@@ -24,7 +24,8 @@
 Ndb_local_table_info *
 Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz)
 {
-  Uint32 tot_size= sizeof(NdbTableImpl *) + ((sz+7)>>3)<<3; // round to Uint64
+  Uint32 tot_size= sizeof(Ndb_local_table_info) - sizeof(Uint64)
+    + ((sz+7) & ~7); // round to Uint64
   void *data= malloc(tot_size);
   if (data == 0)
     return 0;

--- 1.6/ndb/src/ndbapi/DictCache.hpp	2004-12-20 22:36:03 +11:00
+++ 1.7/ndb/src/ndbapi/DictCache.hpp	2005-06-04 18:14:28 +10:00
@@ -33,7 +33,7 @@
   static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0);
   static void destroy(Ndb_local_table_info *);
   NdbTableImpl *m_table_impl;
-  Uint64 m_local_data[1];
+  Uint64 m_local_data[1]; // Must be last member. Used to access extra space.
 private:
   Ndb_local_table_info(NdbTableImpl *table_impl);
   ~Ndb_local_table_info();
Thread
bk commit into 4.1 tree (stewart:1.2313) BUG#9826Stewart Smith4 Jun