List:Commits« Previous MessageNext Message »
From:Martin Skold Date:January 19 2012 12:31pm
Subject:bzr push into mysql-5.5-cluster-7.2 branch (Martin.Skold:3772 to 3773)
View as plain text  
 3773 Martin Skold	2012-01-19 [merge]
      Merge

    modified:
      mysql-test/suite/ndb/r/ndb_condition_pushdown.result
      mysql-test/suite/ndb/t/ndb_condition_pushdown.test
      sql/ha_ndbcluster_cond.cc
      storage/ndb/include/ndbapi/Ndb.hpp
      storage/ndb/include/ndbapi/NdbDictionary.hpp
      storage/ndb/include/ndbapi/NdbOperation.hpp
      storage/ndb/include/ndbapi/NdbScanOperation.hpp
      storage/ndb/include/transporter/TransporterRegistry.hpp
      storage/ndb/src/common/transporter/TransporterRegistry.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/error/ErrorReporter.cpp
      storage/ndb/src/kernel/vm/Emulator.cpp
      storage/ndb/src/kernel/vm/Emulator.hpp
 3772 Mauritz Sundell	2012-01-18
      undo commit 3771

    removed:
      storage/ndb/src/kernel/vm/CMakeLists.txt.rej
      storage/ndb/src/kernel/vm/CountingPool.cpp
      storage/ndb/src/kernel/vm/CountingPool.hpp
      storage/ndb/src/kernel/vm/PackPool.cpp
      storage/ndb/src/kernel/vm/PackPool.hpp
      storage/ndb/src/kernel/vm/PagePool.cpp
      storage/ndb/src/kernel/vm/PagePool.hpp
    modified:
      .bzr-mysql/default.conf
      mysql-test/suite/ndb/r/ndbinfo.result
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp
      storage/ndb/src/kernel/blocks/record_types.hpp
      storage/ndb/src/kernel/vm/CMakeLists.txt
      storage/ndb/src/kernel/vm/Pool.cpp
      storage/ndb/src/kernel/vm/Pool.hpp
      storage/ndb/src/kernel/vm/ndbd_malloc_impl.hpp
      storage/ndb/tools/ndbinfo_sql.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_condition_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result	2011-11-21 14:00:07 +0000
+++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result	2012-01-19 12:28:47 +0000
@@ -2393,5 +2393,16 @@ select b from mytab where a like -1 havi
 b
 1
 drop table mytab;
+create table t(a bigint unsigned not null primary key auto_increment, b varchar(100)) character set utf8 engine ndb;
+insert into t (b) values('abc'),('aaa'),('bbb'),('ccc');
+select * from t where b like 'a%';
+a	b
+1	abc
+2	aaa
+select * from t where b not like 'a%';
+a	b
+3	bbb
+4	ccc
+drop table t;
 set @@session.optimizer_switch = @old_ecpd;
 DROP TABLE t1,t2,t3,t4,t5;

=== modified file 'mysql-test/suite/ndb/t/ndb_condition_pushdown.test'
--- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test	2011-11-21 14:00:07 +0000
+++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test	2012-01-19 12:28:47 +0000
@@ -2414,6 +2414,16 @@ select b from mytab where a like -1 havi
 
 drop table mytab;
 
+# Bug #13579318 LIKE SEARCH DOESN'T MATCH ANY ROWS ON A MULTI BYTE CHARSET COLUMN
+create table t(a bigint unsigned not null primary key auto_increment, b varchar(100)) character set utf8 engine ndb;
+
+insert into t (b) values('abc'),('aaa'),('bbb'),('ccc');
+--sorted_result
+select * from t where b like 'a%';
+--sorted_result
+select * from t where b not like 'a%';
+drop table t;
+
 set @@session.optimizer_switch = @old_ecpd;
 DROP TABLE t1,t2,t3,t4,t5;
 

