List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:April 19 2011 9:59am
Subject:bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4321 to 4322)
View as plain text  
 4322 Magnus Blåudd	2011-04-19 [merge]
      Merge

    modified:
      mysql-test/mysql-test-run.pl
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
 4321 Jonas Oreland	2011-04-19
      ndb - refactor local-key handling in LDM (LQH/ACC/TUP/TUX)

    modified:
      storage/ndb/include/kernel/kernel_types.h
      storage/ndb/include/kernel/signaldata/AccLock.hpp
      storage/ndb/include/kernel/signaldata/NextScan.hpp
      storage/ndb/src/common/debugger/signaldata/AccLock.cpp
      storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
      storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
      storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2011-04-08 13:59:44 +0000
+++ b/mysql-test/mysql-test-run.pl	2011-04-19 09:51:53 +0000
@@ -383,10 +383,13 @@ sub main {
     my $sys_info= My::SysInfo->new();
 
     $opt_parallel= $sys_info->num_cpus();
+    print "num_cpus: $opt_parallel, min_bogomips: " .
+      $sys_info->min_bogomips(). "\n";
     for my $limit (2000, 1500, 1000, 500){
       $opt_parallel-- if ($sys_info->min_bogomips() < $limit);
     }
     my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
+    print "max_par: $max_par\n";
     $opt_parallel= $max_par if ($opt_parallel > $max_par);
     $opt_parallel= $num_tests if ($opt_parallel > $num_tests);
     $opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm());

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-04-11 13:36:12 +0000
+++ b/sql/ha_ndbcluster.cc	2011-04-12 16:14:41 +0000
@@ -8182,7 +8182,6 @@ int ha_ndbcluster::create(const char *na
   bool use_disk= FALSE;
   NdbDictionary::Table::SingleUserMode single_user_mode= NdbDictionary::Table::SingleUserModeLocked;
   bool ndb_sys_table= FALSE;
-  partition_info *part_info;
   int result= 0;
   NdbDictionary::ObjectId objId;
 
@@ -8225,7 +8224,7 @@ int ha_ndbcluster::create(const char *na
     */
     if ((my_errno= write_ndb_file(name)))
       DBUG_RETURN(my_errno);
-    ndbcluster_create_binlog_setup(thd, get_ndb(thd), name, strlen(name),
+    ndbcluster_create_binlog_setup(thd, ndb, name, strlen(name),
                                    m_dbname, m_tabname, FALSE);
     DBUG_RETURN(my_errno);
   }
@@ -8504,8 +8503,7 @@ int ha_ndbcluster::create(const char *na
   }
 
   // Check partition info
-  part_info= form->part_info;
-  if ((my_errno= set_up_partition_info(part_info, form, (void*)&tab)))
+  if ((my_errno= set_up_partition_info(form->part_info, tab)))
     goto abort;
 
   if (tab.getFragmentType() == NDBTAB::HashMapPartition && 
@@ -13713,10 +13711,11 @@ void ha_ndbcluster::set_auto_partitions(
 }
 
 
-int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info)
+int
+ha_ndbcluster::set_range_data(const partition_info *part_info,
+                              NdbDictionary::Table& ndbtab) const
 {
   const uint num_parts = partition_info_num_parts(part_info);
-  NDBTAB *tab= (NDBTAB*)tab_ref;
   int error= 0;
   bool unsigned_flag= part_info->part_expr->unsigned_flag;
   DBUG_ENTER("set_range_data");
@@ -13745,16 +13744,18 @@ int ha_ndbcluster::set_range_data(void *
     }
     range_data[i]= (int32)range_val;
   }
-  tab->setRangeListData(range_data, num_parts);
+  ndbtab.setRangeListData(range_data, num_parts);
 error:
   my_free((char*)range_data, MYF(0));
   DBUG_RETURN(error);
 }
 
-int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
+
+int
+ha_ndbcluster::set_list_data(const partition_info *part_info,
+                             NdbDictionary::Table& ndbtab) const
 {
   const uint num_list_values = partition_info_num_list_values(part_info);
-  NDBTAB *tab= (NDBTAB*)tab_ref;
   int32 *list_data= (int32*)my_malloc(num_list_values*2*sizeof(int32), MYF(0));
   int error= 0;
   bool unsigned_flag= part_info->part_expr->unsigned_flag;
@@ -13780,7 +13781,7 @@ int ha_ndbcluster::set_list_data(void *t
     list_data[2*i]= (int32)list_val;
     list_data[2*i+1]= list_entry->partition_id;
   }
-  tab->setRangeListData(list_data, 2*num_list_values);
+  ndbtab.setRangeListData(list_data, 2*num_list_values);
 error:
   my_free((char*)list_data, MYF(0));
   DBUG_RETURN(error);
@@ -13799,18 +13800,15 @@ error:
   implement the function to map to a partition.
 */
 
-uint ha_ndbcluster::set_up_partition_info(partition_info *part_info,
-                                          TABLE *table,
-                                          void *tab_par)
+int
+ha_ndbcluster::set_up_partition_info(partition_info *part_info,
+                                     NdbDictionary::Table& ndbtab) const
 {
   uint32 frag_data[MAX_PARTITIONS];
   char *ts_names[MAX_PARTITIONS];
   ulong fd_index= 0, i, j;
-  NDBTAB *tab= (NDBTAB*)tab_par;
   NDBTAB::FragmentType ftype= NDBTAB::UserDefined;
   partition_element *part_elem;
-  bool first= TRUE;
-  uint tot_ts_name_len;
   List_iterator<partition_element> part_it(part_info->partitions);
   int error;
   DBUG_ENTER("ha_ndbcluster::set_up_partition_info");
@@ -13824,7 +13822,7 @@ uint ha_ndbcluster::set_up_partition_inf
 
     for (i= 0; i < part_info->part_field_list.elements; i++)
     {
-      NDBCOL *col= tab->getColumn(fields[i]->field_index);
+      NDBCOL *col= ndbtab.getColumn(fields[i]->field_index);
       DBUG_PRINT("info",("setting dist key on %s", col->getName()));
       col->setPartitionKey(TRUE);
     }
@@ -13856,25 +13854,24 @@ uint ha_ndbcluster::set_up_partition_inf
     col.setNullable(FALSE);
     col.setPrimaryKey(FALSE);
     col.setAutoIncrement(FALSE);
-    tab->addColumn(col);
+    ndbtab.addColumn(col);
     if (part_info->part_type == RANGE_PARTITION)
     {
-      if ((error= set_range_data((void*)tab, part_info)))
+      if ((error= set_range_data(part_info, ndbtab)))
       {
         DBUG_RETURN(error);
       }
     }
     else if (part_info->part_type == LIST_PARTITION)
     {
-      if ((error= set_list_data((void*)tab, part_info)))
+      if ((error= set_list_data(part_info, ndbtab)))
       {
         DBUG_RETURN(error);
       }
     }
   }
-  tab->setFragmentType(ftype);
+  ndbtab.setFragmentType(ftype);
   i= 0;
-  tot_ts_name_len= 0;
   do
   {
     uint ng;
@@ -13897,13 +13894,12 @@ uint ha_ndbcluster::set_up_partition_inf
         frag_data[fd_index++]= ng;
       } while (++j < partition_info_num_subparts(part_info));
     }
-    first= FALSE;
   } while (++i < partition_info_num_parts(part_info));
 
   const bool use_default_num_parts =
     partition_info_use_default_num_partitions(part_info);
