--- /tmp/geta16295 2007-04-26 10:50:31.000000000 +0200 +++ testBlobs.cpp 2007-04-26 10:49:35.000000000 +0200 @@ -142,6 +142,7 @@ << " -bug 4088 ndb api hang with mixed ops on index table" << endl << " -bug 27018 middle partial part write clobbers rest of part" << endl << " -bug 27370 Potential inconsistent blob reads for ReadCommitted reads" << endl + << " -bug 28116 Crash in getBlobHandle() when called before setting full key with equal()" << endl ; } @@ -2083,13 +2084,42 @@ return 0; } +static int +bugtest_28116() +{ + DBG("bug test 28116 - "); + if (g_opt.m_pk2len == 0) + { + DBG(" ... skipped, requires multi-column primary key."); + return 0; + } + + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + if (urandom(2) == 0) + CHK(g_opr->readTuple() == 0); + else + CHK(g_opr->readTuple(NdbOperation::LM_CommittedRead) == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + /* Deliberately no equal() on rest of primary key, to provoke error. */ + CHK(g_opr->getBlobHandle("BL1") == 0); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + } + return 0; +} + static struct { int m_bug; int (*m_test)(); } g_bugtest[] = { { 4088, bugtest_4088 }, { 27018, bugtest_27018 }, - { 27370, bugtest_27370 } + { 27370, bugtest_27370 }, + { 28116, bugtest_28116 } }; NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535)