Commit c2ec05d1 authored by unknown's avatar unknown

wl#2126 - read_multi_range ndb part


ndb/include/ndbapi/NdbConnection.hpp:
  Utility methods
ndb/include/ndbapi/NdbOperation.hpp:
  Utility methods
ndb/src/ndbapi/NdbConnection.cpp:
  Don't set theReturnStatus all_the_time, but let it be decided on 
  a operation bases
ndb/src/ndbapi/NdbOperationExec.cpp:
  AbortOption
sql/ha_ndbcluster.cc:
  1) removed execute from define_read_attr
  2) let a bunch of methods use define_read_attr
  3) impl. read_multi_range
sql/ha_ndbcluster.h:
  read_multi_range
parent effa1ed5
...@@ -430,6 +430,10 @@ public: ...@@ -430,6 +430,10 @@ public:
*/ */
const NdbOperation * getNextCompletedOperation(const NdbOperation * op)const; const NdbOperation * getNextCompletedOperation(const NdbOperation * op)const;
const NdbOperation* getFirstDefinedOperation()const{return theFirstOpInList;}
const NdbOperation* getLastDefinedOperation()const{return theLastOpInList;}
/** @} *********************************************************************/ /** @} *********************************************************************/
/** /**
......
...@@ -718,6 +718,7 @@ public: ...@@ -718,6 +718,7 @@ public:
}; };
LockMode getLockMode() const { return theLockMode; } LockMode getLockMode() const { return theLockMode; }
void setAbortOption(Int8 ao) { m_abortOption = ao; }
/** /**
* Set/get distribution/partition key * Set/get distribution/partition key
...@@ -746,10 +747,13 @@ protected: ...@@ -746,10 +747,13 @@ protected:
void initInterpreter(); void initInterpreter();
void next(NdbOperation*); // Set next pointer void next(NdbOperation*); // Set next pointer
NdbOperation* next(); // Get next pointer NdbOperation* next(); // Get next pointer
public:
const NdbOperation* next() const;
protected:
enum OperationStatus{ enum OperationStatus
{
Init, Init,
OperationDefined, OperationDefined,
TupleKeyDefined, TupleKeyDefined,
...@@ -995,6 +999,12 @@ NdbOperation::next() ...@@ -995,6 +999,12 @@ NdbOperation::next()
return theNext; return theNext;
} }
inline
const NdbOperation*
NdbOperation::next() const
{
return theNext;
}
/****************************************************************************** /******************************************************************************
OperationStatus Status(); OperationStatus Status();
......
...@@ -232,21 +232,6 @@ Remark: Handle time-out on a transaction object. ...@@ -232,21 +232,6 @@ Remark: Handle time-out on a transaction object.
void void
NdbConnection::handleExecuteCompletion() NdbConnection::handleExecuteCompletion()
{ {
if (theCompletionStatus == CompletedFailure) {
NdbOperation* tOpTemp = theFirstExecOpInList;
while (tOpTemp != NULL) {
/*****************************************************************************
* Ensure that all executing operations report failed for each
* read attribute when failure occurs.
* We do not want any operations to report both failure and
* success on different read attributes.
****************************************************************************/
tOpTemp->handleFailedAI_ElemLen();
tOpTemp = tOpTemp->next();
}//while
theReturnStatus = ReturnFailure;
}//if
/*************************************************************************** /***************************************************************************
* Move the NdbOperation objects from the list of executing * Move the NdbOperation objects from the list of executing
* operations to list of completed * operations to list of completed
...@@ -1512,6 +1497,7 @@ transactions. ...@@ -1512,6 +1497,7 @@ transactions.
/**********************************************************************/ /**********************************************************************/
theCompletionStatus = CompletedFailure; theCompletionStatus = CompletedFailure;
theCommitStatus = Aborted; theCommitStatus = Aborted;
theReturnStatus = ReturnFailure;
return 0; return 0;
} else { } else {
#ifdef NDB_NO_DROPPED_SIGNAL #ifdef NDB_NO_DROPPED_SIGNAL
......
...@@ -543,10 +543,11 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) ...@@ -543,10 +543,11 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal)
theStatus = Finished; theStatus = Finished;
// blobs want this // blobs want this
if (m_abortOption != IgnoreError) if (m_abortOption != IgnoreError)
{
theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
}
theError.code = aSignal->readData(4); theError.code = aSignal->readData(4);
theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), m_abortOption); theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao);
if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read
return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError); return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError);
......
This diff is collapsed.
...@@ -111,6 +111,14 @@ class ha_ndbcluster: public handler ...@@ -111,6 +111,14 @@ class ha_ndbcluster: public handler
byte* buf); byte* buf);
int read_range_next(); int read_range_next();
/**
* Multi range stuff
*/
int read_multi_range_first(key_multi_range **found_range_p,
key_multi_range *ranges, uint range_count,
bool sorted, handler_buffer *buffer);
int read_multi_range_next(void);
bool get_error_message(int error, String *buf); bool get_error_message(int error, String *buf);
void info(uint); void info(uint);
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation);
...@@ -257,6 +265,10 @@ class ha_ndbcluster: public handler ...@@ -257,6 +265,10 @@ class ha_ndbcluster: public handler
uint32 m_blobs_buffer_size; uint32 m_blobs_buffer_size;
uint m_dupkey; uint m_dupkey;
bool m_disable_multi_read;
byte* m_multi_range_result_ptr;
const NdbOperation* m_current_multi_operation;
void set_rec_per_key(); void set_rec_per_key();
void records_update(); void records_update();
void no_uncommitted_rows_execute_failure(); void no_uncommitted_rows_execute_failure();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment