List:Internals« Previous MessageNext Message »
From:pekka Date:April 23 2005 6:51pm
Subject:bk commit into 5.0 tree (pekka:1.1881)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pekka. When pekka 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.1881 05/04/23 18:51:18 pekka@stripped +3 -0
  ndb - post merge 4.1->5.0

  ndb/test/ndbapi/testOIBasic.cpp
    1.38 05/04/23 18:41:32 pekka@stripped +36 -76
    post merge 4.1->5.0

  ndb/src/ndbapi/ndberror.c
    1.33 05/04/23 18:41:32 pekka@stripped +0 -1
    post merge 4.1->5.0

  ndb/src/kernel/blocks/ERROR_codes.txt
    1.10 05/04/23 18:41:32 pekka@stripped +2 -1
    post merge 4.1->5.0

# 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:	pekka
# Host:	tuna.ndb.mysql.com
# Root:	/orca/space/pekka/ndb/version/my50

--- 1.9/ndb/src/kernel/blocks/ERROR_codes.txt	2005-01-14 08:58:46 +01:00
+++ 1.10/ndb/src/kernel/blocks/ERROR_codes.txt	2005-04-23 18:41:32 +02:00
@@ -10,7 +10,7 @@
 Next CMVMI 9000
 Next BACKUP 10022
 Next DBUTIL 11002
-Next DBTUX 12007
+Next DBTUX 12008
 Next SUMA 13001
 
 TESTING NODE FAILURE, ARBITRATION
@@ -443,6 +443,7 @@
 
 Ordered index:
 --------------
+12007: Make next alloc node fail with no memory error
 
 Dbdict:
 -------

--- 1.37/ndb/test/ndbapi/testOIBasic.cpp	2005-04-23 17:55:10 +02:00
+++ 1.38/ndb/test/ndbapi/testOIBasic.cpp	2005-04-23 18:41:32 +02:00
@@ -164,6 +164,16 @@
   return i;
 }
 
+static bool
+randompct(unsigned pct)
+{
+  if (pct == 0)
+    return false;
+  if (pct >= 100)
+    return true;
+  return urandom(100) < pct;
+}
+
 // log and error macros
 
 static NdbMutex *ndbout_mutex = NULL;
@@ -1653,36 +1663,6 @@
 
 // data sets
 
-static unsigned
-urandom(unsigned n)
-{
-  if (n == 0)
-    return 0;
-  unsigned i = random() % n;
-  return i;
-}
-
-static int
-irandom(unsigned n)
-{
-  if (n == 0)
-    return 0;
-  int i = random() % n;
-  if (random() & 0x1)
-    i = -i;
-  return i;
-}
-
-static bool
-randompct(unsigned pct)
-{
-  if (pct == 0)
-    return false;
-  if (pct >= 100)
-    return true;
-  return urandom(100) < pct;
-}
-
 // Val - typed column value
 
 struct Val {
@@ -2659,26 +2639,30 @@
 }
 
 void
-Set::notpending(unsigned i)
+Set::notpending(unsigned i, ExecType et)
 {
   assert(m_row[i] != 0);
   Row& row = *m_row[i];
-  if (row.m_pending == Row::InsOp) {
-    row.m_exist = true;
-  } else if (row.m_pending == Row::UpdOp) {
-    ;
-  } else if (row.m_pending == Row::DelOp) {
-    row.m_exist = false;
+  if (et == Commit) {
+    if (row.m_pending == Row::InsOp)
+      row.m_exist = true;
+    if (row.m_pending == Row::DelOp)
+      row.m_exist = false;
+  } else {
+    if (row.m_pending == Row::InsOp)
+      row.m_exist = false;
+    if (row.m_pending == Row::DelOp)
+      row.m_exist = true;
   }
   row.m_pending = Row::NoOp;
 }
 
 void
-Set::notpending(const Lst& lst)
+Set::notpending(const Lst& lst, ExecType et)
 {
   for (unsigned j = 0; j < lst.m_cnt; j++) {
     unsigned i = lst.m_arr[j];
-    notpending(i);
+    notpending(i, et);
   }
 }
 
@@ -2870,34 +2854,6 @@
   return 0;
 }
 
