From: Pekka Nousiainen Date: May 3 2012 9:55am Subject: bzr push into mysql-5.1-telco-6.3 branch (pekka.nousiainen:3473 to 3474) Bug#13834481 List-Archive: http://lists.mysql.com/commits/143724 X-Bug: 13834481 Message-Id: <20120503095534.80E8D57846@cuda.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3474 Pekka Nousiainen 2012-05-03 bug#13834481 b01_upg.diff testUpgrade failing before 7.0 patches modified: storage/ndb/test/include/HugoTransactions.hpp storage/ndb/test/ndbapi/testUpgrade.cpp storage/ndb/test/src/HugoTransactions.cpp 3473 Frazer Clement 2012-04-24 Bug #13986128 DUMP LCP RESERVED FRAGMENT SCAN RECORD AS PART OF LCP STATUS DUMP modified: storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/kernel/vm/ArrayPool.hpp === modified file 'storage/ndb/test/include/HugoTransactions.hpp' --- a/storage/ndb/test/include/HugoTransactions.hpp 2011-06-30 15:55:35 +0000 +++ b/storage/ndb/test/include/HugoTransactions.hpp 2012-05-03 09:52:53 +0000 @@ -27,6 +27,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(); @@ -62,7 +64,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:55:35 +0000 +++ b/storage/ndb/test/ndbapi/testUpgrade.cpp 2012-05-03 09:52:53 +0000 @@ -591,9 +591,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; @@ -601,6 +630,10 @@ runCreateAllTables(NDBT_Context* ctx, ND for (int i = 0; igetName())); + if (useRangeScanT1) + if (runCreateIndexT1(ctx, step) != NDBT_OK) + return NDBT_FAILED; + return NDBT_OK; } @@ -679,6 +712,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(); @@ -703,6 +738,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; @@ -974,6 +1035,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); @@ -988,6 +1050,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-06-30 15:55:35 +0000 +++ b/storage/ndb/test/src/HugoTransactions.cpp 2012-05-03 09:52:53 +0000 @@ -200,7 +200,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; @@ -243,6 +244,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