List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:February 16 2011 3:18pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4202)
View as plain text  
#At file:///home/msvensson/mysql/tmp/tefwzfSeis/mysql-5.1-telco-7.0/ based on revid:jonas@stripped-w1018jc9uhrmy92f

 4202 Magnus Blåudd	2011-02-16 [merge]
      Merge

    modified:
      sql/ha_ndbcluster.cc
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-02-16 08:33:08 +0000
+++ b/sql/ha_ndbcluster.cc	2011-02-16 10:06:16 +0000
@@ -2051,15 +2051,19 @@ int ha_ndbcluster::get_metadata(THD *thd
     Approx. write size in bytes over transporter
   */
   m_bytes_per_write= 12 + tab->getRowSizeInBytes() + 4 * tab->getNoOfColumns();
-  if ((error= open_indexes(thd, ndb, table, FALSE)) == 0)
-  {
-    ndbtab_g.release();
+
+  /* Open indexes */
+  if ((error= open_indexes(thd, ndb, table, FALSE)) != 0)
+    goto err;
+
+  ndbtab_g.release();
+
 #ifdef HAVE_NDB_BINLOG
-    ndbcluster_read_binlog_replication(thd, ndb, m_share, m_table,
-                                       ::server_id, table, FALSE);
+  ndbcluster_read_binlog_replication(thd, ndb, m_share, m_table,
+                                     ::server_id, table, FALSE);
 #endif
-    DBUG_RETURN(0);
-  }
+
+  DBUG_RETURN(0);
 
 err:
   ndbtab_g.invalidate();
@@ -9597,30 +9601,31 @@ int ha_ndbcluster::open(const char *name
   DBUG_ENTER("ha_ndbcluster::open");
   DBUG_PRINT("enter", ("name: %s  mode: %d  test_if_locked: %d",
                        name, mode, test_if_locked));
-  
-  /*
-    Setup ref_length to make room for the whole 
-    primary key to be written in the ref variable
-  */
-  
+
   if (bitmap_init(&m_save_read_set, NULL, table_share->fields, FALSE))
   {
     DBUG_RETURN(1);
   }
-  if (table_share->primary_key != MAX_KEY) 
+
+  if (table_share->primary_key != MAX_KEY)
   {
+    /*
+      Setup ref_length to make room for the whole
+      primary key to be written in the ref variable
+    */
     key= table->key_info+table_share->primary_key;
     ref_length= key->key_length;
   }
-  else // (table_share->primary_key == MAX_KEY) 
+  else
   {
     if (m_user_defined_partitioning)
     {
+      /* Add space for partid in ref */
       ref_length+= sizeof(m_part_id);
     }
   }
-
   DBUG_PRINT("info", ("ref_length: %d", ref_length));
+
   {
     char* bitmap_array;
     uint extra_hidden_keys= table_share->primary_key != MAX_KEY ? 0 : 1;

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4202) Magnus Blåudd16 Feb