List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:June 16 2011 12:48pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (frazer.clement:4243 to 4244)
View as plain text  
 4244 Frazer Clement	2011-06-16 [merge]
      Merge 7.0->7.1

    added:
      mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc
    modified:
      mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc
      mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result
      mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf
      mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test
      storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
      storage/ndb/src/ndbapi/NdbQueryBuilder.cpp
      storage/ndb/src/ndbapi/NdbQueryBuilder.hpp
      storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/test/include/HugoQueryBuilder.hpp
      storage/ndb/test/src/HugoQueryBuilder.cpp
 4243 magnus.blaudd@stripped	2011-06-15 [merge]
      Merge 7.0 -> 7.1

    modified:
      storage/ndb/include/mgmapi/mgmapi_config_parameters.h
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/mgmsrv/ConfigInfo.cpp
      storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
      storage/ndb/src/ndbapi/ndberror.c
=== modified file 'mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc'
--- a/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch.inc	2011-06-16 12:36:28 +0000
@@ -3,10 +3,11 @@
 # Set up circular cluster replication where each 
 # cluster has two mysqlds and replication directions are 
 # following:
+#              1       2
 #          master ---> slave  
 #           /            \
 #     cluster A        cluster B
-#           \            /
+#           \  3       4 /
 #         master1 <--- slave1
 #
 # ==== Usage ====
@@ -26,8 +27,9 @@
 #   $rpl_skip_start_slave, $rpl_debug, $slave_timeout
 #     See include/master-slave.inc
 
+#--let $rpl_debug= 1
 --let $rpl_topology= 1->2,4->3
---let $rpl_skip_check_server_ids= 1
+--let $rpl_skip_start_slave= 1
 --source include/rpl_init.inc
 
 # Make connections to mysqlds
@@ -37,7 +39,7 @@
 --source include/rpl_connect.inc
 
 --let $rpl_connection_name= master1
---let $rpl_server_number= 1
+--let $rpl_server_number= 3
 --source include/rpl_connect.inc
 
 --let $rpl_connection_name= slave
@@ -45,9 +47,23 @@
 --source include/rpl_connect.inc
 
 --let $rpl_connection_name= slave1
---let $rpl_server_number= 2
+--let $rpl_server_number= 4
 --source include/rpl_connect.inc
 
+# Now add IGNORE_SERVER_IDS
+--disable_query_log
+connection master;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (1,3);
+connection master1;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (1,3);
+connection slave;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (2,4);
+connection slave1;
+CHANGE MASTER TO IGNORE_SERVER_IDS= (2,4);
+
+# Now start replication
+--source include/rpl_start_slaves.inc
+--enable_query_log
 
 # Check that all mysqld are compiled with ndb support
 --let $_rpl_server= 4

=== added file 'mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc'
--- a/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_rpl/ndb_master-slave_2ch_end.inc	2011-06-16 12:36:28 +0000
@@ -0,0 +1,28 @@
+# ==== Purpose ====
+#
+# Clean up replication configuration after using a 2ch
+# setup.
+# We need to explicitly reset the IGNORE_SERVER_IDS parameters
+# on all Servers to avoid testcase check errors.
+#
+# ==== Usage ====
+#
+#   [--let $rpl_debug= 1]
+#   --source suite/ndb_rpl/ndb_master-slave_2ch_end.inc
+#
+# Parameters:
+#   $rpl_debug
+#     See include/master-slave.inc
+
+--source include/rpl_stop_slaves.inc
+--connection master
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--connection master1
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--connection slave
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--connection slave1
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+--source include/rpl_start_slaves.inc
+
+--source include/rpl_end.inc
\ No newline at end of file

