Commit e8c4af12 authored by unknown's avatar unknown
Browse files

set correct lockmode in all reads...

    move lockmode from scan operation to operation
    added read tuple with lock mode


ndb/include/ndbapi/NdbIndexOperation.hpp:
  added read tuple with lock mode
ndb/include/ndbapi/NdbOperation.hpp:
  move lockmode from scan operation to operation
ndb/include/ndbapi/NdbScanOperation.hpp:
  move lockmode from scan operation to operation
ndb/src/ndbapi/NdbIndexOperation.cpp:
  added read tuple with lock mode
ndb/src/ndbapi/NdbOperationDefine.cpp:
  added read tuple with lock mode
sql/ha_ndbcluster.cc:
  set correct lockmode in all reads...
  moved lockmode from scan operatoin to operation
parent 4888de1d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -49,6 +49,15 @@ public:
   * @{
   */

  /**
   * Define the NdbIndexOperation to be a standard operation of type readTuple.
   * When calling NdbConnection::execute, this operation
   * reads a tuple.
   *
   * @return 0 if successful otherwise -1.
   */
  int readTuple(LockMode);

  /**
   * Define the NdbIndexOperation to be a standard operation of type readTuple.
   * When calling NdbConnection::execute, this operation
+22 −0
Original line number Diff line number Diff line
@@ -51,6 +51,19 @@ public:
   * @{
   */

  /**
   * Lock when performing read
   */
  
  enum LockMode {
    LM_Read = 0,
    LM_Exclusive = 1,
    LM_CommittedRead = 2,
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
    LM_Dirty = 2
#endif
  };

  /**
   * Define the NdbOperation to be a standard operation of type insertTuple.
   * When calling NdbConnection::execute, this operation 
@@ -88,6 +101,15 @@ public:
   */
  virtual int 			deleteTuple();
		
  /**
   * Define the NdbOperation to be a standard operation of type readTuple.
   * When calling NdbConnection::execute, this operation 
   * reads a tuple.
   *
   * @return 0 if successful otherwise -1.
   */
  virtual int 			readTuple(LockMode);

  /**
   * Define the NdbOperation to be a standard operation of type readTuple.
   * When calling NdbConnection::execute, this operation 
+0 −12
Original line number Diff line number Diff line
@@ -53,18 +53,6 @@ public:
    IndexCursor = 2
  };

  /**
   * Lock when performing scan
   */
  enum LockMode {
    LM_Read = 0,
    LM_Exclusive = 1,
    LM_CommittedRead = 2,
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
    LM_Dirty = 2
#endif
  };
  
  /**
   * Type of cursor
   */
+5 −0
Original line number Diff line number Diff line
@@ -85,6 +85,11 @@ NdbIndexOperation::indxInit(const NdbIndexImpl * anIndex,
  return 0;
}

int NdbIndexOperation::readTuple(NdbOperation::LockMode lm)
{ 
  return NdbOperation::readTuple(lm);
}

int NdbIndexOperation::readTuple()
{
  // First check that index is unique
+18 −0
Original line number Diff line number Diff line
@@ -103,6 +103,24 @@ NdbOperation::writeTuple()
 * int readTuple();
 *****************************************************************************/
int
NdbOperation::readTuple(NdbOperation::LockMode lm)
{ 
  switch(lm) {
  case LM_Read:
    return readTuple();
    break;
  case LM_Exclusive:
    return readTupleExclusive();
    break;
  case LM_CommittedRead:
    return readTuple();
    break;
  };
}
/******************************************************************************
 * int readTuple();
 *****************************************************************************/
int
NdbOperation::readTuple()
{ 
  NdbConnection* tNdbCon = theNdbCon;
Loading