2656 Jonas Oreland 2008-08-22
ndb - fix testIndex -n SR1
1) use Uint8 instead of char for correct sign handling in restore.cpp (6.2 only)
2) always include PK in "random" unique index generation
modified:
storage/ndb/src/kernel/blocks/restore.cpp
storage/ndb/test/ndbapi/testIndex.cpp
2655 Jonas Oreland 2008-08-21
ndb - fix "flaky" ndb_mgm all restart
causing spurious failues in testSystemRestart
modified:
storage/ndb/src/mgmapi/mgmapi.cpp
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
2654 Jonas Oreland 2008-08-21
ndb - fix bug#38930
modified:
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
2653 Jonas Oreland 2008-08-20
ndb - fix testNodeRestart -n Bug34216
modified:
storage/ndb/test/ndbapi/testNodeRestart.cpp
2652 Jonas Oreland 2008-08-20
ndb - fix ERROR(8055) which was broken
modified:
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2008-08-11 10:41:11 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2008-08-21 06:47:02 +0000
@@ -7103,7 +7103,7 @@ void Dblqh::abortStateHandlerLab(Signal*
/* ------------------------------------------------------------------------- */
ndbrequire(regTcPtr->abortState == TcConnectionrec::NEW_FROM_TC);
sendLqhTransconf(signal, LqhTransConf::Prepared);
- break;
+ return;
case TcConnectionrec::WAIT_TUPKEYINFO:
case TcConnectionrec::WAIT_ATTR:
jam();
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2008-08-11 10:41:11 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2008-08-20 20:00:56 +0000
@@ -4732,10 +4732,7 @@ Dbtc::sendApiCommit(Signal* signal)
SET_ERROR_INSERT_VALUE(8056);
- Ptr<ApiConnectRecord> copyPtr;
- copyPtr.i = regApiPtr.p->apiCopyRecord;
- ptrCheckGuard(copyPtr, capiConnectFilesize, apiConnectRecord);
- return copyPtr;
+ goto err8055;
}
if (regApiPtr.p->returnsignal == RS_TCKEYCONF) {
@@ -4763,6 +4760,8 @@ Dbtc::sendApiCommit(Signal* signal)
TCKEY_abort(signal, 37);
return regApiPtr;
}//if
+
+err8055:
Ptr<ApiConnectRecord> copyPtr;
UintR TapiConnectFilesize = capiConnectFilesize;
UintR TcommitCount = c_counters.ccommitCount;
=== modified file 'storage/ndb/src/kernel/blocks/restore.cpp'
--- a/storage/ndb/src/kernel/blocks/restore.cpp 2007-07-11 12:47:05 +0000
+++ b/storage/ndb/src/kernel/blocks/restore.cpp 2008-08-21 22:05:42 +0000
@@ -1121,12 +1121,12 @@ Restore::reorder_key(const KeyDescriptor
src += sz;
break;
case NDB_ARRAYTYPE_SHORT_VAR:
- sz = (1 + ((char*)var)[0] + 3) >> 2;
+ sz = (1 + ((Uint8*)var)[0] + 3) >> 2;
memcpy(dst, var, 4 * sz);
var += sz;
break;
case NDB_ARRAYTYPE_MEDIUM_VAR:
- sz = (2 + ((char*)var)[0] + 256*((char*)var)[1] + 3) >> 2;
+ sz = (2 + ((Uint8*)var)[0] + 256*((Uint8*)var)[1] + 3) >> 2;
memcpy(dst, var, 4 * sz);
var += sz;
break;
=== modified file 'storage/ndb/src/mgmapi/mgmapi.cpp'
--- a/storage/ndb/src/mgmapi/mgmapi.cpp 2008-03-13 13:59:41 +0000
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp 2008-08-21 21:11:47 +0000
@@ -125,7 +125,6 @@ setError(NdbMgmHandle h, int error, int
#define CHECK_HANDLE(handle, ret) \
if(handle == 0) { \
- SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_HANDLE, ""); \
return ret; \
}
=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2008-07-29 09:39:57 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2008-08-21 21:11:47 +0000
@@ -1162,7 +1162,7 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<
CAST_CONSTPTR(NodeFailRep, signal->getDataPtr());
NdbNodeBitmask mask;
mask.assign(NdbNodeBitmask::Size, rep->theNodes);
- mask.bitAND(notstarted);
+ mask.bitANDC(notstarted);
nodes.bitANDC(mask);
if (singleUserNodeId == 0)
=== modified file 'storage/ndb/test/ndbapi/testIndex.cpp'
--- a/storage/ndb/test/ndbapi/testIndex.cpp 2008-03-25 14:17:03 +0000
+++ b/storage/ndb/test/ndbapi/testIndex.cpp 2008-08-21 22:05:42 +0000
@@ -169,6 +169,29 @@ int create_index(NDBT_Context* ctx, int
ndbout << pTab->getColumn(attrNo)->getName()<<" ";
}
+ if (!orderedIndex)
+ {
+ /**
+ * For unique indexes we must add PK, otherwise it's not guaranteed
+ * to be unique
+ */
+ for (int i = 0; i<pTab->getNoOfColumns(); i++)
+ {
+ if (pTab->getColumn(i)->getPrimaryKey())
+ {
+ for (int j = 0; j<attr->numAttribs; j++)
+ {
+ if (attr->attribs[j] == i)
+ goto next;
+ }
+ pIdx.addIndexColumn(pTab->getColumn(i)->getName());
+ ndbout << pTab->getColumn(i)->getName() << " ";
+ }
+ next:
+ (void)i;
+ }
+ }
+
pIdx.setStoredIndex(logged);
ndbout << ") ";
if (pNdb->getDictionary()->createIndex(pIdx) != 0){
=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp 2008-04-25 07:14:29 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp 2008-08-20 20:29:47 +0000
@@ -2180,21 +2180,33 @@ runBug34216(NDBT_Context* ctx, NDBT_Step
break;
}
- int rows = 10;
+ int rows = 25;
+ if (rows > records)
+ rows = records;
+
int batch = 1;
int row = (records - rows) ? rand() % (records - rows) : 0;
+ if (row + rows > records)
+ row = records - row;
- if(hugoOps.pkUpdateRecord(pNdb, row, batch, rand()) != 0)
- goto err;
-
- for (int l = 1; l<5; l++)
+ /**
+ * We should really somehow check that one of the 25 rows
+ * resides in the node we're targeting
+ */
+ for (int r = row; r < row + rows; r++)
{
- if (hugoOps.execute_NoCommit(pNdb) != 0)
+ if(hugoOps.pkUpdateRecord(pNdb, r, batch, rand()) != 0)
goto err;
-
- if(hugoOps.pkUpdateRecord(pNdb, row, batch, rand()) != 0)
- goto err;
- }
+
+ for (int l = 1; l<5; l++)
+ {
+ if (hugoOps.execute_NoCommit(pNdb) != 0)
+ goto err;
+
+ if(hugoOps.pkUpdateRecord(pNdb, r, batch, rand()) != 0)
+ goto err;
+ }
+ }
hugoOps.execute_Commit(pNdb);
hugoOps.closeTransaction(pNdb);
| Thread |
|---|
| • bzr push into mysql-5.1 branch (jonas:2652 to 2656) Bug#34216, Bug#38930 | Jonas Oreland | 22 Aug |