4925 Pekka Nousiainen 2012-05-03 [merge]
merge
modified:
storage/ndb/test/include/HugoTransactions.hpp
storage/ndb/test/ndbapi/testUpgrade.cpp
storage/ndb/test/src/HugoTransactions.cpp
4924 Pekka Nousiainen 2012-05-03
bug#13834481 a03_fix.diff
TC(6.3)->LQH(7.x) hashHi caused timeout
modified:
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
=== modified file 'storage/ndb/test/include/HugoTransactions.hpp'
--- a/storage/ndb/test/include/HugoTransactions.hpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/include/HugoTransactions.hpp 2012-05-03 09:54:05 +0000
@@ -26,6 +26,8 @@ class NDBT_Stats;
class HugoTransactions : public HugoOperations {
public:
+ struct HugoBound { int attr; int type; const void* value; };
+
HugoTransactions(const NdbDictionary::Table&,
const NdbDictionary::Index* idx = 0);
~HugoTransactions();
@@ -61,7 +63,8 @@ public:
int abort = 0,
int parallelism = 0,
NdbOperation::LockMode = NdbOperation::LM_Read,
- int scan_flags = 0);
+ int scan_flags = 0,
+ int bound_cnt = 0, const HugoBound* bound_arr = 0);
int pkReadRecords(Ndb*,
int records,
=== modified file 'storage/ndb/test/ndbapi/testUpgrade.cpp'
--- a/storage/ndb/test/ndbapi/testUpgrade.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/test/ndbapi/testUpgrade.cpp 2012-05-03 09:54:05 +0000
@@ -592,9 +592,38 @@ int runCheckStarted(NDBT_Context* ctx, N
return NDBT_OK;
}
+int
+runCreateIndexT1(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Ndb* pNdb = GETNDB(step);
+ NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
+ const NdbDictionary::Table* pTab = pDict->getTable("T1");
+ if (pTab == 0)
+ {
+ g_err << "getTable(T1) error: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+ NdbDictionary::Index ind;
+ ind.setName("T1X1");
+ ind.setTable("T1");
+ ind.setType(NdbDictionary::Index::OrderedIndex);
+ ind.setLogging(false);
+ ind.addColumn("KOL2");
+ ind.addColumn("KOL3");
+ ind.addColumn("KOL4");
+ if (pDict->createIndex(ind, *pTab) != 0)
+ {
+ g_err << "createIndex(T1X1) error: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+ return NDBT_OK;
+}
+
int
runCreateAllTables(NDBT_Context* ctx, NDBT_Step* step)
{
+ Uint32 useRangeScanT1 = ctx->getProperty("UseRangeScanT1", (Uint32)0);
+
ndbout_c("createAllTables");
if (NDBT_Tables::createAllTables(GETNDB(step), false, true))
return NDBT_FAILED;
@@ -602,6 +631,10 @@ runCreateAllTables(NDBT_Context* ctx, ND
for (int i = 0; i<NDBT_Tables::getNumTables(); i++)
table_list.push_back(BaseString(NDBT_Tables::getTable(i)->getName()));
+ if (useRangeScanT1)
+ if (runCreateIndexT1(ctx, step) != NDBT_OK)
+ return NDBT_FAILED;
+
return NDBT_OK;
}
@@ -680,6 +713,8 @@ runClearAll(NDBT_Context* ctx, NDBT_Step
int
runBasic(NDBT_Context* ctx, NDBT_Step* step)
{
+ Uint32 useRangeScanT1 = ctx->getProperty("UseRangeScanT1", (uint32)0);
+
Ndb* pNdb = GETNDB(step);
NdbDictionary::Dictionary * pDict = pNdb->getDictionary();
int records = ctx->getNumRecords();
@@ -705,6 +740,32 @@ runBasic(NDBT_Context* ctx, NDBT_Step* s
// (or check if it does)
if (strcmp(tab->getName(), "T1") == 0)
trans.pkInterpretedUpdateRecords(pNdb, records);
+ if (strcmp(tab->getName(), "T1") == 0 &&
+ useRangeScanT1)
+ {
+ const NdbDictionary::Index* pInd = pDict->getIndex("T1X1", "T1");
+ if (pInd == 0)
+ {
+ g_err << "getIndex(T1X1) error: " << pDict->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+ // bug#13834481 - bound values do not matter
+ const Uint32 lo = 0x11110000;
+ const Uint32 hi = 0xaaaa0000;
+ HugoTransactions::HugoBound bound_arr[6];
+ int bound_cnt = 0;
+ for (int j = 0; j <= 1; j++) {
+ int n = rand() % 4;
+ for (int i = 0; i < n; i++) {
+ HugoTransactions::HugoBound& b = bound_arr[bound_cnt++];
+ b.attr = i;
+ b.type = (j == 0 ? 0 : 2); // LE/GE
+ b.value = (j == 0 ? &lo : &hi);
+ }
+ }
+ g_info << "range scan T1 with " << bound_cnt << " bounds" << endl;
+ trans.scanReadRecords(pNdb, pInd, records, 0, 0, NdbOperation::LM_Read, 0, bound_cnt, bound_arr);
+ }
trans.clearTable(pNdb, records/2);
trans.loadTable(pNdb, records/2);
break;
@@ -1063,6 +1124,7 @@ POSTUPGRADE("Upgrade_FS")
TESTCASE("Upgrade_Traffic",
"Test upgrade with traffic, all tables and restart --initial")
{
+ TC_PROPERTY("UseRangeScanT1", (Uint32)1);
INITIALIZER(runCheckStarted);
INITIALIZER(runCreateAllTables);
STEP(runUpgrade_Traffic);
@@ -1077,6 +1139,7 @@ POSTUPGRADE("Upgrade_Traffic")
TESTCASE("Upgrade_Traffic_FS",
"Test upgrade with traffic, all tables and restart using FS")
{
+ TC_PROPERTY("UseRangeScanT1", (Uint32)1);
TC_PROPERTY("KeepFS", 1);
INITIALIZER(runCheckStarted);
INITIALIZER(runCreateAllTables);
=== modified file 'storage/ndb/test/src/HugoTransactions.cpp'
--- a/storage/ndb/test/src/HugoTransactions.cpp 2011-11-28 13:54:18 +0000
+++ b/storage/ndb/test/src/HugoTransactions.cpp 2012-05-03 09:54:05 +0000
@@ -199,7 +199,8 @@ HugoTransactions::scanReadRecords(Ndb* p
int abortPercent,
int parallelism,
NdbOperation::LockMode lm,
- int scan_flags)
+ int scan_flags,
+ int bound_cnt, const HugoBound* bound_arr)
{
int retryAttempt = 0;
@@ -242,6 +243,14 @@ HugoTransactions::scanReadRecords(Ndb* p
closeTransaction(pNdb);
return NDBT_FAILED;
}
+
+ for (int i = 0; i < bound_cnt; i++) {
+ const HugoBound& b = bound_arr[i];
+ if (pOp->setBound(b.attr, b.type, b.value) != 0) {
+ ERR(pOp->getNdbError());
+ return NDBT_FAILED;
+ }
+ }
for(a = 0; a<tab.getNoOfColumns(); a++){
if((row.attributeStore(a) =
@@ -350,8 +359,10 @@ HugoTransactions::scanReadRecords(Ndb* p
closeTransaction(pNdb);
- g_info << rows << " rows have been read" << endl;
- if (records != 0 && rows != records){
+ g_info << rows << " rows have been read"
+ << ", number of index bounds " << bound_cnt << endl;
+ // TODO verify expected number of records with index bounds
+ if (records != 0 && rows != records && bound_cnt == 0){
g_err << "Check expected number of records failed" << endl
<< " expected=" << records <<", " << endl
<< " read=" << rows << endl;
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (pekka.nousiainen:4924 to 4925) | Pekka Nousiainen | 3 May |