diff options
author | unknown <pekka@mysql.com> | 2006-05-25 12:03:02 +0200 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2006-05-25 12:03:02 +0200 |
commit | 758399418589c34fc85fb27696cd73f863198224 (patch) | |
tree | c6b49aefdaf2f3fa3e25dfb0c735fa43697e51c9 /storage/ndb/include/ndbapi/Ndb.hpp | |
parent | 60eb775c1db938dc40b482e09e7fa0071226422a (diff) | |
download | mariadb-git-758399418589c34fc85fb27696cd73f863198224.tar.gz |
ndb - bug#14509 v5.1 part 1/2 : ndb api level [requires part 2/2]
storage/ndb/src/ndbapi/ndberror.c:
delete non-sense error 4336
storage/ndb/include/ndbapi/Ndb.hpp:
add auto-incr methods which take explicit Ndb::TupleIdRange & argument
for NDB API programs the range is under local dict cache (as in 5.0)
the handler level uses its own Ndb objects and ranges
storage/ndb/src/ndbapi/DictCache.cpp:
add auto-incr methods which take explicit Ndb::TupleIdRange & argument
for NDB API programs the range is under local dict cache (as in 5.0)
the handler level uses its own Ndb objects and ranges
storage/ndb/src/ndbapi/DictCache.hpp:
add auto-incr methods which take explicit Ndb::TupleIdRange & argument
for NDB API programs the range is under local dict cache (as in 5.0)
the handler level uses its own Ndb objects and ranges
storage/ndb/src/ndbapi/Ndb.cpp:
add auto-incr methods which take explicit Ndb::TupleIdRange & argument
for NDB API programs the range is under local dict cache (as in 5.0)
the handler level uses its own Ndb objects and ranges
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
add auto-incr methods which take explicit Ndb::TupleIdRange & argument
for NDB API programs the range is under local dict cache (as in 5.0)
the handler level uses its own Ndb objects and ranges
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
add auto-incr methods which take explicit Ndb::TupleIdRange & argument
for NDB API programs the range is under local dict cache (as in 5.0)
the handler level uses its own Ndb objects and ranges
Diffstat (limited to 'storage/ndb/include/ndbapi/Ndb.hpp')
-rw-r--r-- | storage/ndb/include/ndbapi/Ndb.hpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/storage/ndb/include/ndbapi/Ndb.hpp b/storage/ndb/include/ndbapi/Ndb.hpp index 8174bca0a5f..536f94a885a 100644 --- a/storage/ndb/include/ndbapi/Ndb.hpp +++ b/storage/ndb/include/ndbapi/Ndb.hpp @@ -1463,7 +1463,9 @@ public: /** * Return a unique tuple id for a table. The id sequence is - * ascending but may contain gaps. + * ascending but may contain gaps. Methods which have no + * TupleIdRange argument use NDB API dict cache. They may + * not be called from mysqld. * * @param aTableName table name * @@ -1471,28 +1473,47 @@ public: * * @return 0 or -1 on error, and tupleId in out parameter */ + struct TupleIdRange { + Uint64 m_first_tuple_id; + Uint64 m_last_tuple_id; + void reset() { + m_first_tuple_id = ~(Uint64)0; + m_last_tuple_id = ~(Uint64)0; + }; + }; + int initAutoIncrement(); int getAutoIncrementValue(const char* aTableName, Uint64 & tupleId, Uint32 cacheSize); int getAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 & tupleId, Uint32 cacheSize); + int getAutoIncrementValue(const NdbDictionary::Table * aTable, + TupleIdRange & range, Uint64 & tupleId, + Uint32 cacheSize); int readAutoIncrementValue(const char* aTableName, Uint64 & tupleId); int readAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 & tupleId); + int readAutoIncrementValue(const NdbDictionary::Table * aTable, + TupleIdRange & range, Uint64 & tupleId); int setAutoIncrementValue(const char* aTableName, Uint64 tupleId, bool increase); int setAutoIncrementValue(const NdbDictionary::Table * aTable, Uint64 tupleId, bool increase); + int setAutoIncrementValue(const NdbDictionary::Table * aTable, + TupleIdRange & range, Uint64 tupleId, + bool increase); private: - int getTupleIdFromNdb(Ndb_local_table_info* info, - Uint64 & tupleId, Uint32 cacheSize); - int readTupleIdFromNdb(Ndb_local_table_info* info, - Uint64 & tupleId); - int setTupleIdInNdb(Ndb_local_table_info* info, - Uint64 tupleId, bool increase); - int opTupleIdOnNdb(Ndb_local_table_info* info, Uint64 & opValue, Uint32 op); + int getTupleIdFromNdb(const NdbTableImpl* table, + TupleIdRange & range, Uint64 & tupleId, + Uint32 cacheSize); + int readTupleIdFromNdb(const NdbTableImpl* table, + TupleIdRange & range, Uint64 & tupleId); + int setTupleIdInNdb(const NdbTableImpl* table, + TupleIdRange & range, Uint64 tupleId, bool increase); + int opTupleIdOnNdb(const NdbTableImpl* table, + TupleIdRange & range, Uint64 & opValue, Uint32 op); public: /** |