From: Ole John Aske Date: September 20 2011 10:43am Subject: bzr push into mysql-5.1-telco-7.0 branch (ole.john.aske:4538 to 4539) List-Archive: http://lists.mysql.com/commits/141016 Message-Id: <20110920104332.BF9E4230@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4539 Ole John Aske 2011-09-20 Fixed Valgrind warnings caused by NdbReceiver::m_expected_result_length & ::m_received_result_length being uninitialized in some cases. Changed init of NdbRootFragment::m_remainingScans to 0xfff... in order to indicate that no results has been received yet - This will later force NdbRootFragment::prepareNextReceiveSet() to call NdbResultStream::prepareNextReceiveSet() for *all* ResultStreams such that its NdbReceiver::prepareReceive() is called, which will init these fields. Removed some incorrect asserts as ::prepareNextReceiveSet() *should* be called even for pure lookup queries. modified: storage/ndb/src/ndbapi/NdbQueryOperation.cpp 4538 jonas oreland 2011-09-19 ndb - work around for race between sys-tables and index-stat added: mysql-test/suite/ndb/t/ndb_index_stat_partitions-master.opt modified: mysql-test/suite/ndb/r/ndb_index_stat_partitions.result === modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp' --- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-09-15 12:16:13 +0000 +++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2011-09-20 10:43:05 +0000 @@ -498,7 +498,6 @@ public: const Uint32 internalOpNo = m_operation.getQueryOperationDef().getQueryOperationId(); const bool complete = !((remainingScans >> internalOpNo) & 1); - assert(complete || isScanResult()); // Lookups should always be 'complete' return complete; } @@ -919,10 +918,11 @@ NdbResultStream::execTRANSID_AI(const Ui void NdbResultStream::prepareNextReceiveSet() { - assert (isScanQuery()); - - m_recv = (m_recv+1) % 2; // Receive into next ResultSet - assert(m_recv != m_read); + if (isScanQuery()) // Doublebuffered ResultSet[] if isScanQuery() + { + m_recv = (m_recv+1) % 2; // Receive into next ResultSet + assert(m_recv != m_read); + } m_resultSets[m_recv].prepareReceive(m_receiver); @@ -950,7 +950,6 @@ bool NdbResultStream::prepareResultSet(Uint32 remainingScans) { bool isComplete = isSubScanComplete(remainingScans); //Childs with more rows - assert(isComplete || isScanResult()); //Lookups always 'complete' /** * Prepare NdbResultSet for reading - either the next @@ -1161,7 +1160,7 @@ NdbRootFragment::NdbRootFragment(): m_availResultSets(0), m_outstandingResults(0), m_confReceived(false), - m_remainingScans(0), + m_remainingScans(0xffffffff), m_idMapHead(-1), m_idMapNext(-1) { No bundle (reason: useless for push emails).