List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:March 11 2008 6:11am
Subject:bk commit into 5.0 tree (stewart:1.2527)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart 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, 2008-03-11 17:11:07+11:00, stewart@stripped +1 -0
  [PATCH] WL4012 ndb_mgmd on win32: fix ha_ndbcluster mysqld build on win32
  
  a few trivial build things for MSVC compiler, use portable time functions

  sql/ha_ndbcluster.cc@stripped, 2008-03-11 17:05:43+11:00, stewart@stripped +18 -36
    WL4012 ndb_mgmd on win32: fix ha_ndbcluster mysqld build on win32

diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2007-07-31 01:27:30 +10:00
+++ b/sql/ha_ndbcluster.cc	2008-03-11 17:05:43 +11:00
@@ -666,7 +666,7 @@ int ha_ndbcluster::set_ndb_key(NdbOperat
 int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, 
                                  uint fieldnr, bool *set_blob_value)
 {
-  const byte* field_ptr= field->ptr;
+  const byte* field_ptr= (byte*) field->ptr;
   uint32 pack_len=  field->pack_length();
   DBUG_ENTER("set_ndb_value");
   DBUG_PRINT("enter", ("%d: %s, type: %u, len=%d, is_null=%s", 
@@ -729,7 +729,7 @@ int ha_ndbcluster::set_ndb_value(NdbOper
       Field_blob *field_blob= (Field_blob*)field;
 
       // Get length and pointer to data
-      uint32 blob_len= field_blob->get_length(field_ptr);
+      uint32 blob_len= field_blob->get_length((char*) field_ptr);
       char* blob_ptr= NULL;
       field_blob->get_ptr(&blob_ptr);
 
@@ -861,15 +861,15 @@ int ha_ndbcluster::get_ndb_value(NdbOper
         {
           byte *field_buf;
           if (field->pack_length() != 0)
-            field_buf= buf + (field->ptr - table->record[0]);
+            field_buf= buf + ((byte*) field->ptr - table->record[0]);
           else
             field_buf= (byte *)&dummy_buf;
-          m_value[fieldnr].rec= ndb_op->getValue(fieldnr, 
-                                                 field_buf);
+          m_value[fieldnr].rec= ndb_op->getValue((Uint32) fieldnr,
+                                                 (char*) field_buf);
         }
         else // if (field->type() == MYSQL_TYPE_BIT)
         {
-          m_value[fieldnr].rec= ndb_op->getValue(fieldnr);
+          m_value[fieldnr].rec= ndb_op->getValue((Uint32) fieldnr);
         }
         DBUG_RETURN(m_value[fieldnr].rec == NULL);
       }
@@ -888,7 +888,7 @@ int ha_ndbcluster::get_ndb_value(NdbOper
   }
 
   // Used for hidden key only
-  m_value[fieldnr].rec= ndb_op->getValue(fieldnr, m_ref);
+  m_value[fieldnr].rec= ndb_op->getValue((Uint32) fieldnr, (char*) m_ref);
   DBUG_RETURN(m_value[fieldnr].rec == NULL);
 }
 
@@ -1312,7 +1312,7 @@ static void shrink_varchar(Field* field,
         buf[0]= 255;
       }
       memmove(buf + 1, ptr + 2, pack_len - 1);
-      ptr= buf;
+      ptr= (byte*) buf;
     }
   }
 }
@@ -1971,7 +1971,7 @@ int ha_ndbcluster::set_bounds(NdbIndexSc
         p.part_ptr= &p.key->key[tot_len];
         p.part_null= key_part->null_bit && *p.part_ptr;
         p.bound_ptr= (const char *)
-          p.part_null ? 0 : key_part->null_bit ? p.part_ptr + 1 : p.part_ptr;
+          (p.part_null ? 0 : key_part->null_bit ? p.part_ptr + 1 : p.part_ptr);
 
         if (j == 0)
         {
@@ -2067,7 +2067,7 @@ int ha_ndbcluster::set_bounds(NdbIndexSc
         // Set bound if not cancelled via type -1
         if (p.bound_type != -1)
         {
-          const char* ptr= p.bound_ptr;
+          const byte* ptr= (const byte*) p.bound_ptr;
           char buf[256];
           shrink_varchar(field, ptr, buf);
           if (op->setBound(i, p.bound_type, ptr))
@@ -2546,7 +2546,7 @@ int ha_ndbcluster::update_row(const byte
       
       // Require that the PK for this record has previously been 
       // read into m_ref
-      DBUG_DUMP("key", m_ref, NDB_HIDDEN_PRIMARY_KEY_LENGTH);
+      DBUG_DUMP("key", (char*) m_ref, NDB_HIDDEN_PRIMARY_KEY_LENGTH);
       
       if (set_hidden_key(op, table->s->fields, m_ref))
         ERR_RETURN(op->getNdbError());
@@ -5370,7 +5370,7 @@ int ndbcluster_find_files(THD *thd,const
   {
     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, (byte*) file_name, strlen(file_name)))
     {
       DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
       file_on_disk= true;
@@ -5387,9 +5387,9 @@ int ndbcluster_find_files(THD *thd,const
       if (file_on_disk)
       {
 	// Ignore this ndb table
-	gptr record=  hash_search(&ndb_tables, file_name, strlen(file_name));
+	gptr record=  hash_search(&ndb_tables, (byte*) file_name, strlen(file_name));
 	DBUG_ASSERT(record);
-	hash_delete(&ndb_tables, record);
+	hash_delete(&ndb_tables, (byte*) record);
 	push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 			    ER_TABLE_EXISTS_ERROR,
 			    "Local table %s.%s shadows ndb table",
@@ -5420,8 +5420,8 @@ int ndbcluster_find_files(THD *thd,const
   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, (byte*) file_name, strlen(file_name)))
     {
       DBUG_PRINT("info", ("%s must be discovered", file_name));       
       // File is in list of ndb tables and not in ok_tables
@@ -6208,7 +6208,7 @@ static int unpackfrm(const void **unpack
      sql_print_error("unpackfrm: ver != 1");
      DBUG_RETURN(1);
    }
-   if (!(data= my_malloc(max(orglen, complen), MYF(MY_WME))))
+   if (!(data= (byte*) my_malloc(max(orglen, complen), MYF(MY_WME))))
    {
      sql_print_error("unpackfrm: my_malloc(%u)",
                      (unsigned int)max(orglen, complen));
@@ -6994,25 +6994,7 @@ pthread_handler_t ndb_util_thread_func(v
     }
 next:
     /* Calculate new time to wake up */
-    int secs= 0;
-    int msecs= ndb_cache_check_time;
-
-    struct timeval tick_time;
-    gettimeofday(&tick_time, 0);
-    abstime.tv_sec=  tick_time.tv_sec;
-    abstime.tv_nsec= tick_time.tv_usec * 1000;
-
-    if (msecs >= 1000){
-      secs=  msecs / 1000;
-      msecs= msecs % 1000;
-    }
-
-    abstime.tv_sec+=  secs;
-    abstime.tv_nsec+= msecs * 1000000;
-    if (abstime.tv_nsec >= 1000000000) {
-      abstime.tv_sec+=  1;
-      abstime.tv_nsec-= 1000000000;
-    }
+    set_timespec_nsec(abstime, ndb_cache_check_time * 1000000ULL);
   }
 
   if (share_list)
Thread
bk commit into 5.0 tree (stewart:1.2527)Stewart Smith11 Mar