List:Commits« Previous MessageNext Message »
From:jonas Date:January 10 2006 9:39am
Subject:bk commit into 5.1 tree (jonas:1.1996) BUG#16154
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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.1996 06/01/10 10:39:18 jonas@stripped +4 -0
  bug#16154 - ndb dd
    insufficient error messages

  storage/ndb/src/ndbapi/ndberror.c
    1.47 06/01/10 10:39:15 jonas@stripped +14 -0
    Fix error codes

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
    1.70 06/01/10 10:39:15 jonas@stripped +7 -3
    release objects

  storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp
    1.2 06/01/10 10:39:15 jonas@stripped +12 -12
    Fix error codes

  sql/ha_ndbcluster.cc
    1.223 06/01/10 10:39:15 jonas@stripped +43 -35
    Push all ndb error as warnings on error with dd objects

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-dd

--- 1.1/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp	2005-11-07 12:19:10 +01:00
+++ 1.2/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp	2006-01-10 10:39:15 +01:00
@@ -68,9 +68,9 @@
 
   enum ErrorCode {
     NoError = 0,
-    FilegroupAlreadyExists = 1,
-    OutOfFilegroupRecords = 2,
-    OutOfLogBufferMemory = 3
+    FilegroupAlreadyExists = 1502,
+    OutOfFilegroupRecords = 1503,
+    OutOfLogBufferMemory = 1504
   };
   
   Uint32 senderData;
@@ -155,15 +155,15 @@
 
   enum ErrorCode {
     NoError = 0,
-    InvalidFilegroup = 1,
-    InvalidFilegroupVersion = 2,
-    FileNoAlreadyExists = 3,
-    OutOfFileRecords = 4,
-    FileError = 5,
-    InvalidFileMetadata = 6,
-    OutOfMemory = 7,
-    FileReadError = 8,
-    FilegroupNotOnline = 9
+    InvalidFilegroup = 1505,
+    InvalidFilegroupVersion = 1506,
+    FileNoAlreadyExists = 1507,
+    OutOfFileRecords = 1508,
+    FileError = 1509,
+    InvalidFileMetadata = 1510,
+    OutOfMemory = 1511,
+    FileReadError = 1512,
+    FilegroupNotOnline = 1513
   };
   
   Uint32 senderData;

--- 1.69/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-01-10 09:37:12 +01:00
+++ 1.70/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-01-10 10:39:15 +01:00
@@ -14781,6 +14781,7 @@
     c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i);
     
     release_object(fg_ptr.p->m_obj_ptr_i);
+    c_filegroup_hash.release(fg_ptr);
   }
   
   execute(signal, op->m_callback, 0);
@@ -15084,7 +15085,8 @@
   }
   
   release_object(f_ptr.p->m_obj_ptr_i);
-  
+  c_file_pool.release(f_ptr);
+
   execute(signal, op->m_callback, 0);
 }
 
@@ -15120,7 +15122,8 @@
 
   decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
   release_object(f_ptr.p->m_obj_ptr_i);
-  
+  c_file_pool.release(f_ptr);
+
   execute(signal, op->m_callback, 0);
 }
 
@@ -15307,7 +15310,8 @@
   c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i);
   
   release_object(fg_ptr.p->m_obj_ptr_i);
-  
+  c_filegroup_hash.release(fg_ptr);
+
   execute(signal, op->m_callback, 0);
 }
 

--- 1.222/sql/ha_ndbcluster.cc	2006-01-09 14:39:37 +01:00
+++ 1.223/sql/ha_ndbcluster.cc	2006-01-10 10:39:15 +01:00
@@ -8347,10 +8347,13 @@
   
   NDBDICT *dict = ndb->getDictionary();
   int error;
+  const char * errmsg;
 
   switch (info->ts_cmd_type){
   case (CREATE_TABLESPACE):
   {
+    error= ER_CREATE_TABLESPACE_FAILED;
+    
     NdbDictionary::Tablespace ndb_ts;
     NdbDictionary::Datafile ndb_df;
     if (set_up_tablespace(info, &ndb_ts))
@@ -8361,23 +8364,24 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createTablespace(ndb_ts))
+    errmsg= "TABLESPACE";
+    if (dict->createTablespace(ndb_ts))
     {
       DBUG_PRINT("error", ("createTablespace returned %d", error));
-      my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "TABLESPACE");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     DBUG_PRINT("info", ("Successfully created Tablespace"));
-    if (error= dict->createDatafile(ndb_df))
+    errmsg= "DATAFILE";
+    if (dict->createDatafile(ndb_df))
     {
       DBUG_PRINT("error", ("createDatafile returned %d", error));
-      my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "DATAFILE");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     break;
   }
   case (ALTER_TABLESPACE):
   {
+    error= ER_ALTER_TABLESPACE_FAILED;
     if (info->ts_alter_tablespace_type == ALTER_TABLESPACE_ADD_FILE)
     {
       NdbDictionary::Datafile ndb_df;
@@ -8385,11 +8389,10 @@
       {
 	DBUG_RETURN(1);
       }
-      if (error= dict->createDatafile(ndb_df))
+      errmsg= " CREATE DATAFILE";
+      if (dict->createDatafile(ndb_df))
       {
-	DBUG_PRINT("error", ("createDatafile returned %d", error));
-	my_error(ER_ALTER_TABLESPACE_FAILED, MYF(0), "CREATE DATAFILE");
-	DBUG_RETURN(1);
+	goto ndberror;
       }
     }
     else if(info->ts_alter_tablespace_type == ALTER_TABLESPACE_DROP_FILE)
@@ -8398,11 +8401,10 @@
 						     info->data_file_name);
       if (strcmp(df.getPath(), info->data_file_name) == 0)
       {
-	if (error= dict->dropDatafile(df))
+	errmsg= " DROP DATAFILE";
+	if (dict->dropDatafile(df))
 	{
-	  DBUG_PRINT("error", ("createDatafile returned %d", error));
-	  my_error(ER_ALTER_TABLESPACE_FAILED, MYF(0), " DROP DATAFILE");
-	  DBUG_RETURN(1);
+	  goto ndberror;
 	}
       }
       else
