Commit 2029c3c2 authored by tomas@whalegate.ndb.mysql.com's avatar tomas@whalegate.ndb.mysql.com

Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-maint

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
parents 2ac94c30 c7944ddd
...@@ -2917,11 +2917,10 @@ Dbtup::nr_update_gci(Uint32 fragPtrI, const Local_key* key, Uint32 gci) ...@@ -2917,11 +2917,10 @@ Dbtup::nr_update_gci(Uint32 fragPtrI, const Local_key* key, Uint32 gci)
int ret; int ret;
if (tablePtr.p->m_attributes[MM].m_no_of_varsize) if (tablePtr.p->m_attributes[MM].m_no_of_varsize)
{ {
tablePtr.p->m_offsets[MM].m_fix_header_size += const Uint32 XXX = Tuple_header::HeaderSize+Var_part_ref::SZ32;
Tuple_header::HeaderSize+1; tablePtr.p->m_offsets[MM].m_fix_header_size += XXX;
ret = alloc_page(tablePtr.p, fragPtr.p, &page_ptr, tmp.m_page_no); ret = alloc_page(tablePtr.p, fragPtr.p, &page_ptr, tmp.m_page_no);
tablePtr.p->m_offsets[MM].m_fix_header_size -= tablePtr.p->m_offsets[MM].m_fix_header_size -= XXX;
Tuple_header::HeaderSize+1;
} }
else else
{ {
......
...@@ -27,15 +27,34 @@ public: ...@@ -27,15 +27,34 @@ public:
int getDbNodeId(int _i); int getDbNodeId(int _i);
enum RestartFlags {
NRRF_INITIAL = 0x1,
NRRF_NOSTART = 0x2,
NRRF_ABORT = 0x4
};
int restartOneDbNode(int _nodeId, int restartOneDbNode(int _nodeId,
bool initial = false, bool initial = false,
bool nostart = false, bool nostart = false,
bool abort = false); bool abort = false);
int restartOneDbNode2(int _nodeId, Uint32 flags){
return restartOneDbNode(_nodeId,
flags & NRRF_INITIAL,
flags & NRRF_NOSTART,
flags & NRRF_ABORT);
}
int restartAll(bool initial = false, int restartAll(bool initial = false,
bool nostart = false, bool nostart = false,
bool abort = false); bool abort = false);
int restartAll2(Uint32 flags){
return restartAll(flags & NRRF_INITIAL,
flags & NRRF_NOSTART,
flags & NRRF_ABORT);
}
int startAll(); int startAll();
int startNodes(const int * _nodes, int _num_nodes); int startNodes(const int * _nodes, int _num_nodes);
int waitClusterStarted(unsigned int _timeout = 120); int waitClusterStarted(unsigned int _timeout = 120);
......
...@@ -1567,6 +1567,72 @@ runBug27466(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1567,6 +1567,72 @@ runBug27466(NDBT_Context* ctx, NDBT_Step* step)
return NDBT_OK; return NDBT_OK;
} }
int
runBug28023(NDBT_Context* ctx, NDBT_Step* step)
{
int result = NDBT_OK;
int loops = ctx->getNumLoops();
int records = ctx->getNumRecords();
Ndb* pNdb = GETNDB(step);
NdbRestarter res;
if (res.getNumDbNodes() < 2)
{
return NDBT_OK;
}
HugoTransactions hugoTrans(*ctx->getTab());
if (hugoTrans.loadTable(pNdb, records) != 0){
return NDBT_FAILED;
}
if (hugoTrans.clearTable(pNdb, records) != 0)
{
return NDBT_FAILED;
}
for (Uint32 i = 0; i<loops; i++)
{
int node1 = res.getDbNodeId(rand() % res.getNumDbNodes());
if (res.restartOneDbNode2(node1,
NdbRestarter::NRRF_ABORT |
NdbRestarter::NRRF_NOSTART))
return NDBT_FAILED;
if (res.waitNodesNoStart(&node1, 1))
return NDBT_FAILED;
if (hugoTrans.loadTable(pNdb, records) != 0){
return NDBT_FAILED;
}
if (hugoTrans.clearTable(pNdb, records) != 0)
{
return NDBT_FAILED;
}
res.startNodes(&node1, 1);
if (res.waitClusterStarted())
return NDBT_FAILED;
if (hugoTrans.loadTable(pNdb, records) != 0){
return NDBT_FAILED;
}
if (hugoTrans.scanUpdateRecords(pNdb, records) != 0)
return NDBT_FAILED;
if (hugoTrans.clearTable(pNdb, records) != 0)
{
return NDBT_FAILED;
}
}
return NDBT_OK;
}
NDBT_TESTSUITE(testNodeRestart); NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad", TESTCASE("NoLoad",
"Test that one node at a time can be stopped and then restarted "\ "Test that one node at a time can be stopped and then restarted "\
...@@ -1924,6 +1990,9 @@ TESTCASE("Bug27283", ""){ ...@@ -1924,6 +1990,9 @@ TESTCASE("Bug27283", ""){
TESTCASE("Bug27466", ""){ TESTCASE("Bug27466", ""){
INITIALIZER(runBug27466); INITIALIZER(runBug27466);
} }
TESTCASE("Bug28023", ""){
INITIALIZER(runBug28023);
}
NDBT_TESTSUITE_END(testNodeRestart); NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){ int main(int argc, const char** argv){
......
...@@ -549,6 +549,10 @@ max-time: 1000 ...@@ -549,6 +549,10 @@ max-time: 1000
cmd: testNodeRestart cmd: testNodeRestart
args: -n Bug26481 T1 args: -n Bug26481 T1
max-time: 1000
cmd: testNodeRestart
args: -n Bug28023 T7 D2
# #
# DICT TESTS # DICT TESTS
max-time: 1500 max-time: 1500
......
...@@ -1146,7 +1146,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, ...@@ -1146,7 +1146,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
} }
// PKs // PKs
if (equalForRow(pOp, r) != 0) if (equalForRow(pUpdOp, r) != 0)
{ {
closeTransaction(pNdb); closeTransaction(pNdb);
return NDBT_FAILED; return NDBT_FAILED;
...@@ -1714,7 +1714,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, ...@@ -1714,7 +1714,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
if(!ordered) if(!ordered)
{ {
if (equalForRow(pOp, r+b) != 0) if (equalForRow(pUpdOp, r+b) != 0)
{ {
closeTransaction(pNdb); closeTransaction(pNdb);
return NDBT_FAILED; return NDBT_FAILED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment