List:Commits« Previous MessageNext Message »
From:tomas Date:March 9 2007 9:39am
Subject:bk commit into 5.0 tree (tomas:1.2444)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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
  1.2444 07/03/09 15:38:44 tomas@stripped +2 -0
  Merge poseidon.mysql.com:/home/tomas/mysql-5.0-telco-gca
  into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb-clean

  ndb/src/kernel/blocks/dbdict/Dbdict.hpp
    1.28 07/03/09 15:38:36 tomas@stripped +0 -0
    Auto merged

  ndb/src/kernel/blocks/dbdict/Dbdict.cpp
    1.76 07/03/09 15:38:35 tomas@stripped +0 -0
    Auto merged

# 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:	poseidon.mysql.com
# Root:	/home/tomas/mysql-5.0-ndb-clean/RESYNC

--- 1.75/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-03-02 09:37:46 +07:00
+++ 1.76/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-03-09 15:38:35 +07:00
@@ -2910,9 +2910,7 @@ Dbdict::execCREATE_TABLE_REQ(Signal* sig
       break;
     }
 
-    if(getNodeState().getSingleUserMode() &&
-       (refToNode(signal->getSendersBlockRef()) !=
-        getNodeState().getSingleUserApi()))
+    if (checkSingleUserMode(signal->getSendersBlockRef()))
     {
       jam();
       parseRecord.errorCode = CreateTableRef::SingleUser;
@@ -3081,9 +3079,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
     return;
   }
   
-  if(getNodeState().getSingleUserMode() &&
-     (refToNode(signal->getSendersBlockRef()) !=
-      getNodeState().getSingleUserApi()))
+  if (checkSingleUserMode(signal->getSendersBlockRef()))
   {
     jam();
     alterTableRef(signal, req, AlterTableRef::SingleUser);
@@ -5414,9 +5410,7 @@ Dbdict::execDROP_TABLE_REQ(Signal* signa
     return;
   }
   
-  if(getNodeState().getSingleUserMode() &&
-     (refToNode(signal->getSendersBlockRef()) !=
-      getNodeState().getSingleUserApi()))
+  if (checkSingleUserMode(signal->getSendersBlockRef()))
   {
     jam();
     dropTableRef(signal, req, DropTableRef::SingleUser);
@@ -6553,9 +6547,7 @@ Dbdict::execCREATE_INDX_REQ(Signal* sign
         jam();
         tmperr = CreateIndxRef::Busy;
       }
-      else if(getNodeState().getSingleUserMode() &&
-              (refToNode(senderRef) !=
-               getNodeState().getSingleUserApi()))
+      else if (checkSingleUserMode(senderRef))
       {
         jam();
         tmperr = CreateIndxRef::SingleUser;
@@ -7130,9 +7122,7 @@ Dbdict::execDROP_INDX_REQ(Signal* signal
         jam();
         tmperr = DropIndxRef::Busy;
       }
-      else if(getNodeState().getSingleUserMode() &&
-              (refToNode(senderRef) !=
-               getNodeState().getSingleUserApi()))
+      else if (checkSingleUserMode(senderRef))
       {
         jam();
         tmperr = DropIndxRef::SingleUser;
@@ -10572,6 +10562,22 @@ Dbdict::getMetaAttribute(MetaData::Attri
   }
   new (&attr) MetaData::Attribute(*attrPtr.p);
   return 0;
+}
+
+/*
+  return 1 if all of the below is true
+  a) node in single user mode
+  b) senderRef is not a db node
+  c) senderRef nodeid is not the singleUserApi
+*/
+
+int Dbdict::checkSingleUserMode(Uint32 senderRef)
+{
+  Uint32 nodeId = refToNode(senderRef);
+  return
+    getNodeState().getSingleUserMode() &&
+    (getNodeInfo(nodeId).m_type != NodeInfo::DB) &&
+    (nodeId != getNodeState().getSingleUserApi());
 }
 
 CArray<KeyDescriptor> g_key_descriptor_pool;

--- 1.27/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2007-01-22 19:10:37 +07:00
+++ 1.28/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2007-03-09 15:38:36 +07:00
@@ -2003,6 +2003,8 @@ private:
   int getMetaTable(MetaData::Table& table, const char* tableName);
   int getMetaAttribute(MetaData::Attribute& attribute, const MetaData::Table&
table, Uint32 attributeId);
   int getMetaAttribute(MetaData::Attribute& attribute, const MetaData::Table&
table, const char* attributeName);
+
+  int checkSingleUserMode(Uint32 senderRef);
 };
 
 #endif
Thread
bk commit into 5.0 tree (tomas:1.2444)tomas9 Mar