mariadb/ndb/include/ndbapi/NdbDictionary.hpp

1188 lines
33 KiB
C++
Raw Normal View History

/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NdbDictionary_H
#define NdbDictionary_H
#include <ndb_types.h>
class Ndb;
2004-09-15 17:44:13 +02:00
struct charset_info_st;
typedef struct charset_info_st CHARSET_INFO;
/**
* @class NdbDictionary
* @brief Data dictionary class
*
* The preferred and supported way to create and drop tables and indexes
* in ndb is through the
* MySQL Server (see MySQL reference Manual, section MySQL Cluster).
*
* Tables and indexes that are created directly through the
* NdbDictionary class
* can not be viewed from the MySQL Server.
* Dropping indexes directly via the NdbApi will cause inconsistencies
* if they were originally created from a MySQL Cluster.
*
* This class supports schema data enquiries such as:
* -# Enquiries about tables
* (Dictionary::getTable, Table::getNoOfColumns,
* Table::getPrimaryKey, and Table::getNoOfPrimaryKeys)
* -# Enquiries about indexes
* (Dictionary::getIndex, Index::getNoOfColumns,
* and Index::getColumn)
*
* This class supports schema data definition such as:
* -# Creating tables (Dictionary::createTable) and table columns
* -# Dropping tables (Dictionary::dropTable)
* -# Creating secondary indexes (Dictionary::createIndex)
* -# Dropping secondary indexes (Dictionary::dropIndex)
*
* NdbDictionary has several help (inner) classes to support this:
* -# NdbDictionary::Table for creating tables
* -# NdbDictionary::Column for creating table columns
* -# NdbDictionary::Index for creating secondary indexes
*
* See @ref ndbapi_example4.cpp for details of usage.
*/
class NdbDictionary {
public:
/**
* @class Object
* @brief Meta information about a database object (a table, index, etc)
*/
class Object {
public:
/**
* Status of object
*/
enum Status {
New, ///< The object only exist in memory and
///< has not been created in the NDB Kernel
Changed, ///< The object has been modified in memory
///< and has to be commited in NDB Kernel for
///< changes to take effect
Retrieved ///< The object exist and has been read
///< into main memory from NDB Kernel
};
/**
* Get status of object
*/
virtual Status getObjectStatus() const = 0;
/**
* Get version of object
*/
virtual int getObjectVersion() const = 0;
/**
* Object type
*/
enum Type {
TypeUndefined = 0, ///< Undefined
SystemTable = 1, ///< System table
UserTable = 2, ///< User table (may be temporary)
UniqueHashIndex = 3, ///< Unique un-ordered hash index
OrderedIndex = 6, ///< Non-unique ordered index
HashIndexTrigger = 7, ///< Index maintenance, internal
IndexTrigger = 8, ///< Index maintenance, internal
SubscriptionTrigger = 9,///< Backup or replication, internal
ReadOnlyConstraint = 10 ///< Trigger, internal
};
/**
* Object state
*/
enum State {
StateUndefined = 0, ///< Undefined
StateOffline = 1, ///< Offline, not usable
StateBuilding = 2, ///< Building, not yet usable
StateDropping = 3, ///< Offlining or dropping, not usable
StateOnline = 4, ///< Online, usable
StateBroken = 9 ///< Broken, should be dropped and re-created
};
/**
* Object store
*/
enum Store {
StoreUndefined = 0, ///< Undefined
StoreTemporary = 1, ///< Object or data deleted on system restart
StorePermanent = 2 ///< Permanent. logged to disk
};
/**
* Type of fragmentation.
*
* This parameter specifies how data in the table or index will
* be distributed among the db nodes in the cluster.<br>
* The bigger the table the more number of fragments should be used.
* Note that all replicas count as same "fragment".<br>
* For a table, default is FragAllMedium. For a unique hash index,
* default is taken from underlying table and cannot currently
* be changed.
*/
enum FragmentType {
FragUndefined = 0, ///< Fragmentation type undefined or default
FragSingle = 1, ///< Only one fragment
FragAllSmall = 2, ///< One fragment per node group
FragAllMedium = 3, ///< Default value. Two fragments per node group.
FragAllLarge = 4 ///< Eight fragments per node group.
};
};
2004-08-23 17:24:03 +02:00
class Table; // forward declaration
/**
* @class Column
* @brief Represents an column in an NDB Cluster table
*
* Each column has a type. The type of a column is determind by a number
* of type specifiers.
* The type specifiers are:
* - Builtin type
* - Array length or max length
* - Precision and scale
*/
class Column {
public:
/**
* The builtin column types
*/
enum Type {
ndb: wl-1442 mysql vs ndb datatypes: prepare ndb/include/Makefile.am: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/include/kernel/AttributeDescriptor.hpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/include/kernel/signaldata/DictTabInfo.hpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/include/ndb_constants.h: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/include/ndb_types.h: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/include/ndbapi/NdbDictionary.hpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/include/util/NdbSqlUtil.hpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/common/debugger/signaldata/DictTabInfo.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/kernel/blocks/dbdict/Dbdict.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/kernel/vm/MetaData.hpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/ndbapi/Ndb.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/ndbapi/NdbDictionaryImpl.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/ndbapi/NdbDictionaryImpl.hpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup ndb/src/ndbapi/NdbScanOperation.cpp: unify api/kernel types deprecate 2-bit AttributeType, use 5-bit AttributeExtType upgradable from 4.1 via nr/sr/backup
2004-12-26 22:40:42 +01:00
Undefined = NDB_TYPE_UNDEFINED, ///< Undefined
Tinyint = NDB_TYPE_TINYINT, ///< 8 bit. 1 byte signed integer, can be used in array
Tinyunsigned = NDB_TYPE_TINYUNSIGNED, ///< 8 bit. 1 byte unsigned integer, can be used in array
Smallint = NDB_TYPE_SMALLINT, ///< 16 bit. 2 byte signed integer, can be used in array
Smallunsigned = NDB_TYPE_SMALLUNSIGNED, ///< 16 bit. 2 byte unsigned integer, can be used in array
Mediumint = NDB_TYPE_MEDIUMINT, ///< 24 bit. 3 byte signed integer, can be used in array
Mediumunsigned = NDB_TYPE_MEDIUMUNSIGNED,///< 24 bit. 3 byte unsigned integer, can be used in array
Int = NDB_TYPE_INT, ///< 32 bit. 4 byte signed integer, can be used in array
Unsigned = NDB_TYPE_UNSIGNED, ///< 32 bit. 4 byte unsigned integer, can be used in array
Bigint = NDB_TYPE_BIGINT, ///< 64 bit. 8 byte signed integer, can be used in array
Bigunsigned = NDB_TYPE_BIGUNSIGNED, ///< 64 Bit. 8 byte signed integer, can be used in array
Float = NDB_TYPE_FLOAT, ///< 32-bit float. 4 bytes float, can be used in array
Double = NDB_TYPE_DOUBLE, ///< 64-bit float. 8 byte float, can be used in array
Decimal = NDB_TYPE_DECIMAL, ///< Precision, Scale are applicable
Char = NDB_TYPE_CHAR, ///< Len. A fixed array of 1-byte chars
Varchar = NDB_TYPE_VARCHAR, ///< Max len
Binary = NDB_TYPE_BINARY, ///< Len
Varbinary = NDB_TYPE_VARBINARY, ///< Max len
Datetime = NDB_TYPE_DATETIME, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes )
Timespec = NDB_TYPE_TIMESPEC, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes )
Blob = NDB_TYPE_BLOB, ///< Binary large object (see NdbBlob)
Text = NDB_TYPE_TEXT, ///< Text blob,
Bit = NDB_TYPE_BIT ///< Bit, length specifies no of bits
};
/**
* @name General
* @{
*/
/**
* Get name of column
* @return Name of the column
*/
const char* getName() const;
/**
* Get if the column is nullable or not
*/
bool getNullable() const;
/**
* Check if column is part of primary key
*/
bool getPrimaryKey() const;
/**
* Get number of column (horizontal position within table)
*/
int getColumnNo() const;
/**
* Check if column is equal to some other column
* @param column Column to compare with
* @return true if column is equal to some other column otherwise false.
*/
bool equal(const Column& column) const;
/** @} *******************************************************************/
/**
* @name Get Type Specifiers
* @{
*/
/**
* Get type of column
*/
Type getType() const;
/**
* Get precision of column.
* @note Only applicable for builtin type Decimal
*/
int getPrecision() const;
/**
* Get scale of column.
* @note Only applicable for builtin type Decimal
*/
int getScale() const;
/**
* Get length for column
* Array length for column or max length for variable length arrays.
*/
int getLength() const;
2004-06-10 12:04:30 +02:00
2004-09-15 17:44:13 +02:00
/**
* For Char or Varchar or Text, get MySQL CHARSET_INFO. This
2004-09-15 17:44:13 +02:00
* specifies both character set and collation. See get_charset()
* etc in MySQL. (The cs is not "const" in MySQL).
*/
CHARSET_INFO* getCharset() const;
2004-06-10 12:04:30 +02:00
/**
* For blob, get "inline size" i.e. number of initial bytes
2004-06-10 12:04:30 +02:00
* to store in table's blob attribute. This part is normally in
* main memory and can be indexed and interpreted.
*/
int getInlineSize() const;
2004-06-10 12:04:30 +02:00
/**
* For blob, get "part size" i.e. number of bytes to store in
2004-07-22 12:33:14 +02:00
* each tuple of the "blob table". Can be set to zero to omit parts
* and to allow only inline bytes ("tinyblob").
2004-06-10 12:04:30 +02:00
*/
int getPartSize() const;
2004-06-10 12:04:30 +02:00
/**
* For blob, set or get "stripe size" i.e. number of consecutive
* <em>parts</em> to store in each node group.
*/
int getStripeSize() const;
2004-06-10 12:04:30 +02:00
2004-06-10 14:02:31 +02:00
/**
* Get size of element
*/
int getSize() const;
2004-06-10 14:02:31 +02:00
/**
* Check if column is part of distribution key
*
* A <em>distribution key</em> is a set of attributes which are used
* to distribute the tuples onto the NDB nodes.
* The distribution key uses the NDB Cluster hashing function.
*
* An example where this is useful is TPC-C where it might be
* good to use the warehouse id and district id as the distribution key.
* This would place all data for a specific district and warehouse
* in the same database node.
*
* Locally in the fragments the full primary key
* will still be used with the hashing algorithm.
*
* @return true then the column is part of
* the distribution key.
*/
bool getDistributionKey() const;
/** @} *******************************************************************/
/**
* @name Column creation
* @{
*
* These operations should normally not be performed in an NbdApi program
* as results will not be visable in the MySQL Server
*
*/
/**
* Constructor
* @param name Name of column
*/
Column(const char * name = "");
/**
* Copy constructor
* @param column Column to be copied
*/
Column(const Column& column);
~Column();
/**
* Set name of column
* @param name Name of the column
*/
void setName(const char * name);
/**
* Set whether column is nullable or not
*/
void setNullable(bool);
/**
* Set that column is part of primary key
*/
void setPrimaryKey(bool);
/**
* Set type of column
* @param type Type of column
*
* @note setType resets <em>all</em> column attributes
* to (type dependent) defaults and should be the first
* method to call. Default type is Unsigned.
*/
void setType(Type type);
/**
* Set precision of column.
* @note Only applicable for builtin type Decimal
*/
void setPrecision(int);
/**
* Set scale of column.
* @note Only applicable for builtin type Decimal
*/
void setScale(int);
/**
* Set length for column
* Array length for column or max length for variable length arrays.
*/
void setLength(int length);
/**
* For Char or Varchar or Text, get MySQL CHARSET_INFO. This
* specifies both character set and collation. See get_charset()
* etc in MySQL. (The cs is not "const" in MySQL).
*/
void setCharset(CHARSET_INFO* cs);
/**
* For blob, get "inline size" i.e. number of initial bytes
* to store in table's blob attribute. This part is normally in
* main memory and can be indexed and interpreted.
*/
void setInlineSize(int size);
/**
* For blob, get "part size" i.e. number of bytes to store in
* each tuple of the "blob table". Can be set to zero to omit parts
* and to allow only inline bytes ("tinyblob").
*/
void setPartSize(int size);
/**
* For blob, get "stripe size" i.e. number of consecutive
* <em>parts</em> to store in each node group.
*/
void setStripeSize(int size);
/**
* Set distribution key
* @see getDistributionKey
*
* @param enable If set to true, then the column will be part of
* the distribution key.
*/
void setDistributionKey(bool enable);
/** @} *******************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
2004-08-23 17:24:03 +02:00
const Table * getBlobTable() const;
2004-12-21 13:21:59 +01:00
void setAutoIncrement(bool);
bool getAutoIncrement() const;
void setAutoIncrementInitialValue(Uint64 val);
void setDefaultValue(const char*);
const char* getDefaultValue() const;
static const Column * FRAGMENT;
static const Column * ROW_COUNT;
static const Column * COMMIT_COUNT;
static const Column * ROW_SIZE;
static const Column * RANGE_NO;
#endif
private:
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
2004-06-10 14:02:31 +02:00
friend class NdbRecAttr;
friend class NdbColumnImpl;
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#endif
class NdbColumnImpl & m_impl;
Column(NdbColumnImpl&);
Column& operator=(const Column&);
};
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
* ???
*/
typedef Column Attribute;
#endif
/**
* @brief Represents a table in NDB Cluster
*
* <em>TableSize</em><br>
* When calculating the data storage one should add the size of all
* attributes (each attributeconsumes at least 4 bytes) and also an overhead
* of 12 byte. Variable size attributes (not supported yet) will have a
* size of 12 bytes plus the actual data storage parts where there is an
* additional overhead based on the size of the variable part.<br>
* An example table with 5 attributes:
* one 64 bit attribute, one 32 bit attribute,
* two 16 bit attributes and one array of 64 8 bits.
* This table will consume
* 12 (overhead) + 8 + 4 + 2*4 (4 is minimum) + 64 = 96 bytes per record.
* Additionally an overhead of about 2 % as page headers and waste should
* be allocated. Thus, 1 million records should consume 96 MBytes
* plus the overhead 2 MByte and rounded up to 100 000 kBytes.<br>
*
*/
class Table : public Object {
public:
/**
* @name General
* @{
*/
/**
* Get table name
*/
const char * getName() const;
/**
* Get table id
*/
int getTableId() const;
/**
* Get column definition via name.
* @return null if none existing name
*/
const Column* getColumn(const char * name) const;
/**
* Get column definition via index in table.
* @return null if none existing name
*/
Column* getColumn(const int attributeId);
/**
* Get column definition via name.
* @return null if none existing name
*/
Column* getColumn(const char * name);
/**
* Get column definition via index in table.
* @return null if none existing name
*/
const Column* getColumn(const int attributeId) const;
/** @} *******************************************************************/
/**
* @name Storage
* @{
*/
/**
* If set to false, then the table is a temporary
* table and is not logged to disk.
*
* In case of a system restart the table will still
* be defined and exist but will be empty.
* Thus no checkpointing and no logging is performed on the table.
*
* The default value is true and indicates a normal table
* with full checkpointing and logging activated.
*/
bool getLogging() const;
/**
* Get fragmentation type
*/
FragmentType getFragmentType() const;
/**
* Get KValue (Hash parameter.)
* Only allowed value is 6.
* Later implementations might add flexibility in this parameter.
*/
int getKValue() const;
/**
* Get MinLoadFactor (Hash parameter.)
* This value specifies the load factor when starting to shrink
* the hash table.
* It must be smaller than MaxLoadFactor.
* Both these factors are given in percentage.
*/
int getMinLoadFactor() const;
/**
* Get MaxLoadFactor (Hash parameter.)
* This value specifies the load factor when starting to split
* the containers in the local hash tables.
* 100 is the maximum which will optimize memory usage.
* A lower figure will store less information in each container and thus
* find the key faster but consume more memory.
*/
int getMaxLoadFactor() const;
/** @} *******************************************************************/
/**
* @name Other
* @{
*/
/**
* Get number of columns in the table
*/
int getNoOfColumns() const;
/**
* Get number of primary keys in the table
*/
int getNoOfPrimaryKeys() const;
/**
* Get name of primary key
*/
const char* getPrimaryKey(int no) const;
/**
* Check if table is equal to some other table
*/
bool equal(const Table&) const;
/**
* Get frm file stored with this table
*/
const void* getFrmData() const;
Uint32 getFrmLength() const;
/** @} *******************************************************************/
/**
* @name Table creation
* @{
*
* These methods should normally not be used in an application as
* the result is not accessible from the MySQL Server
*
*/
/**
* Constructor
* @param name Name of table
*/
Table(const char * name = "");
/**
* Copy constructor
* @param table Table to be copied
*/
Table(const Table& table);
virtual ~Table();
/**
* Assignment operator, deep copy
* @param table Table to be copied
*/
Table& operator=(const Table&);
/**
* Name of table
* @param name Name of table
*/
void setName(const char * name);
/**
* Add a column definition to a table
* @note creates a copy
*/
void addColumn(const Column &);
/**
* @see NdbDictionary::Table::getLogging.
*/
void setLogging(bool);
/**
* Set fragmentation type
*/
void setFragmentType(FragmentType);
/**
* Set KValue (Hash parameter.)
* Only allowed value is 6.
* Later implementations might add flexibility in this parameter.
*/
void setKValue(int kValue);
/**
* Set MinLoadFactor (Hash parameter.)
* This value specifies the load factor when starting to shrink
* the hash table.
* It must be smaller than MaxLoadFactor.
* Both these factors are given in percentage.
*/
void setMinLoadFactor(int);
/**
* Set MaxLoadFactor (Hash parameter.)
* This value specifies the load factor when starting to split
* the containers in the local hash tables.
* 100 is the maximum which will optimize memory usage.
* A lower figure will store less information in each container and thus
* find the key faster but consume more memory.
*/
void setMaxLoadFactor(int);
/**
* Get table object type
*/
Object::Type getObjectType() const;
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
/**
* Set frm file to store with this table
*/
void setFrm(const void* data, Uint32 len);
/**
* Set table object type
*/
void setObjectType(Object::Type type);
/** @} *******************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
void setStoredTable(bool x) { setLogging(x); }
bool getStoredTable() const { return getLogging(); }
int getRowSizeInBytes() const ;
int createTableInDb(Ndb*, bool existingEqualIsOk = true) const ;
#endif
private:
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbTableImpl;
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#endif
class NdbTableImpl & m_impl;
Table(NdbTableImpl&);
};
/**
* @class Index
* @brief Represents an index in an NDB Cluster
*/
class Index : public Object {
public:
/**
* @name Getting Index properties
* @{
*/
/**
* Get the name of an index
*/
const char * getName() const;
/**
* Get the name of the table being indexed
*/
const char * getTable() const;
/**
* Get the number of columns in the index
*/
unsigned getNoOfColumns() const;
2004-12-23 13:43:54 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Get the number of columns in the index
* Depricated, use getNoOfColumns instead.
*/
int getNoOfIndexColumns() const;
2004-12-23 13:43:54 +01:00
#endif
/**
* Get a specific column in the index
*/
const Column * getColumn(unsigned no) const ;
2004-12-23 13:43:54 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Get a specific column name in the index
* Depricated, use getColumn instead.
*/
const char * getIndexColumn(int no) const ;
2004-12-23 13:43:54 +01:00
#endif
/**
* Represents type of index
*/
enum Type {
Undefined = 0, ///< Undefined object type (initial value)
UniqueHashIndex = 3, ///< Unique un-ordered hash index
///< (only one currently supported)
OrderedIndex = 6 ///< Non-unique ordered index
};
/**
* Get index type of the index
*/
Type getType() const;
/**
* Check if index is set to be stored on disk
*
* @return if true then logging id enabled
*
* @note Non-logged indexes are rebuilt at system restart.
* @note Ordered index does not currently support logging.
*/
bool getLogging() const;
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
/** @} *******************************************************************/
/**
* @name Index creation
* @{
*
* These methods should normally not be used in an application as
* the result will not be visible from the MySQL Server
*
*/
/**
* Constructor
* @param name Name of index
*/
Index(const char * name = "");
virtual ~Index();
/**
* Set the name of an index
*/
void setName(const char * name);
/**
* Define the name of the table to be indexed
*/
void setTable(const char * name);
/**
* Add a column to the index definition
* Note that the order of columns will be in
* the order they are added (only matters for ordered indexes).
*/
void addColumn(const Column & c);
/**
* Add a column name to the index definition
* Note that the order of indexes will be in
* the order they are added (only matters for ordered indexes).
*/
void addColumnName(const char * name);
2004-12-23 13:43:54 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Add a column name to the index definition
* Note that the order of indexes will be in
* the order they are added (only matters for ordered indexes).
* Depricated, use addColumnName instead.
*/
void addIndexColumn(const char * name);
2004-12-23 13:43:54 +01:00
#endif
/**
* Add several column names to the index definition
* Note that the order of indexes will be in
* the order they are added (only matters for ordered indexes).
*/
void addColumnNames(unsigned noOfNames, const char ** names);
2004-12-23 13:43:54 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Add several column names to the index definition
* Note that the order of indexes will be in
* the order they are added (only matters for ordered indexes).
* Depricated, use addColumnNames instead.
*/
void addIndexColumns(int noOfNames, const char ** names);
2004-12-23 13:43:54 +01:00
#endif
/**
* Set index type of the index
*/
void setType(Type type);
/**
* Enable/Disable index storage on disk
*
* @param enable If enable is set to true, then logging becomes enabled
*
* @see NdbDictionary::Index::getLogging
*/
void setLogging(bool enable);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
void setStoredIndex(bool x) { setLogging(x); }
bool getStoredIndex() const { return getLogging(); }
#endif
/** @} *******************************************************************/
private:
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbIndexImpl;
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#endif
class NdbIndexImpl & m_impl;
Index(NdbIndexImpl&);
};
/**
* @brief Represents an Event in NDB Cluster
*
*/
class Event : public Object {
public:
enum TableEvent { TE_INSERT=1, TE_DELETE=2, TE_UPDATE=4, TE_ALL=7 };
enum EventDurability {
ED_UNDEFINED = 0,
#if 0 // not supported
ED_SESSION = 1,
// Only this API can use it
// and it's deleted after api has disconnected or ndb has restarted
ED_TEMPORARY = 2,
// All API's can use it,
// But's its removed when ndb is restarted
#endif
ED_PERMANENT = 3
// All API's can use it,
// It's still defined after a restart
};
Event(const char *name);
virtual ~Event();
void setName(const char *);
void setTable(const char *);
void addTableEvent(const TableEvent);
void setDurability(const EventDurability);
void addColumn(const Column &c);
void addEventColumn(unsigned attrId);
void addEventColumn(const char * columnName);
void addEventColumns(int n, const char ** columnNames);
/**
* Get object status
*/
virtual Object::Status getObjectStatus() const;
/**
* Get object version
*/
virtual int getObjectVersion() const;
void print();
private:
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbEventImpl;
friend class NdbEventOperationImpl;
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#endif
class NdbEventImpl & m_impl;
Event(NdbEventImpl&);
};
/**
* @class Dictionary
* @brief Dictionary for defining and retreiving meta data
*/
class Dictionary {
public:
/**
* @class List
* @brief Structure for retrieving lists of object names
*/
struct List {
/**
* @struct Element
* @brief Object to be stored in an NdbDictionary::Dictionary::List
*/
struct Element {
unsigned id; ///< Id of object
Object::Type type; ///< Type of object
Object::State state; ///< State of object
Object::Store store; ///< How object is stored
char * database; ///< In what database the object resides
char * schema; ///< What schema the object is defined in
char * name; ///< Name of object
Element() :
id(0),
type(Object::TypeUndefined),
state(Object::StateUndefined),
store(Object::StoreUndefined),
database(0),
schema(0),
name(0) {
}
};
unsigned count; ///< Number of elements in list
Element * elements; ///< Pointer to array of elements
List() : count(0), elements(0) {}
~List() {
if (elements != 0) {
for (unsigned i = 0; i < count; i++) {
delete[] elements[i].database;
delete[] elements[i].schema;
delete[] elements[i].name;
elements[i].name = 0;
}
delete[] elements;
count = 0;
elements = 0;
}
}
};
/**
* @name General
* @{
*/
/**
* Fetch list of all objects, optionally restricted to given type.
*/
int listObjects(List & list, Object::Type type = Object::TypeUndefined);
/**
* Get the latest error
*
* @return Error object.
*/
const struct NdbError & getNdbError() const;
/** @} *******************************************************************/
/**
* @name Retrieving references to Tables and Indexes
* @{
*/
/**
* Get table with given name, NULL if undefined
* @param name Name of table to get
* @return table if successful otherwise NULL.
*/
const Table * getTable(const char * name);
/**
* Get index with given name, NULL if undefined
* @param indexName Name of index to get.
* @param tableName Name of table that index belongs to.
* @return index if successful, otherwise 0.
*/
const Index * getIndex(const char * indexName,
const char * tableName);
/**
* Fetch list of indexes of given table.
* @param list Reference to list where to store the listed indexes
* @param tableName Name of table that index belongs to.
* @return 0 if successful, otherwise -1
*/
int listIndexes(List & list, const char * tableName);
/** @} *******************************************************************/
/**
* @name Events
* @{
*/
/**
* Create event given defined Event instance
* @param Event to create
* @return 0 if successful otherwise -1.
*/
int createEvent(const Event &);
/**
* Drop event with given name
* @param eventName Name of event to drop.
* @return 0 if successful otherwise -1.
*/
int dropEvent(const char * eventName);
/**
* Get event with given name.
* @param eventName Name of event to get.
* @return an Event if successful, otherwise NULL.
*/
const Event * getEvent(const char * eventName);
/** @} *******************************************************************/
/**
* @name Table creation
* @{
*
* These methods should normally not be used in an application as
* the result will not be visible from the MySQL Server
*/
/**
* Create defined table given defined Table instance
* @param Table Table to create
* @return 0 if successful otherwise -1.
*/
int createTable(const Table &);
/**
* Drop table given retrieved Table instance
* @param Table Table to drop
* @return 0 if successful otherwise -1.
*/
int dropTable(Table &);
/**
* Drop table given table name
* @param name Name of table to drop
* @return 0 if successful otherwise -1.
*/
int dropTable(const char * name);
/**
* Alter defined table given defined Table instance
* @param Table Table to alter
* @return -2 (incompatible version) <br>
* -1 general error <br>
* 0 success
*/
int alterTable(const Table &);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
* Invalidate cached table object
* @param name Name of table to invalidate
*/
void invalidateTable(const char * name);
#endif
/**
* Remove table/index from local cache
*/
void removeCachedTable(const char * table);
void removeCachedIndex(const char * index, const char * table);
/** @} *******************************************************************/
/**
* @name Index creation
* @{
*
* These methods should normally not be used in an application as
* the result will not be visible from the MySQL Server
*
*/
/**
* Create index given defined Index instance
* @param Index to create
* @return 0 if successful otherwise -1.
*/
int createIndex(const Index &);
/**
* Drop index with given name
* @param indexName Name of index to drop.
* @param tableName Name of table that index belongs to.
* @return 0 if successful otherwise -1.
*/
int dropIndex(const char * indexName,
const char * tableName);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
* Invalidate cached index object
*/
void invalidateIndex(const char * indexName,
const char * tableName);
#endif
/** @} *******************************************************************/
protected:
Dictionary(Ndb & ndb);
~Dictionary();
private:
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
friend class NdbDictionaryImpl;
friend class UtilTransactions;
2004-06-10 12:04:30 +02:00
friend class NdbBlob;
backwards compatible name change NdbConnectionto NdbTransaction removed friend declarations from doxygen updated some documentation in mgmapi BitKeeper/deleted/.del-NdbCursorOperation.hpp~da121aeaf101b136: Delete: ndb/include/ndbapi/NdbCursorOperation.hpp BitKeeper/deleted/.del-NdbCursorOperation.cpp~8d49480ced2deba5: Delete: ndb/src/ndbapi/NdbCursorOperation.cpp ndb/include/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/ScanTab.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcCommit.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcHbRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcIndx.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcKeyFailConf.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TcRollbackRep.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/kernel/signaldata/TransIdAI.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/mgmapi/mgmapi.h: backwards compatible name change NdbConnectionto NdbTransaction documented some missing things in mgmapi ndb/include/ndbapi/Ndb.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbApi.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbBlob.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbDictionary.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbEventOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbIndexScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbRecAttr.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbReceiver.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanFilter.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbScanOperation.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/include/ndbapi/NdbTransaction.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Makefile.am: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndb.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbApiSignal.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbBlob.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbImpl.hpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbIndexOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationDefine.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationExec.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationInt.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbOperationSearch.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbReceiver.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbScanOperation.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransaction.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/NdbTransactionScan.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndberr.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbif.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndbinit.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/src/ndbapi/Ndblist.cpp: backwards compatible name change NdbConnectionto NdbTransaction ndb/tools/restore/consumer_restore.hpp: backwards compatible name change NdbConnectionto NdbTransaction sql/ha_ndbcluster.h: backwards compatible name change NdbConnectionto NdbTransaction
2004-12-23 11:21:01 +01:00
#endif
class NdbDictionaryImpl & m_impl;
Dictionary(NdbDictionaryImpl&);
const Table * getIndexTable(const char * indexName,
const char * tableName);
moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization new methods to keep "records" up to datecorrect record field in ndbcluster handler new method for ndbcluster handler to store/retrieve table and thread specific data changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl hanged deleteKey to return ponter to deleted object moved heavy global cache fetch from inline to separate method mysql-test/r/ndb_alter_table.result: correct record field in ndbcluster handler mysql-test/r/ndb_blob.result: correct record field in ndbcluster handler ndb/include/ndbapi/NdbDictionary.hpp: new method for ndbcluster handler to store/retrieve table and thread specific data ndb/src/ndbapi/DictCache.cpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl ndb/src/ndbapi/DictCache.hpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl ndb/src/ndbapi/Ndb.cpp: replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info ndb/src/ndbapi/NdbDictionary.cpp: new method for ndbcluster handler to store/retrieve table and thread specific data ndb/src/ndbapi/NdbDictionaryImpl.cpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl moved heavy global cache fetch from inline to separate method ndb/src/ndbapi/NdbDictionaryImpl.hpp: replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info ndb/src/ndbapi/NdbLinHash.hpp: changed deleteKey to return ponter to deleted object sql/ha_ndbcluster.cc: moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization sql/ha_ndbcluster.h: new methods to keep "records" up to date sql/sql_class.h: moved all ndb thread specific data into new placeholder
2004-09-14 08:52:21 +00:00
public:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization new methods to keep "records" up to datecorrect record field in ndbcluster handler new method for ndbcluster handler to store/retrieve table and thread specific data changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl hanged deleteKey to return ponter to deleted object moved heavy global cache fetch from inline to separate method mysql-test/r/ndb_alter_table.result: correct record field in ndbcluster handler mysql-test/r/ndb_blob.result: correct record field in ndbcluster handler ndb/include/ndbapi/NdbDictionary.hpp: new method for ndbcluster handler to store/retrieve table and thread specific data ndb/src/ndbapi/DictCache.cpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl ndb/src/ndbapi/DictCache.hpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl ndb/src/ndbapi/Ndb.cpp: replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info ndb/src/ndbapi/NdbDictionary.cpp: new method for ndbcluster handler to store/retrieve table and thread specific data ndb/src/ndbapi/NdbDictionaryImpl.cpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl moved heavy global cache fetch from inline to separate method ndb/src/ndbapi/NdbDictionaryImpl.hpp: replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info ndb/src/ndbapi/NdbLinHash.hpp: changed deleteKey to return ponter to deleted object sql/ha_ndbcluster.cc: moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization sql/ha_ndbcluster.h: new methods to keep "records" up to date sql/sql_class.h: moved all ndb thread specific data into new placeholder
2004-09-14 08:52:21 +00:00
const Table * getTable(const char * name, void **data);
void set_local_table_data_size(unsigned sz);
#endif
};
};
2004-07-22 12:33:14 +02:00
class NdbOut& operator <<(class NdbOut& out, const NdbDictionary::Column& col);
2004-06-10 14:02:31 +02:00
#endif