Below is the list of changes that have just been committed into a local
4.1 repository of pekka. When pekka does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2161 05/04/05 13:14:03 pekka@stripped +6 -0
ndb - csc#4847 release scan op early to save memory
ndb/tools/desc.cpp
1.13 05/04/05 13:00:35 pekka@stripped +1 -1
release scan op of hupped trans at scan close to save memory
ndb/src/ndbapi/NdbScanOperation.cpp
1.50 05/04/05 13:00:34 pekka@stripped +14 -7
release scan op of hupped trans at scan close to save memory
ndb/src/ndbapi/NdbResultSet.cpp
1.8 05/04/05 13:00:33 pekka@stripped +1 -1
release scan op of hupped trans at scan close to save memory
ndb/src/ndbapi/NdbConnection.cpp
1.34 05/04/05 13:00:33 pekka@stripped +31 -0
release scan op of hupped trans at scan close to save memory
ndb/include/ndbapi/NdbScanOperation.hpp
1.20 05/04/05 13:00:33 pekka@stripped +1 -1
release scan op of hupped trans at scan close to save memory
ndb/include/ndbapi/NdbConnection.hpp
1.24 05/04/05 13:00:33 pekka@stripped +1 -0
release scan op of hupped trans at scan close to save memory
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: pekka
# Host: tuna.ndb.mysql.com
# Root: /orca/space/pekka/ndb/version/my41
--- 1.23/ndb/include/ndbapi/NdbConnection.hpp 2005-03-01 13:35:56 +01:00
+++ 1.24/ndb/include/ndbapi/NdbConnection.hpp 2005-04-05 13:00:33 +02:00
@@ -542,6 +542,7 @@
// Release all cursor operations in connection
void releaseOps(NdbOperation*);
void releaseScanOperations(NdbIndexScanOperation*);
+ void releaseExecutedScanOperation(NdbIndexScanOperation*);
// Set the transaction identity of the transaction
void setTransactionId(Uint64 aTransactionId);
--- 1.19/ndb/include/ndbapi/NdbScanOperation.hpp 2004-11-29 09:17:44 +01:00
+++ 1.20/ndb/include/ndbapi/NdbScanOperation.hpp 2005-04-05 13:00:33 +02:00
@@ -93,7 +93,7 @@
int nextResult(bool fetchAllowed = true, bool forceSend = false);
virtual void release();
- void closeScan(bool forceSend = false);
+ void closeScan(bool forceSend = false, bool releaseOp = false);
int close_impl(class TransporterFacade*, bool forceSend = false);
// Overloaded methods from NdbCursorOperation
--- 1.33/ndb/src/ndbapi/NdbConnection.cpp 2004-12-22 13:31:05 +01:00
+++ 1.34/ndb/src/ndbapi/NdbConnection.cpp 2005-04-05 13:00:33 +02:00
@@ -964,6 +964,37 @@
}//NdbConnection::releaseScanOperations()
/*****************************************************************************
+void releaseExecutedScanOperation();
+
+Remark: Release scan op when hupp'ed trans closed (save memory)
+******************************************************************************/
+void
+NdbConnection::releaseExecutedScanOperation(NdbIndexScanOperation* cursorOp)
+{
+ DBUG_ENTER("NdbConnection::releaseExecutedScanOperation");
+ DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp))
+
+ // here is one reason to make op lists doubly linked
+ if (m_firstExecutedScanOp == cursorOp) {
+ m_firstExecutedScanOp = (NdbIndexScanOperation*)cursorOp->theNext;
+ cursorOp->release();
+ theNdb->releaseScanOperation(cursorOp);
+ } else if (m_firstExecutedScanOp != NULL) {
+ NdbIndexScanOperation* tOp = m_firstExecutedScanOp;
+ while (tOp->theNext != NULL) {
+ if (tOp->theNext == cursorOp) {
+ tOp->theNext = cursorOp->theNext;
+ cursorOp->release();
+ theNdb->releaseScanOperation(cursorOp);
+ break;
+ }
+ tOp = (NdbIndexScanOperation*)tOp->theNext;
+ }
+ }
+ DBUG_VOID_RETURN;
+}//NdbConnection::releaseExecutedScanOperation()
+
+/*****************************************************************************
NdbOperation* getNdbOperation(const char* aTableName);
Return Value Return a pointer to a NdbOperation object if getNdbOperation
--- 1.7/ndb/src/ndbapi/NdbResultSet.cpp 2004-11-22 14:41:43 +01:00
+++ 1.8/ndb/src/ndbapi/NdbResultSet.cpp 2005-04-05 13:00:33 +02:00
@@ -69,7 +69,7 @@
void NdbResultSet::close(bool forceSend)
{
- m_operation->closeScan(forceSend);
+ m_operation->closeScan(forceSend, true);
}
NdbOperation*
--- 1.49/ndb/src/ndbapi/NdbScanOperation.cpp 2005-01-19 18:32:31 +01:00
+++ 1.50/ndb/src/ndbapi/NdbScanOperation.cpp 2005-04-05 13:00:34 +02:00
@@ -674,7 +674,7 @@
return 0;
}
-void NdbScanOperation::closeScan(bool forceSend)
+void NdbScanOperation::closeScan(bool forceSend, bool releaseOp)
{
if(m_transConnection){
if(DEBUG_NEXT_RESULT)
@@ -691,13 +691,20 @@
Guard guard(tp->theMutexPtr);
close_impl(tp, forceSend);
- } while(0);
-
- theNdbCon->theScanningOp = 0;
- theNdb->closeTransaction(theNdbCon);
-
- theNdbCon = 0;
+ }
+
+ NdbConnection* tCon = theNdbCon;
+ NdbConnection* tTransCon = m_transConnection;
+ theNdbCon = NULL;
m_transConnection = NULL;
+
+ if (releaseOp && tTransCon) {
+ NdbIndexScanOperation* tOp = (NdbIndexScanOperation*)this;
+ tTransCon->releaseExecutedScanOperation(tOp);
+ }
+
+ tCon->theScanningOp = 0;
+ theNdb->closeTransaction(tCon);
}
void
--- 1.12/ndb/tools/desc.cpp 2005-01-28 00:42:34 +01:00
+++ 1.13/ndb/tools/desc.cpp 2005-04-05 13:00:35 +02:00
@@ -89,7 +89,7 @@
unsigned j;
for (j= 0; (int)j < pTab->getNoOfPrimaryKeys(); j++)
{
- const NdbDictionary::Column * col = pTab->getColumn(j);
+ const NdbDictionary::Column * col = pTab->getColumn(pTab->getPrimaryKey(j));
ndbout << col->getName();
if ((int)j < pTab->getNoOfPrimaryKeys()-1)
ndbout << ", ";
| Thread |
|---|
| • bk commit into 4.1 tree (pekka:1.2161) | pekka | 5 Apr |