#At file:///home/marty/MySQL/mysql-5.1-telco-6.2/
3111 Martin Skold 2010-06-17 [merge]
Merge
modified:
storage/ndb/test/ndbapi/testNdbApi.cpp
storage/ndb/test/ndbapi/test_event.cpp
storage/ndb/test/src/HugoCalculator.cpp
=== modified file 'storage/ndb/test/ndbapi/testNdbApi.cpp'
--- a/storage/ndb/test/ndbapi/testNdbApi.cpp 2009-10-12 05:43:10 +0000
+++ b/storage/ndb/test/ndbapi/testNdbApi.cpp 2010-06-17 05:07:26 +0000
@@ -2836,27 +2836,29 @@ runBug44065(NDBT_Context* ctx, NDBT_Step
CHECK(hugoOps1.pkInsertRecord(pNdb, rowno) == 0);
CHECK(hugoOps1.execute_NoCommit(pNdb) == 0);
- HugoOperations hugoOps2(*pTab);
- CHECK(hugoOps2.startTransaction(pNdb2) == 0);
-
- CHECK(hugoOps2.pkDeleteRecord(pNdb2, rowno) == 0);
- CHECK(hugoOps2.pkInsertRecord(pNdb2, rowno) == 0);
-
- NdbTransaction* trans = hugoOps2.getTransaction();
- aValue = 0;
-
- trans->executeAsynch(NdbTransaction::NoCommit, a_callback, 0);
- pNdb2->sendPreparedTransactions(1);
- CHECK(hugoOps1.execute_Commit(pNdb) == 0);
- ndbout_c("waiting for callback");
- while (aValue == 0)
{
- pNdb2->pollNdb();
- NdbSleep_MilliSleep(100);
+ HugoOperations hugoOps2(*pTab);
+ CHECK(hugoOps2.startTransaction(pNdb2) == 0);
+
+ CHECK(hugoOps2.pkDeleteRecord(pNdb2, rowno) == 0);
+ CHECK(hugoOps2.pkInsertRecord(pNdb2, rowno) == 0);
+
+ NdbTransaction* trans = hugoOps2.getTransaction();
+ aValue = 0;
+
+ trans->executeAsynch(NdbTransaction::NoCommit, a_callback, 0);
+ pNdb2->sendPreparedTransactions(1);
+ CHECK(hugoOps1.execute_Commit(pNdb) == 0);
+ ndbout_c("waiting for callback");
+ while (aValue == 0)
+ {
+ pNdb2->pollNdb();
+ NdbSleep_MilliSleep(100);
+ }
+ CHECK(hugoOps2.execute_Rollback(pNdb2) == 0);
}
- CHECK(hugoOps2.execute_Rollback(pNdb2) == 0);
-
- delete pNdb2;
+
+ delete pNdb2; // need to delete hugoOps2 before pNdb2
ctx->stopTest();
return NDBT_OK;
=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp 2009-05-26 18:53:34 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp 2010-06-17 05:14:45 +0000
@@ -2905,7 +2905,8 @@ executeOps(Ndb* pNdb,
for (Uint32 i=keyOffset; i < (keyOffset + rowCount); i++)
{
- *keyPtr= *attrPtr= i;
+ memcpy(keyPtr, &i, sizeof(i));
+ memcpy(attrPtr, &i, sizeof(i));
opts.optionsPresent |= NdbOperation::OperationOptions::OO_ANYVALUE;
opts.anyValue= anyValueOffset + i;
bool allowInterpreted=
=== modified file 'storage/ndb/test/src/HugoCalculator.cpp'
--- a/storage/ndb/test/src/HugoCalculator.cpp 2009-10-06 10:39:02 +0000
+++ b/storage/ndb/test/src/HugoCalculator.cpp 2010-06-17 05:11:21 +0000
@@ -197,7 +197,10 @@ HugoCalculator::calcValue(int record,
Uint32 bits= attr->getLength();
Uint32 tmp = bits >> 5;
Uint32 size = bits & 31;
- ((Uint32*)buf)[tmp] &= ((1 << size) - 1);
+ Uint32 copy;
+ memcpy(©, ((Uint32*)buf)+tmp, 4);
+ copy &= ((1 << size) - 1);
+ memcpy(((Uint32*)buf)+tmp, ©, 4);
}
break;
case NdbDictionary::Column::Varbinary:
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.2 branch (Martin.Skold:3111) | Martin Skold | 17 Jun |