=== modified file 'mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result'
--- a/mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/r/ndb_rpl_circular_2ch.result	2011-06-16 12:36:28 +0000
@@ -3,6 +3,7 @@ include/rpl_connect.inc [creating master
 include/rpl_connect.inc [creating master1]
 include/rpl_connect.inc [creating slave]
 include/rpl_connect.inc [creating slave1]
+include/rpl_start_slaves.inc
 
 *** Check server_id of mysqld servers ***
 SHOW VARIABLES LIKE "server_id";
@@ -12,7 +13,7 @@ SET auto_increment_offset = 1;
 SET auto_increment_increment = 2;
 SHOW VARIABLES LIKE "server_id";
 Variable_name	Value
-server_id	1
+server_id	3
 SET auto_increment_offset = 1;
 SET auto_increment_increment = 2;
 SHOW VARIABLES LIKE "server_id";
@@ -22,7 +23,7 @@ SET auto_increment_offset = 2;
 SET auto_increment_increment = 2;
 SHOW VARIABLES LIKE "server_id";
 Variable_name	Value
-server_id	2
+server_id	4
 SET auto_increment_offset = 2;
 SET auto_increment_increment = 2;
 
@@ -48,4 +49,10 @@ Check data on both clusters
 include/diff_tables.inc [master:t1, slave:t1]
 DROP TABLE IF EXISTS t1;
 
+include/rpl_stop_slaves.inc
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+CHANGE MASTER TO IGNORE_SERVER_IDS= ();
+include/rpl_start_slaves.inc
 include/rpl_end.inc

=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.cnf	2011-06-16 12:36:28 +0000
@@ -2,34 +2,39 @@
 
 # 2 clusters, each with 2 MySQLDs
 # All MySQLDs log-slave-updates
-# Potential infinite loops are broken by both servers 
-# on each cluster having the same server-id
-# To support > 2 clusters and/or different server-ids per
-# MySQLD server, we need some other loop breaking 
-# mechanism 
+# All MySQLDs log-apply-status
+# Infinite loops broken in the test using Ignore_server_ids mechanism
 
 [mysqld.1.1]
 server-id= 1
 log-bin
+ndb_connectstring=	@mysql_cluster.1.ndb_connectstring
 log-slave-updates
+skip-slave-start
 
 [mysqld.2.1]
-server-id= 1
+server-id= 3
 log-bin
+ndb_connectstring=	@mysql_cluster.1.ndb_connectstring
 log-slave-updates
+skip-slave-start
 
 [mysqld.1.slave]
 server-id= 2
 log-bin
+ndb_connectstring=	@mysql_cluster.slave.ndb_connectstring
 log-slave-updates
 skip-slave-start
 
 [mysqld.2.slave]
-server-id= 2
+server-id= 4
 log-bin
 ndb_connectstring=	@mysql_cluster.slave.ndb_connectstring
+log-slave-updates
+skip-slave-start
 
 [ENV]
-
-SLAVE_MYPORT1=		@mysqld.2.slave.port
-SLAVE_MYSOCK1=		@mysqld.2.slave.socket
+SERVER_MYPORT_1=        @mysqld.1.1.port
+SERVER_MYPORT_2=        @mysqld.1.slave.port
+SERVER_MYPORT_3=        @mysqld.2.1.port
+SERVER_MYPORT_4=        @mysqld.2.slave.port

=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test	2011-05-13 07:40:50 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular_2ch.test	2011-06-16 12:36:28 +0000
@@ -163,5 +163,8 @@ DROP TABLE IF EXISTS t1;
 --source include/wait_for_query_to_fail.inc
 --echo
 
+--connection master
+
 # End of test 5.1
---source include/rpl_end.inc
+--source suite/ndb_rpl/ndb_master-slave_2ch_end.inc
+

=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2011-06-07 12:08:29 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2011-06-16 08:37:10 +0000
@@ -4418,7 +4418,7 @@ Dbspj::scanIndex_build(Build_context& ct
     if (requestPtr.p->m_bits & Request::RT_REPEAT_SCAN_RESULT &&
        !treeNodePtr.p->m_ancestors.contains(ctx.m_scans))
     {
-      nodePtr.p->m_bits |= TreeNode::T_SCAN_REPEATABLE;
+      treeNodePtr.p->m_bits |= TreeNode::T_SCAN_REPEATABLE;
     }
 
     ctx.m_scan_cnt++;
@@ -5025,6 +5025,8 @@ Dbspj::scanIndex_parent_batch_repeat(Sig
 
   DEBUG("scanIndex_parent_batch_repeat(), m_node_no: " << treeNodePtr.p->m_node_no
         << ", m_batch_chunks: " << data.m_batch_chunks);
+  
+  ndbassert(treeNodePtr.p->m_bits & TreeNode::T_SCAN_REPEATABLE);
 
   /**
    * Register index-scans to be restarted if we didn't get all

=== modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp	2011-05-17 12:47:21 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.cpp	2011-06-16 09:32:43 +0000
@@ -23,7 +23,6 @@
 #include <Vector.hpp>
 #include "signaldata/QueryTree.hpp"
 
-#include <Ndb.hpp>
 #include "NdbDictionaryImpl.hpp"
 #include <NdbRecord.hpp>
 #include "AttributeHeader.hpp"
@@ -575,16 +574,15 @@ NdbQueryIndexScanOperationDef::~NdbQuery
 
 NdbQueryOperationDefImpl::~NdbQueryOperationDefImpl()
 {
+  // Unlink any parent and child refering this object
   if (m_parent != NULL)
   {
     m_parent->removeChild(this);
   }
-  // Delete children recursively also.
   for (Uint32 i = 0; i<m_children.size(); i++)
   {
     assert(m_children[i]->m_parent == this);
     m_children[i]->m_parent = NULL;
-    delete m_children[i];
   }
 }
 
@@ -686,9 +684,9 @@ NdbQueryOperationDef::getIndex() const
  * Implementation of NdbQueryBuilder factory
  ******************************************/
 // Static method.
-NdbQueryBuilder* NdbQueryBuilder::create(Ndb& ndb)
+NdbQueryBuilder* NdbQueryBuilder::create()
 {
-  NdbQueryBuilderImpl* const impl = new NdbQueryBuilderImpl(ndb);
+  NdbQueryBuilderImpl* const impl = new NdbQueryBuilderImpl();
   if (likely (impl != NULL))
   {
     if (likely(impl->getNdbError().code == 0))
@@ -1045,9 +1043,9 @@ NdbQueryBuilder::prepare()
 // The (hidden) Impl of NdbQueryBuilder
 ////////////////////////////////////////
 
-NdbQueryBuilderImpl::NdbQueryBuilderImpl(Ndb& ndb)
+NdbQueryBuilderImpl::NdbQueryBuilderImpl()
 : m_interface(*this),
-  m_ndb(ndb), m_error(),
+  m_error(),
   m_operations(),
   m_operands(),
   m_paramCnt(0),
@@ -1063,12 +1061,13 @@ NdbQueryBuilderImpl::NdbQueryBuilderImpl
 NdbQueryBuilderImpl::~NdbQueryBuilderImpl()
 {
   // Delete all operand and operator in Vector's
-  if (m_operations.size() > 0)
+  for (Uint32 i=0; i<m_operations.size(); ++i)
   {
-    delete m_operations[0];
+    delete m_operations[i];
   }
   for (Uint32 i=0; i<m_operands.size(); ++i)
-  { delete m_operands[i];
+  {
+    delete m_operands[i];
   }
 }
 
@@ -1231,12 +1230,13 @@ NdbQueryDefImpl(const Vector<NdbQueryOpe
 NdbQueryDefImpl::~NdbQueryDefImpl()
 {
   // Release all NdbQueryOperations
-  if (m_operations.size() > 0)
+  for (Uint32 i=0; i<m_operations.size(); ++i)
   {
-    delete m_operations[0];
+    delete m_operations[i];
   }
   for (Uint32 i=0; i<m_operands.size(); ++i)
-  { delete m_operands[i];
+  {
+    delete m_operands[i];
   }
 }
 
@@ -2799,15 +2799,14 @@ main(int argc, const char** argv)
   assert (sizeof(NdbParamOperand) == sizeof(NdbQueryOperandImpl*));
   assert (sizeof(NdbLinkedOperand) == sizeof(NdbQueryOperandImpl*));
 
-  Ndb *myNdb = 0;
-  NdbQueryBuilder myBuilder(*myNdb);
+  NdbQueryBuilder* const myBuilder= NdbQueryBuilder::create();
 
   const NdbDictionary::Table *manager = (NdbDictionary::Table*)0xDEADBEAF;
 //  const NdbDictionary::Index *ix = (NdbDictionary::Index*)0x11223344;
 
-  NdbQueryDef* q1 = 0;
+  const NdbQueryDef* q1 = 0;
   {
-    NdbQueryBuilder* qb = &myBuilder; //myDict->getQueryBuilder();
+    NdbQueryBuilder* qb = myBuilder;
 
     const NdbQueryOperand* managerKey[] =  // Manager is indexed om {"dept_no", "emp_no"}
     {  qb->constValue("d005"),             // dept_no = "d005"

=== modified file 'storage/ndb/src/ndbapi/NdbQueryBuilder.hpp'
--- a/storage/ndb/src/ndbapi/NdbQueryBuilder.hpp	2011-04-06 14:16:13 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryBuilder.hpp	2011-06-16 09:32:43 +0000
@@ -24,7 +24,6 @@
 // skip includes...and require them to be included first
 // BUH!
 
-class Ndb;
 class NdbQueryDef;
 class NdbQueryDefImpl;
 class NdbQueryBuilderImpl;
@@ -358,9 +357,8 @@ private:
  *   build phase.
  *
  * - The NdbQueryDef produced by the ::prepare() method has a lifetime 
- *   determined by the Ndb object, or until it is explicit released by
- *   NdbQueryDef::release()
- *  
+ *   until it is explicit released by NdbQueryDef::release()
+ *
  */
 class NdbQueryBuilder 
 {
@@ -380,7 +378,7 @@ public:
    * Allocate an instance.
    * @return New instance, or NULL if allocation failed.
    */
-  static NdbQueryBuilder* create(Ndb& ndb);
+  static NdbQueryBuilder* create();
 
   /**
    * Release this object and any resources held by it.
@@ -478,8 +476,7 @@ private:
  * NdbQueryDef represents a ::prepare()'d object from NdbQueryBuilder.
  *
  * The NdbQueryDef is reusable in the sense that it may be executed multiple
- * times. Its lifetime is defined by the Ndb object which it was created with,
- * or it may be explicitely released() when no longer required.
+ * times. It is valid until it is explicitely released().
  *
  * The NdbQueryDef *must* be keept alive until the last thread
  * which executing a query based on this NdbQueryDef has completed execution 

=== modified file 'storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp	2011-05-05 11:06:08 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp	2011-06-16 09:32:43 +0000
@@ -631,7 +631,7 @@ class NdbQueryBuilderImpl
 
 public:
   ~NdbQueryBuilderImpl();
-  explicit NdbQueryBuilderImpl(Ndb& ndb);
+  explicit NdbQueryBuilderImpl();
 
   const NdbQueryDefImpl* prepare();
 
@@ -665,7 +665,6 @@ private:
   bool contains(const NdbQueryOperationDefImpl*);
 
   NdbQueryBuilder m_interface;
-  Ndb& m_ndb;
   NdbError m_error;
 
   Vector<NdbQueryOperationDefImpl*> m_operations;

=== modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2011-05-26 14:44:59 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp	2011-06-16 09:32:43 +0000
@@ -2895,7 +2895,6 @@ NdbQueryImpl::closeTcCursor(bool forceSe
   assert (m_queryDef.isScanQuery());
 
   NdbImpl* const ndb = m_transaction.getNdb()->theImpl;
-  NdbImpl* const impl = ndb;
   const Uint32 timeout  = ndb->get_waitfor_timeout();
   const Uint32 nodeId   = m_transaction.getConnectedNodeId();
   const Uint32 seq      = m_transaction.theNodeSequence;
@@ -2905,7 +2904,7 @@ NdbQueryImpl::closeTcCursor(bool forceSe
    */
   PollGuard poll_guard(*ndb);
 
-  if (unlikely(impl->getNodeSequence(nodeId) != seq))
+  if (unlikely(ndb->getNodeSequence(nodeId) != seq))
   {
     setErrorCode(Err_NodeFailCausedAbort);
     return -1;  // Transporter disconnected and reconnected, no need to close
@@ -2917,7 +2916,7 @@ NdbQueryImpl::closeTcCursor(bool forceSe
     const FetchResult result = static_cast<FetchResult>
         (poll_guard.wait_scan(3*timeout, nodeId, forceSend));
 
-    if (unlikely(impl->getNodeSequence(nodeId) != seq))
+    if (unlikely(ndb->getNodeSequence(nodeId) != seq))
       setFetchTerminated(Err_NodeFailCausedAbort,false);
     else if (unlikely(result != FetchResult_ok))
     {
@@ -2952,7 +2951,7 @@ NdbQueryImpl::closeTcCursor(bool forceSe
       const FetchResult result = static_cast<FetchResult>
           (poll_guard.wait_scan(3*timeout, nodeId, forceSend));
 
-      if (unlikely(impl->getNodeSequence(nodeId) != seq))
+      if (unlikely(ndb->getNodeSequence(nodeId) != seq))
         setFetchTerminated(Err_NodeFailCausedAbort,false);
       else if (unlikely(result != FetchResult_ok))
       {

=== modified file 'storage/ndb/test/include/HugoQueryBuilder.hpp'
--- a/storage/ndb/test/include/HugoQueryBuilder.hpp	2011-04-06 14:16:13 +0000
+++ b/storage/ndb/test/include/HugoQueryBuilder.hpp	2011-06-16 09:32:43 +0000
@@ -1,6 +1,5 @@
 /*
-   Copyright (C) 2003 MySQL AB
-    All rights reserved. Use is subject to license terms.
+   Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -105,7 +104,7 @@ public:
   OptionMask getOptionMask() const { return m_options;}
   void setOptionMask(OptionMask om) { m_options = om;}
 
-  const NdbQueryDef * createQuery(Ndb*, bool takeOwnership = false);
+  const NdbQueryDef * createQuery(bool takeOwnership = false);
 
 private:
   struct TableDef

=== modified file 'storage/ndb/test/src/HugoQueryBuilder.cpp'
--- a/storage/ndb/test/src/HugoQueryBuilder.cpp	2011-04-06 14:16:13 +0000
+++ b/storage/ndb/test/src/HugoQueryBuilder.cpp	2011-06-16 09:32:43 +0000
@@ -1,6 +1,5 @@
 /*
-   Copyright (C) 2003 MySQL AB
-    All rights reserved. Use is subject to license terms.
+   Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -563,9 +562,9 @@ loop:
 }
 
 const NdbQueryDef *
-HugoQueryBuilder::createQuery(Ndb* pNdb, bool takeOwnership)
+HugoQueryBuilder::createQuery(bool takeOwnership)
 {
-  NdbQueryBuilder* const builder = NdbQueryBuilder::create(*pNdb);
+  NdbQueryBuilder* const builder = NdbQueryBuilder::create();
   if (builder == NULL)
   {
     ndbout << "Failed to create NdbQueryBuilder." << endl;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (frazer.clement:4243 to 4244) Frazer Clement16 Jun