-  tab->setDefaultNoPartitionsFlag(use_default_num_parts);
-  tab->setLinearFlag(part_info->linear_hash_ind);
+  ndbtab.setDefaultNoPartitionsFlag(use_default_num_parts);
+  ndbtab.setLinearFlag(part_info->linear_hash_ind);
   {
     ha_rows max_rows= table_share->max_rows;
     ha_rows min_rows= table_share->min_rows;
@@ -13911,12 +13907,12 @@ uint ha_ndbcluster::set_up_partition_inf
       max_rows= min_rows;
     if (max_rows != (ha_rows)0) /* default setting, don't set fragmentation */
     {
-      tab->setMaxRows(max_rows);
-      tab->setMinRows(min_rows);
+      ndbtab.setMaxRows(max_rows);
+      ndbtab.setMinRows(min_rows);
     }
   }
-  tab->setFragmentCount(fd_index);
-  tab->setFragmentData(frag_data, fd_index);
+  ndbtab.setFragmentCount(fd_index);
+  ndbtab.setFragmentData(frag_data, fd_index);
   DBUG_RETURN(0);
 }
 

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2011-03-07 14:06:01 +0000
+++ b/sql/ha_ndbcluster.h	2011-04-12 16:06:13 +0000
@@ -640,11 +640,12 @@ private:
   bool has_null_in_unique_index(uint idx_no) const;
   bool check_index_fields_not_null(KEY *key_info);
 
-  uint set_up_partition_info(partition_info *part_info,
-                             TABLE *table,
-                             void *tab);
-  int set_range_data(void *tab, partition_info* part_info);
-  int set_list_data(void *tab, partition_info* part_info);
+  int set_up_partition_info(partition_info *part_info,
+                            NdbDictionary::Table&) const;
+  int set_range_data(const partition_info* part_info,
+                     NdbDictionary::Table&) const;
+  int set_list_data(const partition_info* part_info,
+                    NdbDictionary::Table&) const;
   int ndb_pk_update_row(THD *thd, 
                         const uchar *old_data, uchar *new_data,
                         uint32 old_part_id);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4321 to 4322) Magnus Blåudd19 Apr