-void
-Set::notpending(unsigned i, ExecType et)
-{
-  assert(m_row[i] != 0);
-  Row& row = *m_row[i];
-  if (et == Commit) {
-    if (row.m_pending == Row::InsOp)
-      row.m_exist = true;
-    if (row.m_pending == Row::DelOp)
-      row.m_exist = false;
-  } else {
-    if (row.m_pending == Row::InsOp)
-      row.m_exist = false;
-    if (row.m_pending == Row::DelOp)
-      row.m_exist = true;
-  }
-  row.m_pending = Row::NoOp;
-}
-
-void
-Set::notpending(const Lst& lst, ExecType et)
-{
-  for (unsigned j = 0; j < lst.m_cnt; j++) {
-    unsigned i = lst.m_arr[j];
-    notpending(i, et);
-  }
-}
-
 int
 Set::verify(Par par, const Set& set2) const
 {
@@ -3511,6 +3467,7 @@
   CHK(con.startTransaction() == 0);
   Lst lst;
   bool deadlock = false;
+  bool nospace = false;
   for (unsigned j = 0; j < par.m_rows; j++) {
     unsigned j2 = ! par.m_randomkey ? j : urandom(par.m_rows);
     unsigned i = thrrow(par, j2);
@@ -3528,7 +3485,7 @@
     lst.push(i);
     if (lst.cnt() == par.m_batch) {
       deadlock = par.m_deadlock;
-      CHK(con.execute(Commit, deadlock) == 0);
+      CHK(con.execute(Commit, deadlock, nospace) == 0);
       if (deadlock) {
         LL1("hashindexupdate: stop on deadlock [at 1]");
         break;
@@ -3544,9 +3501,9 @@
   }
   if (! deadlock && lst.cnt() != 0) {
     deadlock = par.m_deadlock;
-    CHK(con.execute(Commit, deadlock) == 0);
+    CHK(con.execute(Commit, deadlock, nospace) == 0);
     if (deadlock) {
-      LL1("hashindexupdate: stop on deadlock [at 1]");
+      LL1("hashindexupdate: stop on deadlock [at 2]");
     } else {
       set.lock();
       set.notpending(lst);
@@ -3567,6 +3524,7 @@
   CHK(con.startTransaction() == 0);
   Lst lst;
   bool deadlock = false;
+  bool nospace = false;
   for (unsigned j = 0; j < par.m_rows; j++) {
     unsigned j2 = ! par.m_randomkey ? j : urandom(par.m_rows);
     unsigned i = thrrow(par, j2);
@@ -3581,7 +3539,7 @@
     lst.push(i);
     if (lst.cnt() == par.m_batch) {
       deadlock = par.m_deadlock;
-      CHK(con.execute(Commit, deadlock) == 0);
+      CHK(con.execute(Commit, deadlock, nospace) == 0);
       if (deadlock) {
         LL1("hashindexdelete: stop on deadlock [at 1]");
         break;
@@ -3596,7 +3554,7 @@
   }
   if (! deadlock && lst.cnt() != 0) {
     deadlock = par.m_deadlock;
-    CHK(con.execute(Commit, deadlock) == 0);
+    CHK(con.execute(Commit, deadlock, nospace) == 0);
     if (deadlock) {
       LL1("hashindexdelete: stop on deadlock [at 2]");
     } else {
@@ -3968,6 +3926,7 @@
   CHK(con2.startTransaction() == 0);
   Lst lst;
   bool deadlock = false;
+  bool nospace = false;
   while (1) {
     int ret;
     deadlock = par.m_deadlock;
@@ -4003,7 +3962,7 @@
       set.unlock();
       if (lst.cnt() == par.m_batch) {
         deadlock = par.m_deadlock;
-        CHK(con2.execute(Commit, deadlock) == 0);
+        CHK(con2.execute(Commit, deadlock, nospace) == 0);
         if (deadlock) {
           LL1("scanupdatetable: stop on deadlock [at 2]");
           goto out;
@@ -4020,7 +3979,7 @@
       CHK((ret = con.nextScanResult(false)) == 0 || ret == 1 || ret == 2);
       if (ret == 2 && lst.cnt() != 0) {
         deadlock = par.m_deadlock;
-        CHK(con2.execute(Commit, deadlock) == 0);
+        CHK(con2.execute(Commit, deadlock, nospace) == 0);
         if (deadlock) {
           LL1("scanupdatetable: stop on deadlock [at 3]");
           goto out;
@@ -4067,6 +4026,7 @@
   CHK(con2.startTransaction() == 0);
   Lst lst;
   bool deadlock = false;
+  bool nospace = false;
   while (1) {
     int ret;
     deadlock = par.m_deadlock;
@@ -4102,7 +4062,7 @@
       set.unlock();
       if (lst.cnt() == par.m_batch) {
         deadlock = par.m_deadlock;
-        CHK(con2.execute(Commit, deadlock) == 0);
+        CHK(con2.execute(Commit, deadlock, nospace) == 0);
         if (deadlock) {
           LL1("scanupdateindex: stop on deadlock [at 2]");
           goto out;
@@ -4119,7 +4079,7 @@
       CHK((ret = con.nextScanResult(false)) == 0 || ret == 1 || ret == 2);
       if (ret == 2 && lst.cnt() != 0) {
         deadlock = par.m_deadlock;
-        CHK(con2.execute(Commit, deadlock) == 0);
+        CHK(con2.execute(Commit, deadlock, nospace) == 0);
         if (deadlock) {
           LL1("scanupdateindex: stop on deadlock [at 3]");
           goto out;

--- 1.32/ndb/src/ndbapi/ndberror.c	2005-04-23 17:39:52 +02:00
+++ 1.33/ndb/src/ndbapi/ndberror.c	2005-04-23 18:41:32 +02:00
@@ -184,7 +184,6 @@
   { 826,  IS, "Too many tables and attributes (increase MaxNoOfAttributes or
MaxNoOfTables)" },
   { 827,  IS, "Out of memory in Ndb Kernel, table data (increase DataMemory)" },
   { 902,  IS, "Out of memory in Ndb Kernel, ordered index data (increase DataMemory)" },
-  { 902,  IS, "Out of memory in Ndb Kernel, data part (increase DataMemory)" },
   { 903,  IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" },
   { 904,  IS, "Out of fragment records (increase MaxNoOfOrderedIndexes)" },
   { 905,  IS, "Out of attribute records (increase MaxNoOfAttributes)" },
Thread
bk commit into 5.0 tree (pekka:1.1881)pekka23 Apr