=== modified file 'sql/ha_ndbcluster_cond.cc'
--- a/sql/ha_ndbcluster_cond.cc	2011-11-21 14:00:07 +0000
+++ b/sql/ha_ndbcluster_cond.cc	2012-01-19 12:28:47 +0000
@@ -1354,13 +1354,14 @@ ha_ndbcluster_cond::build_scan_filter_pr
       if (!value || !field) break;
       bool is_string= (value->qualification.value_type == Item::STRING_ITEM);
       // Save value in right format for the field type
-      uint32 len= value->save_in_field(field);
+      uint32 val_len= value->save_in_field(field);
       char buff[MAX_FIELD_WIDTH];
       String str(buff,sizeof(buff),field->get_field_charset());
-      if (len > field->get_field()->field_length)
-        str.set(value->get_val(), len, field->get_field_charset());
+      if (val_len > field->get_field()->field_length)
+        str.set(value->get_val(), val_len, field->get_field_charset());
       else
         field->get_field_val_str(&str);
+      uint32 len= str.length();
       const char *val=
         ((value->is_const_func() || value->is_cached()) && is_string)?
         str.ptr()
@@ -1382,13 +1383,14 @@ ha_ndbcluster_cond::build_scan_filter_pr
       if (!value || !field) break;
       bool is_string= (value->qualification.value_type == Item::STRING_ITEM);
       // Save value in right format for the field type
-      uint32 len= value->save_in_field(field);
+      uint32 val_len= value->save_in_field(field);
       char buff[MAX_FIELD_WIDTH];
       String str(buff,sizeof(buff),field->get_field_charset());
-      if (len > field->get_field()->field_length)
-        str.set(value->get_val(), len, field->get_field_charset());
+      if (val_len > field->get_field()->field_length)
+        str.set(value->get_val(), val_len, field->get_field_charset());
       else
         field->get_field_val_str(&str);
+      uint32 len= str.length();
       const char *val=
         ((value->is_const_func() || value->is_cached()) && is_string)?
         str.ptr()

