summaryrefslogtreecommitdiff
path: root/ndb/include/ndbapi/NdbOperation.hpp
diff options
context:
space:
mode:
authorunknown <mskold@mysql.com>2006-03-23 09:57:58 +0100
committerunknown <mskold@mysql.com>2006-03-23 09:57:58 +0100
commit576a856e3a5fcf519737a0852b3e88879626e56f (patch)
treef277a2752e1b6510c49d8279ef709acfc34f7975 /ndb/include/ndbapi/NdbOperation.hpp
parent6e73098f85e50ee98a5c37bb0ef3a3dbf2c3c98f (diff)
downloadmariadb-git-576a856e3a5fcf519737a0852b3e88879626e56f.tar.gz
Added type tags to operations
Diffstat (limited to 'ndb/include/ndbapi/NdbOperation.hpp')
-rw-r--r--ndb/include/ndbapi/NdbOperation.hpp47
1 files changed, 45 insertions, 2 deletions
diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp
index 1035c642c97..6237740c3c6 100644
--- a/ndb/include/ndbapi/NdbOperation.hpp
+++ b/ndb/include/ndbapi/NdbOperation.hpp
@@ -56,9 +56,32 @@ public:
*/
/**
- * Lock when performing read
+ * Different access types (supported by sub-classes of NdbOperation)
*/
+
+ enum Type {
+ PrimaryKeyAccess ///< Read, insert, update, or delete using pk
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 0 // NdbOperation
+#endif
+ ,UniqueIndexAccess ///< Read, update, or delete using unique index
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 1 // NdbIndexOperation
+#endif
+ ,TableScan ///< Full table scan
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 2 // NdbScanOperation
+#endif
+ ,OrderedIndexScan ///< Ordered index scan
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 3 // NdbIndexScanOperation
+#endif
+ };
+ /**
+ * Lock when performing read
+ */
+
enum LockMode {
LM_Read ///< Read with shared lock
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
@@ -715,6 +738,11 @@ public:
*/
const NdbDictionary::Table * getTable() const;
+ /**
+ * Get the type of access for this operation
+ */
+ const Type getType() const;
+
/** @} *********************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
@@ -768,7 +796,7 @@ protected:
int init(const class NdbTableImpl*, NdbTransaction* aCon);
void initInterpreter();
- NdbOperation(Ndb* aNdb);
+ NdbOperation(Ndb* aNdb, Type aType = PrimaryKeyAccess);
virtual ~NdbOperation();
void next(NdbOperation*); // Set next pointer
NdbOperation* next(); // Get next pointer
@@ -881,6 +909,8 @@ protected:
* These are the private variables that are defined in the operation objects.
*****************************************************************************/
+ Type m_type;
+
NdbReceiver theReceiver;
NdbError theError; // Errorcode
@@ -1044,6 +1074,19 @@ NdbOperation::getFirstRecAttr() const
}
/******************************************************************************
+Type getType()
+
+Return Value Return the Type.
+Remark: Gets type of access.
+******************************************************************************/
+inline
+const NdbOperation::Type
+NdbOperation::getType() const
+{
+ return m_type;
+}
+
+/******************************************************************************
OperationStatus Status();
Return Value Return the OperationStatus.