1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

wl2240 - ndb - new testcase for validating startTransation with hint

ndb/include/ndbapi/NdbDictionary.hpp:
  NdbDictionaryColumn::getSizeInBytes
ndb/include/ndbapi/NdbOperation.hpp:
  NdbOperation::getTable
ndb/include/ndbapi/NdbTransaction.hpp:
  Make getConnectionNodeId public (for test programs)
ndb/include/util/Base64.hpp:
  base64(void*)
ndb/src/common/util/Base64.cpp:
  base64(void*)
ndb/src/kernel/blocks/ERROR_codes.txt:
  New error code for REF'ing non-local TCKEYREQ
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Easy clearing of ERROR_INSERT
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  New error code for REF'ing non-local TCKEYREQ
ndb/src/ndbapi/NdbDictionary.cpp:
  NdbDictionaryColumn::getSizeInBytes
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  If m_noIfDistKyes == 0, then each PK is dist key
ndb/src/ndbapi/NdbOperation.cpp:
  NdbOperation::getTable
ndb/src/ndbapi/NdbOperationSearch.cpp:
  remove d-key handling for pk ops
ndb/test/include/HugoCalculator.hpp:
  remove unimpletemented methods
ndb/test/include/HugoOperations.hpp:
  1) HugoOperation::setTransaction 
  2) Type independant value handling
  3) Some more util methods
ndb/test/ndbapi/testPartitioning.cpp:
  new testcase for validating startTransation with hint
ndb/test/run-test/atrt-mysql-test-run:
  fix checks of return values
ndb/test/src/HugoCalculator.cpp:
  Better generation of values
   -- depends on fact that srand(K), rand() == srand(K), rand()
  Generate string with base64
ndb/test/src/HugoOperations.cpp:
  1) HugoOperation::setTransaction 
  2) Type independant value handling
  3) Some more util methods
This commit is contained in:
unknown
2005-01-14 08:58:50 +01:00
parent ae9b079491
commit 3705bf9dfb
18 changed files with 313 additions and 274 deletions

View File

@ -318,8 +318,51 @@ run_startHint(NDBT_Context* ctx, NDBT_Step* step)
{
return NDBT_FAILED;
}
NdbRestarter restarter;
if(restarter.insertErrorInAllNodes(8050) != 0)
return NDBT_FAILED;
return NDBT_OK;
HugoCalculator dummy(*tab);
int result = NDBT_OK;
for(int i = 0; i<records && result == NDBT_OK; i++)
{
char buffer[8000];
char* start= buffer + (rand() & 7);
char* pos= start;
for(int j = 0; j<tab->getNoOfColumns(); j++)
{
if(tab->getColumn(j)->getPartitionKey())
{
ndbout_c(tab->getColumn(j)->getName());
int sz = tab->getColumn(j)->getSizeInBytes();
int aligned_size = 4 * ((sz + 3) >> 2);
memset(pos, 0, aligned_size);
dummy.calcValue(i, j, 0, pos, sz);
pos += aligned_size;
}
}
// Now we have the pk
NdbTransaction* pTrans= p_ndb->startTransaction(tab, start,(pos - start));
HugoOperations ops(*tab);
ops.setTransaction(pTrans);
if(ops.pkReadRecord(p_ndb, i, 1) != NDBT_OK)
{
result = NDBT_FAILED;
break;
}
if(ops.execute_Commit(p_ndb) != 0)
{
result = NDBT_FAILED;
break;
}
ops.closeTransaction(p_ndb);
}
restarter.insertErrorInAllNodes(0);
return result;
}
@ -358,9 +401,18 @@ TESTCASE("ordered_index_dk",
INITIALIZER(run_drop_table);
}
TESTCASE("startTransactionHint",
"Test startTransactionHint")
"Test startTransactionHint wo/ distribution key")
{
TC_PROPERTY("distributionkey", ~0);
TC_PROPERTY("distributionkey", (unsigned)0);
INITIALIZER(run_drop_table);
INITIALIZER(run_create_table);
INITIALIZER(run_startHint);
INITIALIZER(run_drop_table);
}
TESTCASE("startTransactionHint_dk",
"Test startTransactionHint with distribution key")
{
TC_PROPERTY("distributionkey", (unsigned)~0);
INITIALIZER(run_drop_table);
INITIALIZER(run_create_table);
INITIALIZER(run_startHint);