=== modified file 'storage/ndb/include/ndbapi/Ndb.hpp'
--- a/storage/ndb/include/ndbapi/Ndb.hpp	2011-10-20 19:52:11 +0000
+++ b/storage/ndb/include/ndbapi/Ndb.hpp	2012-01-19 12:28:47 +0000
@@ -1380,6 +1380,14 @@ public:
 
   struct PartitionSpec
   {
+    /*
+      Size of the PartitionSpec structure.
+    */
+    static inline Uint32 size()
+    {
+        return sizeof(PartitionSpec);
+    }
+
     enum SpecType
     {
       PS_NONE                = 0,

=== modified file 'storage/ndb/include/ndbapi/NdbDictionary.hpp'
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp	2011-09-29 09:23:04 +0000
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp	2012-01-19 12:28:47 +0000
@@ -1657,6 +1657,14 @@ public:
   };
   struct RecordSpecification {
     /*
+      Size of the RecordSpecification structure.
+    */
+    static inline Uint32 size()
+    {
+        return sizeof(RecordSpecification);
+    }
+
+    /*
       Column described by this entry (the column maximum size defines field
       size in row).
       Note that even when creating an NdbRecord for an index, the column

=== modified file 'storage/ndb/include/ndbapi/NdbOperation.hpp'
--- a/storage/ndb/include/ndbapi/NdbOperation.hpp	2011-09-29 09:23:04 +0000
+++ b/storage/ndb/include/ndbapi/NdbOperation.hpp	2012-01-19 12:28:47 +0000
@@ -1029,6 +1029,14 @@ public:
   struct OperationOptions
   {
     /*
+      Size of the OperationOptions structure.
+    */
+    static inline Uint32 size()
+    {
+        return sizeof(OperationOptions);
+    }
+
+    /*
      * Which options are present.  See below for option details
      */
     Uint64 optionsPresent;

=== modified file 'storage/ndb/include/ndbapi/NdbScanOperation.hpp'
--- a/storage/ndb/include/ndbapi/NdbScanOperation.hpp	2011-10-19 12:19:45 +0000
+++ b/storage/ndb/include/ndbapi/NdbScanOperation.hpp	2012-01-19 12:28:47 +0000
@@ -107,6 +107,14 @@ public:
    */
   struct ScanOptions
   {
+    /*
+      Size of the ScanOptions structure.
+    */
+    static inline Uint32 size()
+    {
+        return sizeof(ScanOptions);
+    }
+
     /* Which options are present - see below for possibilities */
     Uint64 optionsPresent;
 

=== modified file 'storage/ndb/include/transporter/TransporterRegistry.hpp'
--- a/storage/ndb/include/transporter/TransporterRegistry.hpp	2012-01-17 08:33:59 +0000
+++ b/storage/ndb/include/transporter/TransporterRegistry.hpp	2012-01-19 12:28:47 +0000
@@ -103,6 +103,11 @@ struct TransporterReceiveData
   bool epoll_add(TCP_Transporter*);
 
   /**
+   * Bitmask of transporters currently handled by this instance
+   */
+  NodeBitmask m_transporters;
+
+  /**
    * Bitmask of transporters that has data "carried over" since
    *   last performReceive
    */

=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-01-18 13:45:11 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-01-19 12:28:47 +0000
@@ -76,6 +76,13 @@ SocketServer::Session * TransporterServi
 
 TransporterReceiveData::TransporterReceiveData()
 {
+  /**
+   * With multi receiver threads
+   *   an interface to reassign these is needed...
+   */
+  m_transporters.set();            // Handle all
+  m_transporters.clear(Uint32(0)); // Except wakeup socket...
+
 #if defined(HAVE_EPOLL_CREATE)
   m_epoll_fd = -1;
   m_epoll_events = 0;
@@ -111,6 +118,7 @@ fallback:
 bool
 TransporterReceiveData::epoll_add(TCP_Transporter *t)
 {
+  assert(m_transporters.get(t->getRemoteNodeId()));
 #if defined(HAVE_EPOLL_CREATE)
   if (m_epoll_fd != -1)
   {
@@ -382,7 +390,7 @@ TransporterRegistry::init(NodeId nodeId)
 
   if (receiveHandle)
   {
-    if (!receiveHandle->init(maxTransporters))
+    if (!init(* receiveHandle))
       DBUG_RETURN(false);
   }
 
@@ -992,6 +1000,8 @@ TransporterRegistry::setup_wakeup_socket
     return true;
   }
 
+  assert(!recvdata.m_transporters.get(0));
+
   if (my_socketpair(m_extra_wakeup_sockets))
   {
     perror("socketpair failed!");
@@ -1025,6 +1035,7 @@ TransporterRegistry::setup_wakeup_socket
   }
 #endif
   m_has_extra_wakeup_socket = true;
+  recvdata.m_transporters.set(Uint32(0));
   return true;
 
 err:
@@ -1109,6 +1120,11 @@ TransporterRegistry::pollReceive(Uint32 
           continue;
         }
 #endif
+        /**
+         * check that it's assigned to "us"
+         */
+        assert(recvdata.m_transporters.get(trpid));
+
         recvdata.m_has_data_transporters.set(trpid);
       }
     }
@@ -1153,6 +1169,10 @@ TransporterRegistry::poll_SCI(Uint32 tim
   {
     SCI_Transporter * t = theSCITransporters[i];
     Uint32 node_id = t->getRemoteNodeId();
+
+    if (!recvdata.m_transporters.get(nodeId))
+      continue;
+
     if (t->isConnected() && is_connected(node_id))
     {
       if (t->hasDataToRead())
@@ -1182,6 +1202,10 @@ TransporterRegistry::poll_SHM(Uint32 tim
     {
       SHM_Transporter * t = theSHMTransporters[i];
       Uint32 node_id = t->getRemoteNodeId();
+
+      if (!recvdata.m_transporters.get(node_id))
+        continue;
+
       if (t->isConnected() && is_connected(node_id))
       {
 	if (t->hasDataToRead())
@@ -1214,7 +1238,7 @@ TransporterRegistry::poll_TCP(Uint32 tim
 
   recvdata.m_socket_poller.clear();
 
-  if (m_has_extra_wakeup_socket)
+  if (m_has_extra_wakeup_socket && recvdata.m_transporters.get(0))
   {
     const NDB_SOCKET_TYPE socket = m_extra_wakeup_sockets[0];
 
@@ -1229,6 +1253,9 @@ TransporterRegistry::poll_TCP(Uint32 tim
     const NDB_SOCKET_TYPE socket = t->getSocket();
     Uint32 node_id = t->getRemoteNodeId();
 
+    if (!recvdata.m_transporters.get(node_id))
+      continue;
+
     if (is_connected(node_id) && t->isConnected() && my_socket_valid(socket))
     {
       idx[i] = recvdata.m_socket_poller.add(socket, true, false, false);
@@ -1285,6 +1312,7 @@ TransporterRegistry::performReceive(Tran
 
   if (recvdata.m_has_data_transporters.get(0))
   {
+    assert(recvdata.m_transporters.get(0));
     recvdata.m_has_data_transporters.clear(Uint32(0));
     consume_extra_sockets();
   }
@@ -1309,6 +1337,9 @@ TransporterRegistry::performReceive(Tran
   {
     bool hasdata = false;
     TCP_Transporter * t = (TCP_Transporter*)theTransporters[id];
+
+    assert(recvdata.m_transporters.get(id));
+
     if (is_connected(id))
     {
       if (t->isConnected())
@@ -1337,6 +1368,7 @@ TransporterRegistry::performReceive(Tran
   {
     SCI_Transporter  *t = theSCITransporters[i];
     const NodeId nodeId = t->getRemoteNodeId();
+    assert(recvdata.m_transporters.get(nodeId));
     if(is_connected(nodeId))
     {
       if(t->isConnected() && t->checkConnected())
@@ -1358,6 +1390,7 @@ TransporterRegistry::performReceive(Tran
   {
     SHM_Transporter *t = theSHMTransporters[i];
     const NodeId nodeId = t->getRemoteNodeId();
+    assert(recvdata.m_transporters.get(nodeId));
     if(is_connected(nodeId)){
       if(t->isConnected() && t->checkConnected())
       {
@@ -1509,6 +1542,7 @@ TransporterRegistry::blockReceive(Transp
                                   NodeId nodeId)
 {
   assert((receiveHandle == &recvdata) || (receiveHandle == 0));
+  assert(recvdata.m_transporters.get(nodeId));
 
   /* Check that node is not already blocked?
    * Stop pulling from its socket (but track received data etc)
@@ -1531,6 +1565,7 @@ TransporterRegistry::unblockReceive(Tran
                                     NodeId nodeId)
 {
   assert((receiveHandle == &recvdata) || (receiveHandle == 0));
+  assert(recvdata.m_transporters.get(nodeId));
 
   /* Check that node is blocked?
    * Resume pulling from its socket
@@ -1644,6 +1679,7 @@ TransporterRegistry::report_connect(Tran
                                     NodeId node_id)
 {
   assert((receiveHandle == &recvdata) || (receiveHandle == 0));
+  assert(recvdata.m_transporters.get(node_id));
 
   DBUG_ENTER("TransporterRegistry::report_connect");
   DBUG_PRINT("info",("performStates[%d]=CONNECTED",node_id));
@@ -1677,6 +1713,7 @@ TransporterRegistry::report_disconnect(T
                                        NodeId node_id, int errnum)
 {
   assert((receiveHandle == &recvdata) || (receiveHandle == 0));
+  assert(recvdata.m_transporters.get(node_id));
 
   DBUG_ENTER("TransporterRegistry::report_disconnect");
   DBUG_PRINT("info",("performStates[%d]=DISCONNECTED",node_id));
@@ -1735,6 +1772,8 @@ TransporterRegistry::update_connections(
     n++;
 
     const NodeId nodeId = t->getRemoteNodeId();
+    if (!recvdata.m_transporters.get(nodeId))
+      continue;
 
     TransporterError code = m_error_states[nodeId].m_code;
     const char *info = m_error_states[nodeId].m_info;

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2012-01-18 15:16:38 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2012-01-19 12:28:47 +0000
@@ -16531,8 +16531,11 @@ void Dbdict::createEvent_sendReply(Signa
       evntRecPtr.p->m_errorLine = __LINE__;
       evntRecPtr.p->m_errorNode = reference();
       jam();
-    } else
+    }
+    else
+    {
       jam();
+    }
   }
 
   // reference to API if master DICT

=== modified file 'storage/ndb/src/kernel/error/ErrorReporter.cpp'
--- a/storage/ndb/src/kernel/error/ErrorReporter.cpp	2011-12-30 13:19:46 +0000
+++ b/storage/ndb/src/kernel/error/ErrorReporter.cpp	2012-01-19 12:28:47 +0000
@@ -213,9 +213,6 @@ ErrorReporter::handleAssert(const char* 
 #ifdef NO_EMULATED_JAM
   BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d",
 	   file, line);
-  jam = NULL;
-  jamIndex = 0;
-  jamBlockNumber = 0;
 #else
   const EmulatedJamBuffer *jamBuffer =
     (EmulatedJamBuffer *)NdbThread_GetTlsKey(NDB_THREAD_TLS_JAM);

=== modified file 'storage/ndb/src/kernel/vm/Emulator.cpp'
--- a/storage/ndb/src/kernel/vm/Emulator.cpp	2011-09-27 06:44:06 +0000
+++ b/storage/ndb/src/kernel/vm/Emulator.cpp	2012-01-19 06:21:05 +0000
@@ -79,7 +79,12 @@ EmulatorData::create(){
     Global jam() buffer, for non-multithreaded operation.
     For multithreaded ndbd, each thread will set a local jam buffer later.
   */
-  NdbThread_SetTlsKey(NDB_THREAD_TLS_JAM, (void *)&theEmulatedJamBuffer);
+#ifndef NO_EMULATED_JAM
+  void * jamBuffer = (void *)&theEmulatedJamBuffer;
+#else
+  void * jamBuffer = 0;
+#endif
+  NdbThread_SetTlsKey(NDB_THREAD_TLS_JAM, jamBuffer);
 
   NdbMem_Create();
 

=== modified file 'storage/ndb/src/kernel/vm/Emulator.hpp'
--- a/storage/ndb/src/kernel/vm/Emulator.hpp	2012-01-16 07:14:30 +0000
+++ b/storage/ndb/src/kernel/vm/Emulator.hpp	2012-01-19 06:21:05 +0000
@@ -37,18 +37,17 @@ extern struct GlobalData          global
 extern class SignalLoggerManager globalSignalLoggers;
 #endif
 
-#ifndef NO_EMULATED_JAM
 /* EMULATED_JAM_SIZE must be a power of two, so JAM_MASK will work. */
 #define EMULATED_JAM_SIZE 1024
 #define JAM_MASK (EMULATED_JAM_SIZE - 1)
 
-struct EmulatedJamBuffer {
+struct EmulatedJamBuffer
+{
   Uint32 theEmulatedJamIndex;
   // last block entry, used in dumpJam() if jam contains no block entries
   Uint32 theEmulatedJamBlockNumber;
   Uint32 theEmulatedJam[EMULATED_JAM_SIZE];
 };
-#endif
 
 struct EmulatorData {
   class Configuration * theConfiguration;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (Martin.Skold:3772 to 3773) Martin Skold20 Jan