List:Commits« Previous MessageNext Message »
From:tomas Date:June 17 2007 4:29pm
Subject:bk commit into 5.1 tree (tomas:1.2551)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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@stripped, 2007-06-17 16:28:59+02:00, tomas@stripped +16 -0
  Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
  into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-engines
  MERGE: 1.2500.1.21

  extra/perror.c@stripped, 2007-06-17 16:27:10+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.50.1.2

  mysql-test/t/disabled.def@stripped, 2007-06-17 16:28:56+02:00, tomas@stripped +1 -1
    manual merge
    MERGE: 1.253.4.1

  sql/ha_ndbcluster.cc@stripped, 2007-06-17 16:27:10+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.454.1.3

  sql/handler.cc@stripped, 2007-06-17 16:27:10+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.307.3.2

  sql/handler.h@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.258.2.1

  sql/mysqld.cc@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.645.5.1

  storage/ndb/src/common/transporter/Packer.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.12.1.1

  storage/ndb/src/common/transporter/TCP_Transporter.hpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.12.1.1

  storage/ndb/src/common/transporter/TransporterRegistry.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.75.1.1

  storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.51.1.1

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.135.1.1

  storage/ndb/src/mgmclient/main.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.30.1.2

  storage/ndb/src/ndbapi/NdbBlob.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.57.1.1

  storage/ndb/test/ndbapi/testNdbApi.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.29.1.1

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.92.1.2

  storage/ndb/tools/restore/consumer_restore.cpp@stripped, 2007-06-17 16:27:11+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.47.1.1

# 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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-engines/RESYNC

--- 1.51/extra/perror.c	2007-05-10 11:59:24 +02:00
+++ 1.52/extra/perror.c	2007-06-17 16:27:10 +02:00
@@ -25,6 +25,7 @@
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 #include "../storage/ndb/src/ndbapi/ndberror.c"
 #include "../storage/ndb/src/kernel/error/ndbd_exit_codes.c"
+#include "../storage/ndb/include/mgmapi/mgmapi_error.h"
 #endif
 
 static my_bool verbose, print_all_codes;
@@ -32,6 +33,20 @@
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 static my_bool ndb_code;
 static char ndb_string[1024];
+int mgmapi_error_string(int err_no, char *str, int size)
+{
+  int i;
+  for (i= 0; i < ndb_mgm_noOfErrorMsgs; i++)
+  {
+    if ((int)ndb_mgm_error_msgs[i].code == err_no)
+    {
+      my_snprintf(str, size-1, "%s", ndb_mgm_error_msgs[i].msg);
+      str[size-1]= '\0';
+      return 0;
+    }
+  }
+  return -1;
+}
 #endif
 
 static struct my_option my_long_options[] =
