List:Internals« Previous MessageNext Message »
From:mikael Date:November 14 2005 11:44pm
Subject:bk commit into 5.1 tree (mikron:1.1960)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron 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.1960 05/11/15 00:43:55 mikron@stripped +1 -0
  WL #2604: Partition Management
  More fixes after merge

  sql/ha_ndbcluster.cc
    1.219 05/11/15 00:43:44 mikron@stripped +25 -18
    More fixes after merge

# 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:	mikron
# Host:	c-430be253.1238-1-64736c10.cust.bredbandsbolaget.se
# Root:	/Users/mikron/wl2604_new

--- 1.218/sql/ha_ndbcluster.cc	2005-11-15 04:45:04 +01:00
+++ 1.219/sql/ha_ndbcluster.cc	2005-11-15 00:43:44 +01:00
@@ -7999,26 +7999,29 @@
   int32 *range_data= (int32*)my_malloc(part_info->no_parts*sizeof(int32),
                                        MYF(0));
   uint i;
+  int error= 0;
   DBUG_ENTER("set_range_data");
 
   if (!range_data)
   {
     mem_alloc_error();
-    DBUG_RETURN(TRUE);
+    DBUG_RETURN(1);
   }
   for (i= 0; i < part_info->no_parts; i++)
   {
     longlong range_val= part_info->range_int_array[i];
     if (range_val < INT_MIN32 || range_val > INT_MAX32)
     {
-      my_free((char*)range_data, MYF(0));
-      DBUG_RETURN(1234);
+      my_error(ER_LIMITED_PART_RANGE, MYF(0), "NDB");
+      error= 1;
+      goto error;
     }
     range_data[i]= (int32)range_val;
   }
   tab->setRangeListData(range_data, 4*part_info->no_parts);
+error:
   my_free((char*)range_data, MYF(0));
-  DBUG_RETURN(0);
+  DBUG_RETURN(error);
 }
 
 int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info)
@@ -8027,12 +8030,13 @@
   int32 *list_data= (int32*)my_malloc(part_info->no_list_values * 2
                                       * sizeof(int32), MYF(0));
   uint32 *part_id, i;
+  int error= 0;
   DBUG_ENTER("set_list_data");
 
   if (!list_data)
   {
     mem_alloc_error();
-    DBUG_RETURN(TRUE);
+    DBUG_RETURN(1);
   }
   for (i= 0; i < part_info->no_list_values; i++)
   {
@@ -8040,16 +8044,18 @@
     longlong list_val= list_entry->list_value;
     if (list_val < INT_MIN32 || list_val > INT_MAX32)
     {
-      my_free((char*)list_data, MYF(0));
-      DBUG_RETURN(1234);
+      my_error(ER_LIMITED_PART_RANGE, MYF(0), "NDB");
+      error= 1;
+      goto error;
     }
     list_data[2*i]= (int32)list_val;
     part_id= (uint32*)&list_data[2*i+1];
     *part_id= list_entry->partition_id;
   }
   tab->setRangeListData(list_data, 8*part_info->no_list_values);
+error:
   my_free((char*)list_data, MYF(0));
-  DBUG_RETURN(0);
+  DBUG_RETURN(error);
 }
 
 /*
@@ -8250,14 +8256,14 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createTablespace(ndb_ts))
+    if ((error= dict->createTablespace(ndb_ts)))
     {
       DBUG_PRINT("error", ("createTablespace returned %d", error));
       my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "TABLESPACE");
       DBUG_RETURN(1);
     }
     DBUG_PRINT("info", ("Successfully created Tablespace"));
-    if (error= dict->createDatafile(ndb_df))
+    if ((error= dict->createDatafile(ndb_df)))
     {
       DBUG_PRINT("error", ("createDatafile returned %d", error));
       my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "DATAFILE");
@@ -8274,7 +8280,7 @@
       {
 	DBUG_RETURN(1);
       }
-      if (error= dict->createDatafile(ndb_df))
+      if ((error= dict->createDatafile(ndb_df)))
       {
 	DBUG_PRINT("error", ("createDatafile returned %d", error));
 	my_error(ER_ALTER_TABLESPACE_FAILED, MYF(0), "CREATE DATAFILE");
@@ -8287,7 +8293,7 @@
 						     info->data_file_name);
       if (strcmp(df.getPath(), info->data_file_name) == 0)
       {
-	if (error= dict->dropDatafile(df))
+	if ((error= dict->dropDatafile(df)))
 	{
 	  DBUG_PRINT("error", ("createDatafile returned %d", error));
 	  my_error(ER_ALTER_TABLESPACE_FAILED, MYF(0), " DROP DATAFILE");
@@ -8324,7 +8330,7 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createLogfileGroup(ndb_lg))
+    if ((error= dict->createLogfileGroup(ndb_lg)))
     {
       DBUG_PRINT("error", ("createLogfileGroup returned %d", error));
       my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "LOGFILE GROUP");
@@ -8335,7 +8341,7 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createUndofile(ndb_uf))
+    if ((error= dict->createUndofile(ndb_uf)))
     {
       DBUG_PRINT("error", ("createUndofile returned %d", error));
       my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "UNDOFILE");
@@ -8357,7 +8363,7 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createUndofile(ndb_uf))
+    if ((error= dict->createUndofile(ndb_uf)))
     {
       DBUG_PRINT("error", ("createUndofile returned %d", error));
       my_error(ER_ALTER_TABLESPACE_FAILED, MYF(0), "CREATE UNDOFILE");
@@ -8367,8 +8373,8 @@
   }
   case (DROP_TABLESPACE):
   {
-    if (error= dict->dropTablespace(
-				    dict->getTablespace(info->tablespace_name)))
+    if ((error= dict->dropTablespace(
+		    dict->getTablespace(info->tablespace_name))))
     {
       DBUG_PRINT("error", ("dropTablespace returned %d", error));
       my_error(ER_DROP_TABLESPACE_FAILED, MYF(0), "TABLESPACE");
@@ -8378,7 +8384,8 @@
   }
   case (DROP_LOGFILE_GROUP):
   {
-    if (error= dict->dropLogfileGroup(dict->getLogfileGroup(info->logfile_group_name)))
+    if ((error= dict->dropLogfileGroup(
+                dict->getLogfileGroup(info->logfile_group_name))))
     {
       DBUG_PRINT("error", ("dropLogfileGroup returned %d", error));
       my_error(ER_DROP_TABLESPACE_FAILED, MYF(0), "LOGFILE GROUP");
Thread
bk commit into 5.1 tree (mikron:1.1960)mikael24 Nov