Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.29.5 NdbScanOperation::lockCurrentTuple()

Description.  This method locks the current tuple.

Signature.  In MySQL 5.1 and later, this method can be called with an optional single parameter, in either of the two ways shown here:

NdbOperation* lockCurrentTuple
    (
      void
    )

NdbOperation* lockCurrentTuple
    (
      NdbTransaction* lockTrans
    )

The following signature is also supported for this method, when using NdbRecord:

NdbOperation *lockCurrentTuple
    (
      NdbTransaction* takeOverTrans,
      const NdbRecord* record,
      char* row = 0,
      const unsigned char* mask = 0
    )

This method also supports specifying one or more OperationOptions (also when using NdbRecord):

NdbOperation *lockCurrentTuple
    (
      NdbTransaction* takeOverTrans,
      const NdbRecord* record,
      char* row = 0,
      const unsigned char* mask = 0,
      const NdbOperation::OperationOptions* opts = 0,
      Uint32 sizeOfOptions = 0
    )

Parameters (old style).  This method takes a single, optional parameter—the transaction that should perform the lock. If this is omitted, the transaction is the current one.

Parameters (when using NdbRecord).  When using the NdbRecord interface, this method takes these parameters, as described in the following list:

  • The transaction (takeOverTrans) that should perform the lock; when using NdbRecord with scans, this parameter is not optional.

  • The NdbRecord referenced by the scan. This is required, even if no records are being read.

  • The row from which to read. Set this to NULL if no read is to occur.

  • The mask pointer is optional. If it is present, then only columns for which the corresponding bit in the mask is set are retrieved by the scan.

  • The opts argument can take on any of the following OperationOptions values: OO_ABORTOPTION, OO_GETVALUE, and OO_ANYVALUE.

  • If options are specified, their length (sizeOfOptions) must be specified as well.

Important

Calling an NdbRecord scan lock takeover on an NdbRecAttr-style scan is not valid, nor is calling an NdbRecAttr-style scan lock takeover on an NdbRecord-style scan.

Return value.  This method returns a pointer to an NdbOperation object, or NULL.


User Comments
Sign Up Login You must be logged in to post a comment.