@@ -8422,6 +8424,7 @@
   }
   case (CREATE_LOGFILE_GROUP):
   {
+    error= ER_CREATE_TABLESPACE_FAILED;
     NdbDictionary::LogfileGroup ndb_lg;
     NdbDictionary::Undofile ndb_uf;
     if (info->undo_file_name == NULL)
@@ -8435,27 +8438,26 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createLogfileGroup(ndb_lg))
+    errmsg= "LOGFILE GROUP";
+    if (dict->createLogfileGroup(ndb_lg))
     {
-      DBUG_PRINT("error", ("createLogfileGroup returned %d", error));
-      my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "LOGFILE GROUP");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     DBUG_PRINT("info", ("Successfully created Logfile Group"));
     if (set_up_undofile(info, &ndb_uf))
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createUndofile(ndb_uf))
+    errmsg= "UNDOFILE";
+    if (dict->createUndofile(ndb_uf))
     {
-      DBUG_PRINT("error", ("createUndofile returned %d", error));
-      my_error(ER_CREATE_TABLESPACE_FAILED, MYF(0), "UNDOFILE");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     break;
   }
   case (ALTER_LOGFILE_GROUP):
   {
+    error= ER_ALTER_TABLESPACE_FAILED;
     if (info->undo_file_name == NULL)
     {
       /*
@@ -8468,32 +8470,30 @@
     {
       DBUG_RETURN(1);
     }
-    if (error= dict->createUndofile(ndb_uf))
+    errmsg= "CREATE UNDOFILE";
+    if (dict->createUndofile(ndb_uf))
     {
-      DBUG_PRINT("error", ("createUndofile returned %d", error));
-      my_error(ER_ALTER_TABLESPACE_FAILED, MYF(0), "CREATE UNDOFILE");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     break;
   }
   case (DROP_TABLESPACE):
   {
-    if (error= dict->dropTablespace(
-				    dict->getTablespace(info->tablespace_name)))
+    error= ER_DROP_TABLESPACE_FAILED;
+    errmsg= "TABLESPACE";
+    if (dict->dropTablespace(dict->getTablespace(info->tablespace_name)))
     {
-      DBUG_PRINT("error", ("dropTablespace returned %d", error));
-      my_error(ER_DROP_TABLESPACE_FAILED, MYF(0), "TABLESPACE");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     break;
   }
   case (DROP_LOGFILE_GROUP):
   {
-    if (error= dict->dropLogfileGroup(dict->getLogfileGroup(info->logfile_group_name)))
+    error= ER_DROP_TABLESPACE_FAILED;
+    errmsg= "LOGFILE GROUP";
+    if (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");
-      DBUG_RETURN(1);
+      goto ndberror;
     }
     break;
   }
@@ -8511,5 +8511,13 @@
   }
   }
   DBUG_RETURN(FALSE);
+
+ndberror:
+  const NdbError err= dict->getNdbError();
+  ERR_PRINT(err);
+  ndb_to_mysql_error(&err);
+  
+  my_error(error, MYF(0), errmsg);
+  DBUG_RETURN(1);
 }
 

--- 1.46/storage/ndb/src/ndbapi/ndberror.c	2005-12-21 16:47:15 +01:00
+++ 1.47/storage/ndb/src/ndbapi/ndberror.c	2006-01-10 10:39:15 +01:00
@@ -393,6 +393,20 @@
   { 1231, DMEC, SE, "Invalid table or index to scan" },
   { 1232, DMEC, SE, "Invalid table or index to scan" },
 
+  { 1502, DMEC, IE, "Filegroup already exists" },
+  { 1503, DMEC, SE, "Out of filegroup records" },
+  { 1504, DMEC, SE, "Out of logbuffer memory" },
+  { 1505, DMEC, IE, "Invalid filegroup" },
+  { 1506, DMEC, IE, "Invalid filegroup version" },
+  { 1507, DMEC, IE, "File no already inuse" },
+  { 1508, DMEC, SE, "Out of file records" },
+  { 1509, DMEC, SE, "File system error, check if path,permissions etc" },
+  { 1510, DMEC, IE, "File meta data error" },
+  { 1511, DMEC, IE, "Out of memory" },
+  { 1512, DMEC, SE, "File read error" },
+  { 1513, DMEC, IE, "Filegroup not online" },
+  
+
   /**
    * FunctionNotImplemented
    */
Thread
bk commit into 5.1 tree (jonas:1.1996) BUG#16154jonas10 Jan