@@ -238,8 +253,9 @@
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
       if (ndb_code)
       {
-	if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
-	    (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
+        if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
+            (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
+            (mgmapi_error_string(code, ndb_string, sizeof(ndb_string)) < 0))
 	{
           msg= 0;
 	}

--- 1.651/sql/mysqld.cc	2007-06-06 21:25:30 +02:00
+++ 1.652/sql/mysqld.cc	2007-06-17 16:27:11 +02:00
@@ -1153,13 +1153,14 @@
   if (cleanup_done++)
     return; /* purecov: inspected */
 
-  logger.cleanup_base();
-
   /*
     make sure that handlers finish up
     what they have that is dependent on the binlog
   */
   ha_binlog_end(current_thd);
+
+  logger.cleanup_base();
+
   injector::free_instance();
   mysql_bin_log.cleanup();
 

--- 1.93/storage/ndb/test/run-test/daily-basic-tests.txt	2007-06-06 16:49:21 +02:00
+++ 1.94/storage/ndb/test/run-test/daily-basic-tests.txt	2007-06-17 16:27:11 +02:00
@@ -898,6 +898,10 @@
 cmd: testMgm
 args: -n ApiSessionFailure T1
 
+max-time: 15
+cmd: testMgm
+args: -n ApiConnectTimeout T1
+
 max-time: 120
 cmd: testMgm
 args: -n ApiTimeoutBasic T1

--- 1.262/mysql-test/t/disabled.def	2007-06-04 11:24:36 +02:00
+++ 1.263/mysql-test/t/disabled.def	2007-06-17 16:28:56 +02:00
@@ -47,3 +47,4 @@
 
 im_options_set       : Bug#20294: Instance manager tests fail randomly
 im_options_unset     : Bug#20294: Instance manager tests fail randomly
+mysql_upgrade        : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage

--- 1.31/storage/ndb/src/mgmclient/main.cpp	2007-05-10 11:59:33 +02:00
+++ 1.32/storage/ndb/src/mgmclient/main.cpp	2007-06-17 16:27:11 +02:00
@@ -23,6 +23,8 @@
 #elif !defined(__NETWARE__)
 #include <readline/readline.h>
 extern "C" int add_history(const char *command); /* From readline directory */
+extern "C" int read_history(const char *command);
+extern "C" int write_history(const char *command);
 #define HAVE_READLINE
 #endif
 }
@@ -155,10 +157,35 @@
   signal(SIGPIPE, handler);
   com = new Ndb_mgmclient(opt_connect_str,1);
   int ret= 0;
+  BaseString histfile;
   if (!opt_execute_str)
   {
+#ifdef HAVE_READLINE
+    char *histfile_env= getenv("NDB_MGM_HISTFILE");
+    if (histfile_env)
+      histfile.assign(histfile_env,strlen(histfile_env));
+    else if(getenv("HOME"))
+    {
+      histfile.assign(getenv("HOME"),strlen(getenv("HOME")));
+      histfile.append("/.ndb_mgm_history");
+    }
+    if (histfile.length())
+      read_history(histfile.c_str());
+#endif
+
     ndbout << "-- NDB Cluster -- Management Client --" << endl;
     while(read_and_execute(_try_reconnect));
+
+#ifdef HAVE_READLINE
+    if (histfile.length())
+    {
+      BaseString histfile_tmp;
+      histfile_tmp.assign(histfile);
+      histfile_tmp.append(".TMP");
+      if(!write_history(histfile_tmp.c_str()))
+        my_rename(histfile_tmp.c_str(), histfile.c_str(), MYF(MY_WME));
+    }
+#endif
   }
   else
   {

--- 1.457/sql/ha_ndbcluster.cc	2007-06-14 16:16:41 +02:00
+++ 1.458/sql/ha_ndbcluster.cc	2007-06-17 16:27:10 +02:00
@@ -146,7 +146,7 @@
 // Table lock handling
 HASH ndbcluster_open_tables;
 
-static byte *ndbcluster_get_key(NDB_SHARE *share,uint *length,
+static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
                                 my_bool not_used __attribute__((unused)));
 #ifdef HAVE_NDB_BINLOG
 static int rename_share(NDB_SHARE *share, const char *new_key);
@@ -316,11 +316,11 @@
   Place holder for ha_ndbcluster thread specific data
 */
 static
-byte *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, uint *length,
+uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length,
                             my_bool not_used __attribute__((unused)))
 {
   *length= sizeof(thd_ndb_share->key);
-  return (byte*) &thd_ndb_share->key;
+  return (uchar*) &thd_ndb_share->key;
 }
 
 Thd_ndb::Thd_ndb()
@@ -375,9 +375,9 @@
   DBUG_ENTER("Thd_ndb::get_open_table");
   HASH_SEARCH_STATE state;
   THD_NDB_SHARE *thd_ndb_share=
-    (THD_NDB_SHARE*)hash_first(&open_tables, (byte *)&key, sizeof(key), &state);
+    (THD_NDB_SHARE*)hash_first(&open_tables, (uchar *)&key, sizeof(key), &state);
   while (thd_ndb_share && thd_ndb_share->key != key)
-    thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (byte *)&key, sizeof(key), &state);
+    thd_ndb_share= (THD_NDB_SHARE*)hash_next(&open_tables, (uchar *)&key, sizeof(key), &state);
   if (thd_ndb_share == 0)
   {
     thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root,
@@ -386,7 +386,7 @@
     thd_ndb_share->stat.last_count= count;
     thd_ndb_share->stat.no_uncommitted_rows_count= 0;
     thd_ndb_share->stat.records= ~(ha_rows)0;
-    my_hash_insert(&open_tables, (byte *)thd_ndb_share);
+    my_hash_insert(&open_tables, (uchar *)thd_ndb_share);
   }
   else if (thd_ndb_share->stat.last_count != count)
   {
@@ -654,7 +654,7 @@
 */
 
 bool ha_ndbcluster::set_hidden_key(NdbOperation *ndb_op,
-                                   uint fieldnr, const byte *field_ptr)
+                                   uint fieldnr, const uchar *field_ptr)
 {
   DBUG_ENTER("set_hidden_key");
   DBUG_RETURN(ndb_op->equal(fieldnr, (char*)field_ptr) != 0);
@@ -666,14 +666,14 @@
 */
 
 int ha_ndbcluster::set_ndb_key(NdbOperation *ndb_op, Field *field,
-                               uint fieldnr, const byte *field_ptr)
+                               uint fieldnr, const uchar *field_ptr)
 {
   uint32 pack_len= field->pack_length();
   DBUG_ENTER("set_ndb_key");
   DBUG_PRINT("enter", ("%d: %s, ndb_type: %u, len=%d", 
                        fieldnr, field->field_name, field->type(),
                        pack_len));
-  DBUG_DUMP("key", (char*)field_ptr, pack_len);
+  DBUG_DUMP("key", field_ptr, pack_len);
   
   DBUG_ASSERT(ndb_supported_type(field->type()));
   DBUG_ASSERT(! (field->flags & BLOB_FLAG));
@@ -690,13 +690,13 @@
                                  uint fieldnr, int row_offset,
                                  bool *set_blob_value)
 {
-  const byte* field_ptr= field->ptr + row_offset;
+  const uchar* field_ptr= field->ptr + row_offset;
   uint32 pack_len= field->pack_length();
   DBUG_ENTER("set_ndb_value");
   DBUG_PRINT("enter", ("%d: %s  type: %u  len=%d  is_null=%s", 
                        fieldnr, field->field_name, field->type(), 
                        pack_len, field->is_null(row_offset) ? "Y" : "N"));
-  DBUG_DUMP("value", (char*) field_ptr, pack_len);
+  DBUG_DUMP("value", field_ptr, pack_len);
 
   DBUG_ASSERT(ndb_supported_type(field->type()));
   {
@@ -705,7 +705,7 @@
     if (pack_len == 0)
     {
       pack_len= sizeof(empty_field);
-      field_ptr= (byte *)&empty_field;
+      field_ptr= (uchar *)&empty_field;
       if (field->is_null(row_offset))
         empty_field= 0;
       else
@@ -735,7 +735,7 @@
           // Set value to NULL
           DBUG_RETURN((ndb_op->setValue(fieldnr, (char*)NULL) != 0));
         DBUG_PRINT("info", ("bit field"));
-        DBUG_DUMP("value", (char*)&bits, pack_len);
+        DBUG_DUMP("value", (uchar*)&bits, pack_len);
 #ifdef WORDS_BIGENDIAN
         /* store lsw first */
         bits = ((bits >> 32) & 0x00000000FFFFFFFFLL)
@@ -755,18 +755,18 @@
 
       // Get length and pointer to data
       uint32 blob_len= field_blob->get_length(field_ptr);
-      char* blob_ptr= NULL;
+      uchar* blob_ptr= NULL;
       field_blob->get_ptr(&blob_ptr);
 
       // Looks like NULL ptr signals length 0 blob
       if (blob_ptr == NULL) {
         DBUG_ASSERT(blob_len == 0);
-        blob_ptr= (char*)"";
+        blob_ptr= (uchar*)"";
       }
 
       DBUG_PRINT("value", ("set blob ptr: 0x%lx  len: %u",
                            (long) blob_ptr, blob_len));
-      DBUG_DUMP("value", (char*)blob_ptr, min(blob_len, 26));
+      DBUG_DUMP("value", blob_ptr, min(blob_len, 26));
 
       if (set_blob_value)
         *set_blob_value= TRUE;
@@ -810,7 +810,7 @@
   passes a record pointer diff.
  */
 int get_ndb_blobs_value(TABLE* table, NdbValue* value_array,
-                        byte*& buffer, uint& buffer_size,
+                        uchar*& buffer, uint& buffer_size,
                         my_ptrdiff_t ptrdiff)
 {
   DBUG_ENTER("get_ndb_blobs_value");
@@ -846,7 +846,7 @@
           size+= 8 - size % 8;
         if (loop == 1)
         {
-          char *buf= buffer + offset;
+          uchar *buf= buffer + offset;
           uint32 len= 0xffffffff;  // Max uint32
           if (ndb_blob->readData(buf, len) != 0)
             ERR_RETURN(ndb_blob->getNdbError());
@@ -861,9 +861,9 @@
       else if (loop == 1) // undefined or null
       {
         // have to set length even in this case
-        char *buf= buffer + offset; // or maybe NULL
+        uchar *buf= buffer + offset; // or maybe NULL
         uint32 len= 0;
-        field_blob->set_ptr_offset(ptrdiff, len, buf);
+	field_blob->set_ptr_offset(ptrdiff, len, buf);
         DBUG_PRINT("info", ("[%u] isNull=%d", i, isNull));
       }
     }
@@ -872,7 +872,7 @@
       my_free(buffer, MYF(MY_ALLOW_ZERO_PTR));
       buffer_size= 0;
       DBUG_PRINT("info", ("allocate blobs buffer size %u", offset));
-      buffer= my_malloc(offset, MYF(MY_WME));
+      buffer= (uchar*) my_malloc(offset, MYF(MY_WME));
       if (buffer == NULL)
       {
         sql_print_error("ha_ndbcluster::get_ndb_blobs_value: "
@@ -893,7 +893,7 @@
 */
 
 int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
-                                 uint fieldnr, byte* buf)
+                                 uint fieldnr, uchar* buf)
 {
   DBUG_ENTER("get_ndb_value");
   DBUG_PRINT("enter", ("fieldnr: %d flags: %o", fieldnr,
@@ -908,13 +908,13 @@
       { 
         if (field->type() != MYSQL_TYPE_BIT)
         {
-          byte *field_buf;
+          uchar *field_buf;
           if (field->pack_length() != 0)
             field_buf= buf + (field->ptr - table->record[0]);
           else
-            field_buf= (byte *)&dummy_buf;
+            field_buf= (uchar *)&dummy_buf;
           m_value[fieldnr].rec= ndb_op->getValue(fieldnr, 
-                                                 field_buf);
+                                                 (char*) field_buf);
         }
         else // if (field->type() == MYSQL_TYPE_BIT)
         {
@@ -929,7 +929,7 @@
       if (ndb_blob != NULL)
       {
         // Set callback
-	m_blobs_offset= buf - (byte*) table->record[0];
+	m_blobs_offset= buf - (uchar*) table->record[0];
         void *arg= (void *)this;
         DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0);
       }
@@ -937,7 +937,7 @@
   }
 
   // Used for hidden key only
-  m_value[fieldnr].rec= ndb_op->getValue(fieldnr, m_ref);
+  m_value[fieldnr].rec= ndb_op->getValue(fieldnr, (char*) m_ref);
   DBUG_RETURN(m_value[fieldnr].rec == NULL);
 }
 
@@ -1011,8 +1011,8 @@
   DBUG_ASSERT(m_table == NULL);
   DBUG_ASSERT(m_table_info == NULL);
 
-  const void *data= NULL, *pack_data= NULL;
-  uint length, pack_length;
+  uchar *data= NULL, *pack_data= NULL;
+  size_t length, pack_length;
 
   /*
     Compare FrmData in NDB with frm file from disk.
@@ -1021,8 +1021,8 @@
   if (readfrm(path, &data, &length) ||
       packfrm(data, length, &pack_data, &pack_length))
   {
-    my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
-    my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR));
+    my_free(data, MYF(MY_ALLOW_ZERO_PTR));
+    my_free(pack_data, MYF(MY_ALLOW_ZERO_PTR));
     DBUG_RETURN(1);
   }
     
@@ -1034,11 +1034,11 @@
       && cmp_frm(tab, pack_data, pack_length))
   {
     DBUG_PRINT("error", 
-               ("metadata, pack_length: %d  getFrmLength: %d  memcmp: %d",
-                pack_length, tab->getFrmLength(),
+               ("metadata, pack_length: %lu  getFrmLength: %d  memcmp: %d",
+                (ulong) pack_length, tab->getFrmLength(),
                 memcmp(pack_data, tab->getFrmData(), pack_length)));
-    DBUG_DUMP("pack_data", (char*)pack_data, pack_length);
-    DBUG_DUMP("frm", (char*)tab->getFrmData(), tab->getFrmLength());
+    DBUG_DUMP("pack_data", (uchar*) pack_data, pack_length);
+    DBUG_DUMP("frm", (uchar*) tab->getFrmData(), tab->getFrmLength());
     error= HA_ERR_TABLE_DEF_CHANGED;
   }
   my_free((char*)data, MYF(0));
@@ -1541,7 +1541,7 @@
               HA_KEY_SCAN_NOT_ROR);
 }
 
-static void shrink_varchar(Field* field, const byte* & ptr, char* buf)
+static void shrink_varchar(Field* field, const uchar* & ptr, uchar* buf)
 {
   if (field->type() == MYSQL_TYPE_VARCHAR && ptr != NULL) {
     Field_varstring* f= (Field_varstring*)field;
@@ -1560,7 +1560,7 @@
   }
 }
 
-int ha_ndbcluster::set_primary_key(NdbOperation *op, const byte *key)
+int ha_ndbcluster::set_primary_key(NdbOperation *op, const uchar *key)
 {
   KEY* key_info= table->key_info + table_share->primary_key;
   KEY_PART_INFO* key_part= key_info->key_part;
@@ -1570,8 +1570,8 @@
   for (; key_part != end; key_part++) 
   {
     Field* field= key_part->field;
-    const byte* ptr= key;
-    char buf[256];
+    const uchar* ptr= key;
+    uchar buf[256];
     shrink_varchar(field, ptr, buf);
     if (set_ndb_key(op, field, 
                     key_part->fieldnr-1, ptr))
@@ -1582,7 +1582,7 @@
 }
 
 
-int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *record)
+int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const uchar *record)
 {
   KEY* key_info= table->key_info + table_share->primary_key;
   KEY_PART_INFO* key_part= key_info->key_part;
@@ -1600,7 +1600,7 @@
 }
 
 int ha_ndbcluster::set_index_key_from_record(NdbOperation *op, 
-                                             const byte *record, uint keyno)
+                                             const uchar *record, uint keyno)
 {
   KEY* key_info= table->key_info + keyno;
   KEY_PART_INFO* key_part= key_info->key_part;
@@ -1621,7 +1621,7 @@
 int 
 ha_ndbcluster::set_index_key(NdbOperation *op, 
                              const KEY *key_info, 
-                             const byte * key_ptr)
+                             const uchar * key_ptr)
 {
   DBUG_ENTER("ha_ndbcluster::set_index_key");
   uint i;
@@ -1631,8 +1631,8 @@
   for (i= 0; key_part != end; key_part++, i++) 
   {
     Field* field= key_part->field;
-    const byte* ptr= key_part->null_bit ? key_ptr + 1 : key_ptr;
-    char buf[256];
+    const uchar* ptr= key_part->null_bit ? key_ptr + 1 : key_ptr;
+    uchar buf[256];
     shrink_varchar(field, ptr, buf);
     if (set_ndb_key(op, field, m_index[active_index].unique_index_attrid_map[i], ptr))
       ERR_RETURN(m_active_trans->getNdbError());
@@ -1642,7 +1642,7 @@
 }
 
 inline 
-int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op)
+int ha_ndbcluster::define_read_attrs(uchar* buf, NdbOperation* op)
 {
   uint i;
   DBUG_ENTER("define_read_attrs");  
@@ -1684,7 +1684,7 @@
   Read one record from NDB using primary key
 */
 
-int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf,
+int ha_ndbcluster::pk_read(const uchar *key, uint key_len, uchar *buf,
                            uint32 part_id)
 {
   uint no_fields= table_share->fields;
@@ -1694,7 +1694,7 @@
   int res;
   DBUG_ENTER("pk_read");
   DBUG_PRINT("enter", ("key_len: %u", key_len));
-  DBUG_DUMP("key", (char*)key, key_len);
+  DBUG_DUMP("key", key, key_len);
   m_write_op= FALSE;
 
   NdbOperation::LockMode lm=
@@ -1707,7 +1707,7 @@
   {
     // This table has no primary key, use "hidden" primary key
     DBUG_PRINT("info", ("Using hidden key"));
-    DBUG_DUMP("key", (char*)key, 8);    
+    DBUG_DUMP("key", key, 8);    
     if (set_hidden_key(op, no_fields, key))
       ERR_RETURN(trans->getNdbError());
     
@@ -1753,7 +1753,7 @@
   or hidden key
 */
 
-int ha_ndbcluster::complemented_read(const byte *old_data, byte *new_data,
+int ha_ndbcluster::complemented_read(const uchar *old_data, uchar *new_data,
                                      uint32 old_part_id)
 {
   uint no_fields= table_share->fields, i;
@@ -1890,7 +1890,7 @@
  */
 static
 int
-check_null_in_record(const KEY* key_info, const byte *record)
+check_null_in_record(const KEY* key_info, const uchar *record)
 {
   KEY_PART_INFO *curr_part, *end_part;
   curr_part= key_info->key_part;
@@ -1917,7 +1917,7 @@
  * primary key or unique index values
 */
 
-int ha_ndbcluster::peek_indexed_rows(const byte *record,
+int ha_ndbcluster::peek_indexed_rows(const uchar *record,
 				     bool check_pk)
 {
   NdbTransaction *trans= m_active_trans;
@@ -2021,15 +2021,15 @@
   Read one record from NDB using unique secondary index
 */
 
-int ha_ndbcluster::unique_index_read(const byte *key,
-                                     uint key_len, byte *buf)
+int ha_ndbcluster::unique_index_read(const uchar *key,
+                                     uint key_len, uchar *buf)
 {
   int res;
   NdbTransaction *trans= m_active_trans;
   NdbIndexOperation *op;
   DBUG_ENTER("ha_ndbcluster::unique_index_read");
   DBUG_PRINT("enter", ("key_len: %u, index: %u", key_len, active_index));
-  DBUG_DUMP("key", (char*)key, key_len);
+  DBUG_DUMP("key", key, key_len);
   
   NdbOperation::LockMode lm=
     (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
@@ -2165,7 +2165,7 @@
 
 */
 
-inline int ha_ndbcluster::next_result(byte *buf)
+inline int ha_ndbcluster::next_result(uchar *buf)
 {  
   int res;
   DBUG_ENTER("next_result");
@@ -2244,10 +2244,10 @@
     struct part_st {
       bool part_last;
       const key_range *key;
-      const byte *part_ptr;
+      const uchar *part_ptr;
       bool part_null;
       int bound_type;
-      const char* bound_ptr;
+      const uchar* bound_ptr;
     };
     struct part_st part[2];
 
@@ -2357,13 +2357,13 @@
       {
         DBUG_PRINT("info", ("key %d:%d  offset: %d  length: %d  last: %d  bound: %d",
                             j, i, tot_len, part_len, p.part_last, p.bound_type));
-        DBUG_DUMP("info", (const char*)p.part_ptr, part_store_len);
+        DBUG_DUMP("info", p.part_ptr, part_store_len);
 
         // Set bound if not cancelled via type -1
         if (p.bound_type != -1)
         {
-          const char* ptr= p.bound_ptr;
-          char buf[256];
+          const uchar* ptr= p.bound_ptr;
+          uchar buf[256];
           shrink_varchar(field, ptr, buf);
           if (op->setBound(i, p.bound_type, ptr))
             ERR_RETURN(op->getNdbError());
@@ -2383,7 +2383,7 @@
 int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
                                       const key_range *end_key,
                                       bool sorted, bool descending,
-                                      byte* buf, part_id_range *part_spec)
+                                      uchar* buf, part_id_range *part_spec)
 {  
   int res;
   bool restart;
@@ -2489,9 +2489,9 @@
  */
 
 int ha_ndbcluster::unique_index_scan(const KEY* key_info, 
-				     const byte *key, 
+				     const uchar *key, 
 				     uint key_len,
-				     byte *buf)
+				     uchar *buf)
 {
   int res;
   NdbScanOperation *op;
@@ -2565,7 +2565,7 @@
   Start full table scan in NDB
  */
 
-int ha_ndbcluster::full_table_scan(byte *buf)
+int ha_ndbcluster::full_table_scan(uchar *buf)
 {
   int res;
   NdbScanOperation *op;
@@ -2632,7 +2632,7 @@
 /*
   Insert one record into NDB
 */
-int ha_ndbcluster::write_row(byte *record)
+int ha_ndbcluster::write_row(uchar *record)
 {
   bool has_auto_increment;
   uint i;
@@ -2719,17 +2719,17 @@
       Ndb_tuple_id_range_guard g(m_share);
       if (ndb->getAutoIncrementValue(m_table, g.range, auto_value, 1) == -1)
       {
-        if (--retries &&
-            ndb->getNdbError().status == NdbError::TemporaryError);
-        {
-          my_sleep(retry_sleep);
-          continue;
-        }
-        ERR_RETURN(ndb->getNdbError());
+	if (--retries &&
+	    ndb->getNdbError().status == NdbError::TemporaryError);
+	{
+	  my_sleep(retry_sleep);
+	  continue;
+	}
+	ERR_RETURN(ndb->getNdbError());
       }
       break;
     }
-    if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value))
+    if (set_hidden_key(op, table_share->fields, (const uchar*)&auto_value))
       ERR_RETURN(op->getNdbError());
   } 
   else 
@@ -2850,8 +2850,8 @@
 
 /* Compare if a key in a row has changed */
 
-int ha_ndbcluster::key_cmp(uint keynr, const byte * old_row,
-                           const byte * new_row)
+int ha_ndbcluster::key_cmp(uint keynr, const uchar * old_row,
+                           const uchar * new_row)
 {
   KEY_PART_INFO *key_part=table->key_info[keynr].key_part;
   KEY_PART_INFO *end=key_part+table->key_info[keynr].key_parts;
@@ -2867,8 +2867,8 @@
     if (key_part->key_part_flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART))
     {
 
-      if (key_part->field->cmp_binary((char*) (old_row + key_part->offset),
-                                      (char*) (new_row + key_part->offset),
+      if (key_part->field->cmp_binary((old_row + key_part->offset),
+                                      (new_row + key_part->offset),
                                       (ulong) key_part->length))
         return 1;
     }
@@ -2886,7 +2886,7 @@
   Update one record in NDB using primary key
 */
 
-int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
+int ha_ndbcluster::update_row(const uchar *old_data, uchar *new_data)
 {
   THD *thd= table->in_use;
   NdbTransaction *trans= m_active_trans;
@@ -2972,7 +2972,7 @@
       {
         // Undo delete_row(old_data)
         m_primary_key_update= TRUE;
-        undo_res= write_row((byte *)old_data);
+        undo_res= write_row((uchar *)old_data);
         if (undo_res)
           push_warning(current_thd, 
                        MYSQL_ERROR::WARN_LEVEL_WARN, 
@@ -3087,7 +3087,7 @@
   Delete one record from NDB, using primary key 
 */
 
-int ha_ndbcluster::delete_row(const byte *record)
+int ha_ndbcluster::delete_row(const uchar *record)
 {
   THD *thd= table->in_use;
   NdbTransaction *trans= m_active_trans;
@@ -3199,7 +3199,7 @@
 */
 
 void ndb_unpack_record(TABLE *table, NdbValue *value,
-                       MY_BITMAP *defined, byte *buf)
+                       MY_BITMAP *defined, uchar *buf)
 {
   Field **p_field= table->field, *field= *p_field;
   my_ptrdiff_t row_offset= (my_ptrdiff_t) (buf - table->record[0]);
@@ -3286,13 +3286,13 @@
           field_bit->Field_bit::move_field_offset(-row_offset);
           DBUG_PRINT("info",("[%u] SET",
                              (*value).rec->getColumn()->getColumnNo()));
-          DBUG_DUMP("info", (const char*) field->ptr, field->pack_length());
+          DBUG_DUMP("info", field->ptr, field->pack_length());
         }
         else
         {
           DBUG_PRINT("info",("[%u] SET",
                              (*value).rec->getColumn()->getColumnNo()));
-          DBUG_DUMP("info", (const char*) field->ptr, field->pack_length());
+          DBUG_DUMP("info", field->ptr, field->pack_length());
         }
       }
       else
@@ -3316,7 +3316,7 @@
 #ifndef DBUG_OFF
           // pointer vas set in get_ndb_blobs_value
           Field_blob *field_blob= (Field_blob*)field;
-          char* ptr;
+          uchar *ptr;
           field_blob->get_ptr(&ptr, row_offset);
           uint32 len= field_blob->get_length(row_offset);
           DBUG_PRINT("info",("[%u] SET ptr: 0x%lx  len: %u",
@@ -3330,7 +3330,7 @@
   DBUG_VOID_RETURN;
 }
 
-void ha_ndbcluster::unpack_record(byte *buf)
+void ha_ndbcluster::unpack_record(uchar *buf)
 {
   ndb_unpack_record(table, m_value, 0, buf);
 #ifndef DBUG_OFF
@@ -3443,10 +3443,10 @@
  */
 static
 int
-check_null_in_key(const KEY* key_info, const byte *key, uint key_len)
+check_null_in_key(const KEY* key_info, const uchar *key, uint key_len)
 {
   KEY_PART_INFO *curr_part, *end_part;
-  const byte* end_ptr= key + key_len;
+  const uchar* end_ptr= key + key_len;
   curr_part= key_info->key_part;
   end_part= curr_part + key_info->key_parts;
 
@@ -3460,8 +3460,8 @@
   return 0;
 }
 
-int ha_ndbcluster::index_read(byte *buf,
-                              const byte *key, uint key_len, 
+int ha_ndbcluster::index_read(uchar *buf,
+                              const uchar *key, uint key_len, 
                               enum ha_rkey_function find_flag)
 {
   key_range start_key;
@@ -3489,7 +3489,7 @@
 }
 
 
-int ha_ndbcluster::index_next(byte *buf)
+int ha_ndbcluster::index_next(uchar *buf)
 {
   DBUG_ENTER("ha_ndbcluster::index_next");
   ha_statistic_increment(&SSV::ha_read_next_count);
@@ -3497,7 +3497,7 @@
 }
 
 
-int ha_ndbcluster::index_prev(byte *buf)
+int ha_ndbcluster::index_prev(uchar *buf)
 {
   DBUG_ENTER("ha_ndbcluster::index_prev");
   ha_statistic_increment(&SSV::ha_read_prev_count);
@@ -3505,7 +3505,7 @@
 }
 
 
-int ha_ndbcluster::index_first(byte *buf)
+int ha_ndbcluster::index_first(uchar *buf)
 {
   DBUG_ENTER("ha_ndbcluster::index_first");
   ha_statistic_increment(&SSV::ha_read_first_count);
@@ -3516,14 +3516,14 @@
 }
 
 
-int ha_ndbcluster::index_last(byte *buf)
+int ha_ndbcluster::index_last(uchar *buf)
 {
   DBUG_ENTER("ha_ndbcluster::index_last");
   ha_statistic_increment(&SSV::ha_read_last_count);
   DBUG_RETURN(ordered_index_scan(0, 0, TRUE, TRUE, buf, NULL));
 }
 
-int ha_ndbcluster::index_read_last(byte * buf, const byte * key, uint key_len)
+int ha_ndbcluster::index_read_last(uchar * buf, const uchar * key, uint key_len)
 {
   DBUG_ENTER("ha_ndbcluster::index_read_last");
   DBUG_RETURN(index_read(buf, key, key_len, HA_READ_PREFIX_LAST));
@@ -3532,7 +3532,7 @@
 int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
                                            const key_range *end_key,
                                            bool desc, bool sorted,
-                                           byte* buf)
+                                           uchar* buf)
 {
   part_id_range part_spec;
   ndb_index_type type= get_index_type(active_index);
@@ -3612,7 +3612,7 @@
                                     const key_range *end_key,
                                     bool eq_r, bool sorted)
 {
-  byte* buf= table->record[0];
+  uchar* buf= table->record[0];
   DBUG_ENTER("ha_ndbcluster::read_range_first");
   DBUG_RETURN(read_range_first_to_buf(start_key, end_key, FALSE,
                                       sorted, buf));
@@ -3702,7 +3702,7 @@
 }
 
 
-int ha_ndbcluster::rnd_next(byte *buf)
+int ha_ndbcluster::rnd_next(uchar *buf)
 {
   DBUG_ENTER("rnd_next");
   ha_statistic_increment(&SSV::ha_read_rnd_next_count);
@@ -3720,7 +3720,7 @@
   again
 */
 
-int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
+int ha_ndbcluster::rnd_pos(uchar *buf, uchar *pos)
 {
   DBUG_ENTER("rnd_pos");
   ha_statistic_increment(&SSV::ha_read_rnd_count);
@@ -3737,7 +3737,7 @@
           The partition id has been fetched from ndb
           and has been stored directly after the hidden key
         */
-        DBUG_DUMP("key+part", (char *)pos, key_length);
+        DBUG_DUMP("key+part", pos, key_length);
         key_length= ref_length - sizeof(m_part_id);
         part_spec.start_part= part_spec.end_part= *(uint32 *)(pos + key_length);
       }
@@ -3754,7 +3754,7 @@
       }
       DBUG_PRINT("info", ("partition id %u", part_spec.start_part));
     }
-    DBUG_DUMP("key", (char *)pos, key_length);
+    DBUG_DUMP("key", pos, key_length);
     DBUG_RETURN(pk_read(pos, key_length, buf, part_spec.start_part));
   }
 }
@@ -3766,12 +3766,12 @@
   using "reference" in rnd_pos
 */
 
-void ha_ndbcluster::position(const byte *record)
+void ha_ndbcluster::position(const uchar *record)
 {
   KEY *key_info;
   KEY_PART_INFO *key_part;
   KEY_PART_INFO *end;
-  byte *buff;
+  uchar *buff;
   uint key_length;
 
   DBUG_ENTER("position");
@@ -3797,7 +3797,7 @@
       }
 
       size_t len = key_part->length;
-      const byte * ptr = record + key_part->offset;
+      const uchar * ptr = record + key_part->offset;
       Field *field = key_part->field;
       if (field->type() ==  MYSQL_TYPE_VARCHAR)
       {
@@ -3848,9 +3848,9 @@
   }
 #ifndef DBUG_OFF
   if (table_share->primary_key == MAX_KEY && m_use_partition_function) 
-    DBUG_DUMP("key+part", (char*)ref, key_length+sizeof(m_part_id));
+    DBUG_DUMP("key+part", ref, key_length+sizeof(m_part_id));
 #endif
-  DBUG_DUMP("ref", (char*)ref, key_length);
+  DBUG_DUMP("ref", ref, key_length);
   DBUG_VOID_RETURN;
 }
 
@@ -4951,8 +4951,9 @@
   THD *thd= current_thd;
   NDBTAB tab;
   NDBCOL col;
-  uint pack_length, length, i, pk_length= 0;
-  const void *data= NULL, *pack_data= NULL;
+  size_t pack_length, length;
+  uint i, pk_length= 0;
+  uchar *data= NULL, *pack_data= NULL;
   bool create_from_engine= (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
   bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE);
   char tablespace[FN_LEN];
@@ -5036,7 +5037,9 @@
     my_free((char*)data, MYF(0));
     DBUG_RETURN(2);
   }
-  DBUG_PRINT("info", ("setFrm data: 0x%lx  len: %d", (long) pack_data, pack_length));
+  DBUG_PRINT("info",
+             ("setFrm data: 0x%lx  len: %lu", (long) pack_data,
+              (ulong) pack_length));
   tab.setFrm(pack_data, pack_length);      
   my_free((char*)data, MYF(0));
   my_free((char*)pack_data, MYF(0));
@@ -5271,7 +5274,7 @@
     {
       uint length= (uint) strlen(name);
       if ((share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
-                                           (byte*) name, length)))
+                                           (uchar*) name, length)))
         handle_trailing_share(share);
     }
     /*
@@ -5350,8 +5353,8 @@
 { 
   Ndb* ndb;
   const NDBTAB *tab;
-  const void *data= NULL, *pack_data= NULL;
-  uint length, pack_length;
+  uchar *data= NULL, *pack_data= NULL;
+  size_t length, pack_length;
   int error= 0;
 
   DBUG_ENTER("create_handler_files");
@@ -6427,13 +6430,13 @@
 
 int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, 
                         const char *name,
-                        const void** frmblob, 
-                        uint* frmlen)
+                        uchar **frmblob, 
+                        size_t *frmlen)
 {
   int error= 0;
   NdbError ndb_error;
-  uint len;
-  const void* data= NULL;
+  size_t len;
+  uchar* data= NULL;
   Ndb* ndb;
   char key[FN_REFLEN];
   DBUG_ENTER("ndbcluster_discover");
@@ -6494,7 +6497,7 @@
       goto err;
     }
     
-    if (unpackfrm(&data, &len, tab->getFrmData()))
+    if (unpackfrm(&data, &len, (uchar*) tab->getFrmData()))
     {
       DBUG_PRINT("error", ("Could not unpack table"));
       error= 1;
@@ -6564,11 +6567,11 @@
 
 
 
-extern "C" byte* tables_get_key(const char *entry, uint *length,
+extern "C" uchar* tables_get_key(const char *entry, size_t *length,
                                 my_bool not_used __attribute__((unused)))
 {
   *length= strlen(entry);
-  return (byte*) entry;
+  return (uchar*) entry;
 }
 
 
@@ -6749,8 +6752,8 @@
       /* finalize construction of path */
       end+= tablename_to_filename(elmt.name, end,
                                   sizeof(key)-(end-key));
-      const void *data= 0, *pack_data= 0;
-      uint length, pack_length;
+      uchar *data= 0, *pack_data= 0;
+      size_t length, pack_length;
       int discover= 0;
       if (readfrm(key, &data, &length) ||
           packfrm(data, length, &pack_data, &pack_length))
@@ -6878,7 +6881,7 @@
         continue;
     }
     DBUG_PRINT("info", ("Inserting %s into ndb_tables hash", elmt.name));     
-    my_hash_insert(&ndb_tables, (byte*)thd->strdup(elmt.name));
+    my_hash_insert(&ndb_tables, (uchar*)thd->strdup(elmt.name));
   }
 
   char *file_name;
@@ -6888,7 +6891,7 @@
   {
     bool file_on_disk= FALSE;
     DBUG_PRINT("info", ("%s", file_name));     
-    if (hash_search(&ndb_tables, file_name, strlen(file_name)))
+    if (hash_search(&ndb_tables, (uchar*) file_name, strlen(file_name)))
     {
       DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
       file_on_disk= TRUE;
@@ -6904,7 +6907,8 @@
       if (file_on_disk)
       {
 	// Ignore this ndb table
-	gptr record=  hash_search(&ndb_tables, file_name, strlen(file_name));
+	uchar *record= hash_search(&ndb_tables, (uchar*) file_name,
+                                   strlen(file_name));
 	DBUG_ASSERT(record);
 	hash_delete(&ndb_tables, record);
 	push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -6917,7 +6921,7 @@
     if (file_on_disk) 
     {
       // File existed in NDB and as frm file, put in ok_tables list
-      my_hash_insert(&ok_tables, (byte*)file_name);
+      my_hash_insert(&ok_tables, (uchar*)file_name);
       continue;
     }
     DBUG_PRINT("info", ("%s existed on disk", name));     
@@ -6955,8 +6959,8 @@
   List<char> create_list;
   for (i= 0 ; i < ndb_tables.records ; i++)
   {
-    file_name= hash_element(&ndb_tables, i);
-    if (!hash_search(&ok_tables, file_name, strlen(file_name)))
+    file_name= (char*) hash_element(&ndb_tables, i);
+    if (!hash_search(&ok_tables, (uchar*) file_name, strlen(file_name)))
     {
       build_table_filename(name, sizeof(name), db, file_name, reg_ext, 0);
       if (my_access(name, F_OK))
@@ -7588,7 +7592,7 @@
   DBUG_PRINT("enter", ("name: %s", name));
   pthread_mutex_lock(&ndbcluster_mutex);
   if (!(share=(NDB_SHARE*) hash_search(&ndbcluster_open_tables,
-                                       (byte*) name,
+                                       (uchar*) name,
                                        strlen(name))))
   {
     pthread_mutex_unlock(&ndbcluster_mutex);
@@ -7813,11 +7817,11 @@
   data we want to or can share.
  */
 
-static byte *ndbcluster_get_key(NDB_SHARE *share,uint *length,
+static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
                                 my_bool not_used __attribute__((unused)))
 {
   *length= share->key_length;
-  return (byte*) share->key;
+  return (uchar*) share->key;
 }
 
 
@@ -7960,7 +7964,7 @@
     at the cost of a possible mem leak, by "renaming" the share
     - First remove from hash
   */
-  hash_delete(&ndbcluster_open_tables, (byte*) share);
+  hash_delete(&ndbcluster_open_tables, (uchar*) share);
 
   /*
     now give it a new name, just a running number
@@ -7970,7 +7974,7 @@
     const uint min_key_length= 10;
     if (share->key_length < min_key_length)
     {
-      share->key= alloc_root(&share->mem_root, min_key_length + 1);
+      share->key= (char*) alloc_root(&share->mem_root, min_key_length + 1);
       share->key_length= min_key_length;
     }
     share->key_length=
@@ -7978,7 +7982,7 @@
                   trailing_share_id++);
   }
   /* Keep it for possible the future trailing free */
-  my_hash_insert(&ndbcluster_open_tables, (byte*) share);
+  my_hash_insert(&ndbcluster_open_tables, (uchar*) share);
 
   DBUG_RETURN(0);
 }
@@ -7994,11 +7998,11 @@
   DBUG_PRINT("rename_share", ("old_key: %s  old__length: %d",
                               share->key, share->key_length));
   if ((tmp= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
-                                     (byte*) new_key, new_length)))
+                                     (uchar*) new_key, new_length)))
     handle_trailing_share(tmp);
 
   /* remove the share from hash */
-  hash_delete(&ndbcluster_open_tables, (byte*) share);
+  hash_delete(&ndbcluster_open_tables, (uchar*) share);
   dbug_print_open_tables();
 
   /* save old stuff if insert should fail */
@@ -8009,18 +8013,18 @@
     now allocate and set the new key, db etc
     enough space for key, db, and table_name
   */
-  share->key= alloc_root(&share->mem_root, 2 * (new_length + 1));
+  share->key= (char*) alloc_root(&share->mem_root, 2 * (new_length + 1));
   strmov(share->key, new_key);
   share->key_length= new_length;
 
-  if (my_hash_insert(&ndbcluster_open_tables, (byte*) share))
+  if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share))
   {
     // ToDo free the allocated stuff above?
     DBUG_PRINT("error", ("rename_share: my_hash_insert %s failed",
                          share->key));
     share->key= old_key;
     share->key_length= old_length;
-    if (my_hash_insert(&ndbcluster_open_tables, (byte*) share))
+    if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share))
     {
       sql_print_error("rename_share: failed to recover %s", share->key);
       DBUG_PRINT("error", ("rename_share: my_hash_insert %s failed",
@@ -8100,7 +8104,7 @@
   if (!have_lock)
     pthread_mutex_lock(&ndbcluster_mutex);
   if (!(share= (NDB_SHARE*) hash_search(&ndbcluster_open_tables,
-                                        (byte*) key,
+                                        (uchar*) key,
                                         length)))
   {
     if (!create_if_not_exists)
@@ -8120,13 +8124,13 @@
       *root_ptr= &share->mem_root; // remember to reset before return
       share->state= NSS_INITIAL;
       /* enough space for key, db, and table_name */
-      share->key= alloc_root(*root_ptr, 2 * (length + 1));
+      share->key= (char*) alloc_root(*root_ptr, 2 * (length + 1));
       share->key_length= length;
       strmov(share->key, key);
-      if (my_hash_insert(&ndbcluster_open_tables, (byte*) share))
+      if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share))
       {
         free_root(&share->mem_root, MYF(0));
-        my_free((gptr) share, 0);
+        my_free((uchar*) share, 0);
         *root_ptr= old_root;
         if (!have_lock)
           pthread_mutex_unlock(&ndbcluster_mutex);
@@ -8169,7 +8173,7 @@
   DBUG_ENTER("ndbcluster_real_free_share");
   dbug_print_share("ndbcluster_real_free_share:", *share);
 
-  hash_delete(&ndbcluster_open_tables, (byte*) *share);
+  hash_delete(&ndbcluster_open_tables, (uchar*) *share);
   thr_lock_delete(&(*share)->lock);
   pthread_mutex_destroy(&(*share)->mutex);
 
@@ -8181,15 +8185,15 @@
     // (*share)->table_share->mem_root is freed by free_table_share
     free_table_share((*share)->table_share);
 #ifndef DBUG_OFF
-    bzero((gptr)(*share)->table_share, sizeof(*(*share)->table_share));
-    bzero((gptr)(*share)->table, sizeof(*(*share)->table));
+    bzero((uchar*)(*share)->table_share, sizeof(*(*share)->table_share));
+    bzero((uchar*)(*share)->table, sizeof(*(*share)->table));
     (*share)->table_share= 0;
     (*share)->table= 0;
 #endif
   }
 #endif
   free_root(&(*share)->mem_root, MYF(0));
-  my_free((gptr) *share, MYF(0));
+  my_free((uchar*) *share, MYF(0));
   *share= 0;
 
   dbug_print_open_tables();
@@ -8414,13 +8418,13 @@
   KEY* key_info= table->key_info + active_index;
   KEY_MULTI_RANGE *range= ranges;
   ulong reclength= table->s->reclength;
-  byte *curr= (byte*)buffer->buffer;
-  byte *end_of_buffer= (byte*)buffer->buffer_end;
+  uchar *curr= (uchar*)buffer->buffer;
+  uchar *end_of_buffer= (uchar*)buffer->buffer_end;
   
   for (; range<end_range && curr+reclength <= end_of_buffer; 
        range++)
   {
-    const byte *key= range->start_key.key;
+    const uchar *key= range->start_key.key;
     uint key_len= range->start_key.length;
     if (check_null_in_key(key_info, key, key_len))
       DBUG_RETURN(TRUE);
@@ -8488,8 +8492,8 @@
   /**
    * Variables for loop
    */
-  byte *curr= (byte*)buffer->buffer;
-  byte *end_of_buffer= (byte*)buffer->buffer_end;
+  uchar *curr= (uchar*)buffer->buffer;
+  uchar *end_of_buffer= (uchar*)buffer->buffer_end;
   NdbOperation::LockMode lm= 
     (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
   bool need_pk = (lm == NdbOperation::LM_Read);
@@ -8618,7 +8622,7 @@
      * This as we don't want mysqld to reuse the buffer when we read
      *   the remaining ranges
      */
-    buffer->end_of_used_area= (byte*)buffer->buffer_end;
+    buffer->end_of_used_area= (uchar*)buffer->buffer_end;
   }
   else
   {
@@ -8634,7 +8638,7 @@
   {
     m_multi_range_defined= multi_range_curr;
     multi_range_curr= ranges;
-    m_multi_range_result_ptr= (byte*)buffer->buffer;
+    m_multi_range_result_ptr= (uchar*)buffer->buffer;
     DBUG_RETURN(read_multi_range_next(found_range_p));
   }
   ERR_RETURN(m_active_trans->getNdbError());
@@ -8853,7 +8857,7 @@
   char *str;
   const char *fmt="%s%snumber_of_replicas: %d";
   const unsigned fmt_len_plus_extra= length + strlen(fmt);
-  if ((str= my_malloc(fmt_len_plus_extra, MYF(0))) == NULL)
+  if ((str= (char*) my_malloc(fmt_len_plus_extra, MYF(0))) == NULL)
   {
     sql_print_error("ha_ndbcluster::update_table_comment: "
                     "my_malloc(%u) failed", (unsigned int)fmt_len_plus_extra);

--- 1.58/storage/ndb/src/ndbapi/NdbBlob.cpp	2007-05-10 11:59:33 +02:00
+++ 1.59/storage/ndb/src/ndbapi/NdbBlob.cpp	2007-06-17 16:27:11 +02:00
@@ -1262,6 +1262,7 @@
         DBUG_RETURN(-1);
       }
       tOp->m_abortOption= NdbOperation::AO_IgnoreError;
+      tOp->m_noErrorPropagation = true;
       n++;
     }
     DBUG_PRINT("info", ("bat=%u", bat));
@@ -1598,6 +1599,7 @@
       }
       if (isWriteOp()) {
         tOp->m_abortOption = NdbOperation::AO_IgnoreError;
+        tOp->m_noErrorPropagation = true;
       }
       theHeadInlineReadOp = tOp;
       // execute immediately
@@ -1644,6 +1646,7 @@
       }
       if (isWriteOp()) {
         tOp->m_abortOption = NdbOperation::AO_IgnoreError;
+        tOp->m_noErrorPropagation = true;
       }
       theHeadInlineReadOp = tOp;
       // execute immediately

--- 1.48/storage/ndb/tools/restore/consumer_restore.cpp	2007-05-24 00:39:27 +02:00
+++ 1.49/storage/ndb/tools/restore/consumer_restore.cpp	2007-06-17 16:27:11 +02:00
@@ -1159,19 +1159,22 @@
 	char * dataPtr = attr_data->string_value;
 	Uint32 length = 0;
        
-        const unsigned char * src = (const unsigned char *)dataPtr;
-        switch(attr_desc->m_column->getType()){
-        case NdbDictionary::Column::Varchar:
-        case NdbDictionary::Column::Varbinary:
-          length = src[0] + 1;
-          break;
-        case NdbDictionary::Column::Longvarchar:
-        case NdbDictionary::Column::Longvarbinary:
-          length = src[0] + (src[1] << 8) + 2;
-          break;
-        default:
-          length = attr_data->size;
-          break;
+        if (!attr_data->null)
+        {
+          const unsigned char * src = (const unsigned char *)dataPtr;
+          switch(attr_desc->m_column->getType()){
+          case NdbDictionary::Column::Varchar:
+          case NdbDictionary::Column::Varbinary:
+            length = src[0] + 1;
+            break;
+          case NdbDictionary::Column::Longvarchar:
+          case NdbDictionary::Column::Longvarbinary:
+            length = src[0] + (src[1] << 8) + 2;
+            break;
+          default:
+            length = attr_data->size;
+            break;
+          }
         }
 	if (j == 0 && tup.getTable()->have_auto_inc(i))
 	  tup.getTable()->update_max_auto_val(dataPtr,size*arraySize);
Thread
bk commit into 5.1 tree (tomas:1.2551)tomas17 Jun