MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:September 7 2009 9:54am
Subject:bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3035) Bug#36701
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-6.3_orig/

 3035 Martin Skold	2009-09-07 [merge]
      Merge
      modified:
        sql/ha_ndbcluster.cc
        sql/ha_ndbcluster.h
        storage/ndb/include/ndbapi/NdbBlob.hpp
        storage/ndb/src/ndbapi/NdbBlob.cpp
        storage/ndb/tools/restore/Restore.cpp

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2009-09-04 10:36:34 +0000
+++ b/sql/ha_ndbcluster.cc	2009-09-07 09:54:01 +0000
@@ -1324,6 +1324,19 @@ bool ha_ndbcluster::uses_blob_value(cons
   return FALSE;
 }
 
+void ha_ndbcluster::release_blobs_buffer()
+{
+  DBUG_ENTER("releaseBlobsBuffer");
+  if (m_blob_total_size > 0)
+  {
+    DBUG_PRINT("info", ("Deleting blobs buffer, size %llu", m_blob_total_size));
+    my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
+    m_blobs_buffer= 0;
+    m_blob_total_size= 0;
+    m_blobs_buffer_size= 0;
+  }
+  DBUG_VOID_RETURN;
+}
 
 /**
   Get metadata for this table from NDB.
@@ -5654,6 +5667,7 @@ int ha_ndbcluster::init_handler_for_stat
   // Start of transaction
   m_rows_changed= 0;
   m_blobs_pending= FALSE;
+  release_blobs_buffer();
   m_slow_path= m_thd_ndb->m_slow_path;
 #ifdef HAVE_NDB_BINLOG
   if (unlikely(m_slow_path))
@@ -7813,6 +7827,7 @@ ha_ndbcluster::ha_ndbcluster(handlerton 
   m_update_cannot_batch(FALSE),
   m_skip_auto_increment(TRUE),
   m_blobs_pending(0),
+  m_blob_total_size(0),
   m_blobs_buffer(0),
   m_blobs_buffer_size(0),
   m_dupkey((uint) -1),
@@ -7865,8 +7880,7 @@ ha_ndbcluster::~ha_ndbcluster() 
     free_share(&m_share);
   }
   release_metadata(thd, ndb);
-  my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
-  m_blobs_buffer= 0;
+  release_blobs_buffer();
 
   // Check for open cursor/transaction
   DBUG_ASSERT(m_active_cursor == NULL);

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2009-05-27 12:11:46 +0000
+++ b/sql/ha_ndbcluster.h	2009-09-07 09:54:01 +0000
@@ -700,6 +700,7 @@ private:
   int set_blob_values(const NdbOperation *ndb_op, my_ptrdiff_t row_offset,
                       const MY_BITMAP *bitmap, uint *set_count, bool batch);
   friend int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg);
+  void release_blobs_buffer();
   Uint32 setup_get_hidden_fields(NdbOperation::GetValueSpec gets[2]);
   void get_hidden_fields_keyop(NdbOperation::OperationOptions *options,
                                NdbOperation::GetValueSpec gets[2]);

=== modified file 'storage/ndb/include/ndbapi/NdbBlob.hpp'
--- a/storage/ndb/include/ndbapi/NdbBlob.hpp	2009-06-15 07:42:02 +0000
+++ b/storage/ndb/include/ndbapi/NdbBlob.hpp	2009-09-07 09:54:01 +0000
@@ -369,6 +369,7 @@ private:
     Buf();
     ~Buf();
     void alloc(unsigned n);
+    void release();
     void zerorest();
     void copyfrom(const Buf& src);
   };

=== modified file 'storage/ndb/src/ndbapi/NdbBlob.cpp'
--- a/storage/ndb/src/ndbapi/NdbBlob.cpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/src/ndbapi/NdbBlob.cpp	2009-09-07 09:54:01 +0000
@@ -358,6 +358,13 @@ NdbBlob::init()
 void
 NdbBlob::release()
 {
+  theKeyBuf.release();
+  theAccessKeyBuf.release();
+  thePackKeyBuf.release();
+  theHeadInlineBuf.release();
+  theHeadInlineCopyBuf.release();
+  thePartBuf.release();
+  theBlobEventDataBuf.release();
   setState(Idle);
 }
 
@@ -393,6 +400,16 @@ NdbBlob::Buf::alloc(unsigned n)
 }
 
 void
+NdbBlob::Buf::release()
+{
+  if (data)
+    delete [] data;
+  data = NULL;
+  size = 0;
+  maxsize = 0;
+}
+
+void
 NdbBlob::Buf::zerorest()
 {
   assert(size <= maxsize);

=== modified file 'storage/ndb/tools/restore/Restore.cpp'
--- a/storage/ndb/tools/restore/Restore.cpp	2009-08-18 13:02:20 +0000
+++ b/storage/ndb/tools/restore/Restore.cpp	2009-09-07 09:54:01 +0000
@@ -1795,7 +1795,9 @@ operator<<(NdbOut& ndbout, const Attribu
   
   NdbRecAttr tmprec(0);
   tmprec.setup(desc.m_column, 0);
-  tmprec.receive_data((Uint32*)data.void_value, data.size);
+  Uint32 length = (desc.size)/8 * (desc.arraySize);
+  tmprec.receive_data((Uint32*)data.void_value, length);
+
   ndbrecattr_print_formatted(ndbout, tmprec, g_ndbrecord_print_format);
 
   return ndbout;

Thread
bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3035) Bug#36701Martin Skold7 Sep
  • Re: bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3035)Bug#36701Jonas Oreland7 Sep