2004-04-14 10:53:21 +02:00
|
|
|
/* 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 DICT_TAB_INFO_HPP
|
|
|
|
#define DICT_TAB_INFO_HPP
|
|
|
|
|
|
|
|
#include "SignalData.hpp"
|
|
|
|
#include <AttributeDescriptor.hpp>
|
|
|
|
#include <SimpleProperties.hpp>
|
|
|
|
#include <ndb_limits.h>
|
|
|
|
#include <NdbSqlUtil.hpp>
|
2005-11-07 12:19:28 +01:00
|
|
|
#include <ndb_global.h>
|
2004-04-14 10:53:21 +02:00
|
|
|
|
2005-02-16 21:19:42 +01:00
|
|
|
#ifndef my_decimal_h
|
|
|
|
|
|
|
|
// sql/my_decimal.h requires many more sql/*.h new to ndb
|
|
|
|
// for now, copy the bit we need TODO proper fix
|
|
|
|
|
|
|
|
#define DECIMAL_MAX_LENGTH ((8 * 9) - 8)
|
|
|
|
|
|
|
|
#ifndef NOT_FIXED_DEC
|
|
|
|
#define NOT_FIXED_DEC 31
|
|
|
|
#endif
|
|
|
|
|
|
|
|
C_MODE_START
|
|
|
|
extern int decimal_bin_size(int, int);
|
|
|
|
C_MODE_END
|
|
|
|
|
|
|
|
inline int my_decimal_get_binary_size(uint precision, uint scale)
|
|
|
|
{
|
|
|
|
return decimal_bin_size((int)precision, (int)scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
#define DTIMAP(x, y, z) \
|
|
|
|
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
|
|
|
|
|
|
|
|
#define DTIMAP2(x, y, z, u, v) \
|
|
|
|
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
|
|
|
|
|
|
|
|
#define DTIMAPS(x, y, z, u, v) \
|
|
|
|
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
|
|
|
|
|
|
|
|
#define DTIMAPB(x, y, z, u, v, l) \
|
|
|
|
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
|
|
|
|
offsetof(x, l) }
|
|
|
|
|
|
|
|
#define DTIBREAK(x) \
|
2004-10-20 13:42:41 +00:00
|
|
|
{ DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 }
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
class DictTabInfo {
|
|
|
|
/**
|
|
|
|
* Sender(s) / Reciver(s)
|
|
|
|
*/
|
|
|
|
// Blocks
|
|
|
|
friend class Backup;
|
|
|
|
friend class Dbdict;
|
|
|
|
friend class Ndbcntr;
|
|
|
|
friend class Trix;
|
|
|
|
friend class DbUtil;
|
|
|
|
// API
|
|
|
|
friend class NdbSchemaOp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For printing
|
|
|
|
*/
|
|
|
|
friend bool printDICTTABINFO(FILE * output,
|
|
|
|
const Uint32 * theData,
|
|
|
|
Uint32 len,
|
|
|
|
Uint16 receiverBlockNo);
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum RequestType {
|
|
|
|
CreateTableFromAPI = 1,
|
|
|
|
AddTableFromDict = 2, // Between DICT's
|
|
|
|
CopyTable = 3, // Between DICT's
|
|
|
|
ReadTableFromDiskSR = 4, // Local in DICT
|
|
|
|
GetTabInfoConf = 5,
|
2005-11-07 12:19:28 +01:00
|
|
|
AlterTableFromAPI = 6
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
2005-11-07 12:19:28 +01:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
enum KeyValues {
|
|
|
|
TableName = 1, // String, Mandatory
|
|
|
|
TableId = 2, //Mandatory between DICT's otherwise not allowed
|
|
|
|
TableVersion = 3, //Mandatory between DICT's otherwise not allowed
|
|
|
|
TableLoggedFlag = 4, //Default Logged
|
|
|
|
NoOfKeyAttr = 5, //Default 1
|
|
|
|
NoOfAttributes = 6, //Mandatory
|
|
|
|
NoOfNullable = 7, //Deafult 0
|
|
|
|
NoOfVariable = 8, //Default 0
|
|
|
|
TableKValue = 9, //Default 6
|
|
|
|
MinLoadFactor = 10, //Default 70
|
|
|
|
MaxLoadFactor = 11, //Default 80
|
|
|
|
KeyLength = 12, //Default 1 (No of words in primary key)
|
|
|
|
FragmentTypeVal = 13, //Default AllNodesSmallTable
|
|
|
|
TableTypeVal = 18, //Default TableType::UserTable
|
|
|
|
PrimaryTable = 19, //Mandatory for index otherwise RNIL
|
|
|
|
PrimaryTableId = 20, //ditto
|
|
|
|
IndexState = 21,
|
|
|
|
InsertTriggerId = 22,
|
|
|
|
UpdateTriggerId = 23,
|
|
|
|
DeleteTriggerId = 24,
|
|
|
|
CustomTriggerId = 25,
|
|
|
|
FrmLen = 26,
|
|
|
|
FrmData = 27,
|
2006-06-27 10:02:58 +02:00
|
|
|
|
2006-09-07 15:09:34 +02:00
|
|
|
TableTemporaryFlag = 28, //Default not Temporary
|
|
|
|
|
2004-05-26 13:24:14 +02:00
|
|
|
FragmentCount = 128, // No of fragments in table (!fragment replicas)
|
2005-01-10 14:40:54 +01:00
|
|
|
FragmentDataLen = 129,
|
|
|
|
FragmentData = 130, // CREATE_FRAGMENTATION reply
|
2005-11-07 12:19:28 +01:00
|
|
|
TablespaceId = 131,
|
|
|
|
TablespaceVersion = 132,
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
TablespaceDataLen = 133,
|
|
|
|
TablespaceData = 134,
|
|
|
|
RangeListDataLen = 135,
|
|
|
|
RangeListData = 136,
|
|
|
|
ReplicaDataLen = 137,
|
|
|
|
ReplicaData = 138,
|
|
|
|
MaxRowsLow = 139,
|
|
|
|
MaxRowsHigh = 140,
|
|
|
|
DefaultNoPartFlag = 141,
|
2006-01-17 09:25:12 +01:00
|
|
|
LinearHashFlag = 142,
|
2006-06-27 11:22:42 +02:00
|
|
|
MinRowsLow = 143,
|
2006-06-27 10:02:58 +02:00
|
|
|
MinRowsHigh = 144,
|
2006-01-11 11:35:25 +01:00
|
|
|
|
|
|
|
RowGCIFlag = 150,
|
|
|
|
RowChecksumFlag = 151,
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
TableEnd = 999,
|
|
|
|
|
|
|
|
AttributeName = 1000, // String, Mandatory
|
|
|
|
AttributeId = 1001, //Mandatory between DICT's otherwise not allowed
|
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
|
|
|
AttributeType = 1002, //for osu 4.1->5.0.x
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeSize = 1003, //Default DictTabInfo::a32Bit
|
|
|
|
AttributeArraySize = 1005, //Default 1
|
|
|
|
AttributeKeyFlag = 1006, //Default noKey
|
2005-11-07 12:19:28 +01:00
|
|
|
AttributeStorageType = 1007, //Default NDB_STORAGETYPE_MEMORY
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeNullableFlag = 1008, //Default NotNullable
|
|
|
|
AttributeDKey = 1010, //Default NotDKey
|
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
|
|
|
AttributeExtType = 1013, //Default ExtUnsigned
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeExtPrecision = 1014, //Default 0
|
|
|
|
AttributeExtScale = 1015, //Default 0
|
|
|
|
AttributeExtLength = 1016, //Default 0
|
|
|
|
AttributeAutoIncrement = 1017, //Default false
|
2005-11-07 12:19:28 +01:00
|
|
|
AttributeDefaultValue = 1018, //Default value (printable string),
|
|
|
|
AttributeArrayType = 1019, //Default NDB_ARRAYTYPE_FIXED
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeEnd = 1999 //
|
|
|
|
};
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// Part of the protocol is that we only transfer parameters which do not
|
|
|
|
// have a default value. Thus the default values are part of the protocol.
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
2004-12-14 10:58:29 +01:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
// FragmentType constants
|
|
|
|
enum FragmentType {
|
|
|
|
AllNodesSmallTable = 0,
|
|
|
|
AllNodesMediumTable = 1,
|
|
|
|
AllNodesLargeTable = 2,
|
2005-07-18 13:31:02 +02:00
|
|
|
SingleFragment = 3,
|
|
|
|
DistrKeyHash = 4,
|
|
|
|
DistrKeyLin = 5,
|
|
|
|
UserDefined = 6,
|
|
|
|
DistrKeyUniqueHashIndex = 7,
|
|
|
|
DistrKeyOrderedIndex = 8
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// TableType constants + objects
|
|
|
|
enum TableType {
|
|
|
|
UndefTableType = 0,
|
|
|
|
SystemTable = 1,
|
|
|
|
UserTable = 2,
|
|
|
|
UniqueHashIndex = 3,
|
|
|
|
HashIndex = 4,
|
|
|
|
UniqueOrderedIndex = 5,
|
|
|
|
OrderedIndex = 6,
|
|
|
|
// constant 10 hardcoded in Dbdict.cpp
|
2005-11-07 12:19:28 +01:00
|
|
|
HashIndexTrigger = 11,
|
|
|
|
SubscriptionTrigger = 16,
|
|
|
|
ReadOnlyConstraint = 17,
|
|
|
|
IndexTrigger = 18,
|
|
|
|
|
|
|
|
Tablespace = 20, ///< Tablespace
|
|
|
|
LogfileGroup = 21, ///< Logfile group
|
|
|
|
Datafile = 22, ///< Datafile
|
|
|
|
Undofile = 23 ///< Undofile
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
2006-03-05 22:49:38 +01:00
|
|
|
|
|
|
|
// used 1) until type BlobTable added 2) in upgrade code
|
|
|
|
static bool
|
|
|
|
isBlobTableName(const char* name, Uint32* ptab_id = 0, Uint32* pcol_no = 0);
|
2005-11-07 12:19:28 +01:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
static inline bool
|
|
|
|
isTable(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == SystemTable ||
|
|
|
|
tableType == UserTable;
|
|
|
|
}
|
|
|
|
static inline bool
|
|
|
|
isIndex(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == UniqueHashIndex ||
|
|
|
|
tableType == HashIndex ||
|
|
|
|
tableType == UniqueOrderedIndex ||
|
|
|
|
tableType == OrderedIndex;
|
|
|
|
}
|
|
|
|
static inline bool
|
|
|
|
isUniqueIndex(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == UniqueHashIndex ||
|
|
|
|
tableType == UniqueOrderedIndex;
|
|
|
|
}
|
|
|
|
static inline bool
|
|
|
|
isNonUniqueIndex(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == HashIndex ||
|
|
|
|
tableType == OrderedIndex;
|
|
|
|
}
|
|
|
|
static inline bool
|
|
|
|
isHashIndex(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == UniqueHashIndex ||
|
|
|
|
tableType == HashIndex;
|
|
|
|
}
|
|
|
|
static inline bool
|
|
|
|
isOrderedIndex(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == UniqueOrderedIndex ||
|
|
|
|
tableType == OrderedIndex;
|
|
|
|
}
|
2005-11-07 12:19:28 +01:00
|
|
|
static inline bool
|
|
|
|
isTrigger(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == HashIndexTrigger ||
|
|
|
|
tableType == SubscriptionTrigger ||
|
|
|
|
tableType == ReadOnlyConstraint ||
|
|
|
|
tableType == IndexTrigger;
|
|
|
|
}
|
|
|
|
static inline bool
|
|
|
|
isFilegroup(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == Tablespace ||
|
|
|
|
tableType == LogfileGroup;
|
|
|
|
}
|
2004-04-14 10:53:21 +02:00
|
|
|
|
2005-11-07 12:19:28 +01:00
|
|
|
static inline bool
|
|
|
|
isFile(int tableType) {
|
|
|
|
return
|
|
|
|
tableType == Datafile||
|
|
|
|
tableType == Undofile;
|
|
|
|
}
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
// Object state for translating from/to API
|
|
|
|
enum ObjectState {
|
|
|
|
StateUndefined = 0,
|
|
|
|
StateOffline = 1,
|
|
|
|
StateBuilding = 2,
|
|
|
|
StateDropping = 3,
|
|
|
|
StateOnline = 4,
|
2005-07-20 11:48:48 +02:00
|
|
|
StateBackup = 5,
|
2004-04-14 10:53:21 +02:00
|
|
|
StateBroken = 9
|
|
|
|
};
|
|
|
|
|
|
|
|
// Object store for translating from/to API
|
|
|
|
enum ObjectStore {
|
|
|
|
StoreUndefined = 0,
|
2006-09-07 15:09:34 +02:00
|
|
|
StoreNotLogged = 1,
|
2004-04-14 10:53:21 +02:00
|
|
|
StorePermanent = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
// AttributeSize constants
|
2004-12-05 19:48:15 +01:00
|
|
|
STATIC_CONST( aBit = 0 );
|
2004-10-26 09:48:01 +00:00
|
|
|
STATIC_CONST( an8Bit = 3 );
|
|
|
|
STATIC_CONST( a16Bit = 4 );
|
|
|
|
STATIC_CONST( a32Bit = 5 );
|
|
|
|
STATIC_CONST( a64Bit = 6 );
|
|
|
|
STATIC_CONST( a128Bit = 7 );
|
2004-12-14 10:58:29 +01:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
// Table data interpretation
|
|
|
|
struct Table {
|
|
|
|
char TableName[MAX_TAB_NAME_SIZE];
|
|
|
|
Uint32 TableId;
|
|
|
|
char PrimaryTable[MAX_TAB_NAME_SIZE]; // Only used when "index"
|
|
|
|
Uint32 PrimaryTableId;
|
|
|
|
Uint32 TableLoggedFlag;
|
2006-09-07 15:09:34 +02:00
|
|
|
Uint32 TableTemporaryFlag;
|
2004-04-14 10:53:21 +02:00
|
|
|
Uint32 NoOfKeyAttr;
|
|
|
|
Uint32 NoOfAttributes;
|
|
|
|
Uint32 NoOfNullable;
|
|
|
|
Uint32 NoOfVariable;
|
|
|
|
Uint32 TableKValue;
|
|
|
|
Uint32 MinLoadFactor;
|
|
|
|
Uint32 MaxLoadFactor;
|
|
|
|
Uint32 KeyLength;
|
|
|
|
Uint32 FragmentType;
|
|
|
|
Uint32 TableType;
|
|
|
|
Uint32 TableVersion;
|
|
|
|
Uint32 IndexState;
|
|
|
|
Uint32 InsertTriggerId;
|
|
|
|
Uint32 UpdateTriggerId;
|
|
|
|
Uint32 DeleteTriggerId;
|
|
|
|
Uint32 CustomTriggerId;
|
2005-11-07 12:19:28 +01:00
|
|
|
Uint32 TablespaceId;
|
|
|
|
Uint32 TablespaceVersion;
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
Uint32 DefaultNoPartFlag;
|
2006-01-17 09:25:12 +01:00
|
|
|
Uint32 LinearHashFlag;
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
/*
|
|
|
|
TODO RONM:
|
|
|
|
We need to replace FRM, Fragment Data, Tablespace Data and in
|
|
|
|
very particular RangeListData with dynamic arrays
|
|
|
|
*/
|
2004-04-14 10:53:21 +02:00
|
|
|
Uint32 FrmLen;
|
|
|
|
char FrmData[MAX_FRM_DATA_SIZE];
|
2004-05-26 13:24:14 +02:00
|
|
|
Uint32 FragmentCount;
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
Uint32 ReplicaDataLen;
|
|
|
|
Uint16 ReplicaData[MAX_FRAGMENT_DATA_BYTES];
|
2005-01-10 14:40:54 +01:00
|
|
|
Uint32 FragmentDataLen;
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
Uint16 FragmentData[3*MAX_NDB_PARTITIONS];
|
2006-06-27 11:22:42 +02:00
|
|
|
|
2006-06-27 10:02:58 +02:00
|
|
|
Uint32 MaxRowsLow;
|
|
|
|
Uint32 MaxRowsHigh;
|
|
|
|
Uint32 MinRowsLow;
|
|
|
|
Uint32 MinRowsHigh;
|
2006-06-27 11:22:42 +02:00
|
|
|
|
WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
include/thr_lock.h:
New method to downgrade locks from TL_WRITE_ONLY
Possibility to upgrade lock while aborting locks
mysql-test/r/ndb_autodiscover.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_bitfield.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_gis.result:
Fix for lowercase and that all NDB tables are now partitioned
mysql-test/r/ndb_partition_key.result:
New test case
mysql-test/r/partition.result:
New test case
mysql-test/r/partition_error.result:
New test case
mysql-test/r/partition_mgm_err.result:
Fix of test case results
mysql-test/t/disabled.def:
partition_03ndb still has bug
mysql-test/t/ndb_partition_key.test:
New test cases for new functionality and bugs
mysql-test/t/partition.test:
New test cases for new functionality and bugs
mysql-test/t/partition_error.test:
New test cases for new functionality and bugs
mysql-test/t/partition_mgm_err.test:
New test cases for new functionality and bugs
mysys/thr_lock.c:
New method to downgrade TL_WRITE_ONLY locks
Possibility to specify if locks are to be upgraded at abort locks
sql/ha_archive.cc:
New handlerton methods
sql/ha_berkeley.cc:
New handlerton methods
sql/ha_blackhole.cc:
New handlerton methods
sql/ha_federated.cc:
New handlerton methods
sql/ha_heap.cc:
New handlerton methods
sql/ha_innodb.cc:
New handlerton methods
sql/ha_myisam.cc:
New handlerton methods
sql/ha_myisammrg.cc:
New handlerton methods
sql/ha_ndbcluster.cc:
New handlerton methods
Moved out packfrm and unpackfrm methods
Adapted many parts to use table_share instead of table->s
Ensured that .ndb file uses filename and not tablename
according to new encoding of names (WL 1324)
All NDB tables are partitioned and set up partition info
Fixed such that tablenames use tablenames and not filenames in NDB
NDB uses auto partitioning for ENGINE=NDB tables
Warning for very large tables
Set RANGE data
Set LIST data
New method to set-up partition info
Set Default number of partitions flag
Set linear hash flag
Set node group array
Set number of fragments
Set max rows
Set tablespace names
New method to get number of partitions of table to use at open table
sql/ha_ndbcluster.h:
Removed partition_flags and alter_table_flags from handler class
A couple of new and changed method headers
sql/ha_ndbcluster_binlog.cc:
Use new method headers
sql/ha_partition.cc:
New handlerton methods
Lots of new function headers
Use #P# as separator between table name and partition name and
#SP# as separator between partition name and subpartition name
Use filename encoding for files both of table name part and of
partition name parts
New method to drop partitions based on partition state
New method to rename partitions based on partition state
New methods to optimize, analyze, check and repair partitions
New methods to optimize, analyze, check and repair table
Helper method to create new partition, open it and external lock
it, not needed to lock it internally since no one else knows about
it yet.
Cleanup method at error for new partitions
New methods to perform bulk of work at ADD/REORGANIZE partitions
(change_partitions, copy_partitions)
sql/ha_partition.h:
New methods and variables
A few dropped ones and a few changed ones
sql/handler.cc:
Handlerton interface changes
New flag to open_table_from_share
sql/handler.h:
New alter_table_flags
New partition flags
New partition states
More states for default handling
Lots of new, dropped and changed interfaces
sql/lex.h:
Added REBUILD and changed name of REORGANISE to REORGANIZE
sql/lock.cc:
Method to downgrade locks
Able to specify if locks upgraded on abort locks
sql/log.cc:
New handlerton methods
sql/mysql_priv.h:
Lots of new interfaces
sql/share/errmsg.txt:
Lots of new, dropped and changed error messages
sql/sql_base.cc:
Adapted to new method headers
New method to abort and upgrade lock
New method to close open tables and downgrade lock
New method to wait for completed table
sql/sql_lex.h:
New flags
sql/sql_partition.cc:
Return int instead of bool in get_partition_id
More defaults handling
Make use of new mem_alloc_error method
More work on function headers
Changes to generate partition syntax to cater for intermediate
partition states
Lots of new code with large comments describing new features for
Partition Management:
ADD/DROP/REORGANIZE/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
sql/sql_show.cc:
Minors
sql/sql_table.cc:
Moved a couple of methods
New methods to copy create lists and key lists
for use with mysql_prepare_table
New method to write frm file
New handling of handlers with auto partitioning
Fix CREATE TABLE LIKE
Moved code for ADD/DROP/REORGANIZE partitions
Use handlerton method for alter_table_flags
sql/sql_yacc.yy:
More memory alloc error checks
New syntax for REBUILD, ANALYZE, CHECK, OPTIMIZE, REPAIR partitions
sql/table.cc:
Fix length of extra part to be 4 bytes
Partition state introduced in frm file
sql/table.h:
Partition state introduced
sql/unireg.cc:
Partition state introduced
Default partition
storage/csv/ha_tina.cc:
New handlerton methods
storage/example/ha_example.cc:
New handlerton methods
storage/ndb/include/kernel/ndb_limits.h:
RANGE DATA
storage/ndb/include/kernel/signaldata/AlterTable.hpp:
New interfaces in ALTER TABLE towards NDB kernel
storage/ndb/include/kernel/signaldata/DiAddTab.hpp:
New section
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
Lots of new parts of table description
storage/ndb/include/kernel/signaldata/LqhFrag.hpp:
tablespace id specified in LQHFRAGREQ
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Lots of new methods in NDB dictionary
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Lots of new variables in table description
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
New error insertion
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
a few extra jam's
storage/ndb/src/ndbapi/NdbBlob.cpp:
Changes to definition of blob tables
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Lots of new stuff in NDB dictionary
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Lots of new stuff in NDB dictionary
storage/ndb/test/ndbapi/test_event.cpp:
removed use of methods no longer in existence
storage/ndb/tools/restore/Restore.cpp:
Renamed variable
2006-01-17 08:40:00 +01:00
|
|
|
Uint32 TablespaceDataLen;
|
|
|
|
Uint32 TablespaceData[2*MAX_NDB_PARTITIONS];
|
|
|
|
Uint32 RangeListDataLen;
|
|
|
|
char RangeListData[4*2*MAX_NDB_PARTITIONS*2];
|
2005-01-10 14:40:54 +01:00
|
|
|
|
2006-01-11 11:35:25 +01:00
|
|
|
Uint32 RowGCIFlag;
|
|
|
|
Uint32 RowChecksumFlag;
|
|
|
|
|
2006-03-29 17:04:00 +03:00
|
|
|
Table() {}
|
2004-04-14 10:53:21 +02:00
|
|
|
void init();
|
|
|
|
};
|
|
|
|
|
|
|
|
static const
|
|
|
|
SimpleProperties::SP2StructMapping TableMapping[];
|
|
|
|
|
|
|
|
static const Uint32 TableMappingSize;
|
|
|
|
|
|
|
|
// AttributeExtType values
|
|
|
|
enum ExtType {
|
|
|
|
ExtUndefined = NdbSqlUtil::Type::Undefined,
|
|
|
|
ExtTinyint = NdbSqlUtil::Type::Tinyint,
|
|
|
|
ExtTinyunsigned = NdbSqlUtil::Type::Tinyunsigned,
|
|
|
|
ExtSmallint = NdbSqlUtil::Type::Smallint,
|
|
|
|
ExtSmallunsigned = NdbSqlUtil::Type::Smallunsigned,
|
|
|
|
ExtMediumint = NdbSqlUtil::Type::Mediumint,
|
|
|
|
ExtMediumunsigned = NdbSqlUtil::Type::Mediumunsigned,
|
|
|
|
ExtInt = NdbSqlUtil::Type::Int,
|
|
|
|
ExtUnsigned = NdbSqlUtil::Type::Unsigned,
|
|
|
|
ExtBigint = NdbSqlUtil::Type::Bigint,
|
|
|
|
ExtBigunsigned = NdbSqlUtil::Type::Bigunsigned,
|
|
|
|
ExtFloat = NdbSqlUtil::Type::Float,
|
|
|
|
ExtDouble = NdbSqlUtil::Type::Double,
|
2005-02-16 12:45:59 +01:00
|
|
|
ExtOlddecimal = NdbSqlUtil::Type::Olddecimal,
|
|
|
|
ExtOlddecimalunsigned = NdbSqlUtil::Type::Olddecimalunsigned,
|
2005-02-16 21:19:42 +01:00
|
|
|
ExtDecimal = NdbSqlUtil::Type::Decimal,
|
|
|
|
ExtDecimalunsigned = NdbSqlUtil::Type::Decimalunsigned,
|
2004-04-14 10:53:21 +02:00
|
|
|
ExtChar = NdbSqlUtil::Type::Char,
|
|
|
|
ExtVarchar = NdbSqlUtil::Type::Varchar,
|
|
|
|
ExtBinary = NdbSqlUtil::Type::Binary,
|
|
|
|
ExtVarbinary = NdbSqlUtil::Type::Varbinary,
|
|
|
|
ExtDatetime = NdbSqlUtil::Type::Datetime,
|
2005-01-08 16:57:51 +01:00
|
|
|
ExtDate = NdbSqlUtil::Type::Date,
|
2004-06-10 12:04:30 +02:00
|
|
|
ExtBlob = NdbSqlUtil::Type::Blob,
|
2004-12-05 19:48:15 +01:00
|
|
|
ExtText = NdbSqlUtil::Type::Text,
|
2005-01-07 11:55:20 +01:00
|
|
|
ExtBit = NdbSqlUtil::Type::Bit,
|
|
|
|
ExtLongvarchar = NdbSqlUtil::Type::Longvarchar,
|
2005-01-09 00:45:06 +01:00
|
|
|
ExtLongvarbinary = NdbSqlUtil::Type::Longvarbinary,
|
2005-01-27 17:33:35 +01:00
|
|
|
ExtTime = NdbSqlUtil::Type::Time,
|
|
|
|
ExtYear = NdbSqlUtil::Type::Year,
|
|
|
|
ExtTimestamp = NdbSqlUtil::Type::Timestamp
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Attribute data interpretation
|
|
|
|
struct Attribute {
|
|
|
|
char AttributeName[MAX_TAB_NAME_SIZE];
|
|
|
|
Uint32 AttributeId;
|
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
|
|
|
Uint32 AttributeType; // for osu 4.1->5.0.x
|
2004-04-14 10:53:21 +02:00
|
|
|
Uint32 AttributeSize;
|
|
|
|
Uint32 AttributeArraySize;
|
2005-11-07 12:19:28 +01:00
|
|
|
Uint32 AttributeArrayType;
|
2004-04-14 10:53:21 +02:00
|
|
|
Uint32 AttributeKeyFlag;
|
|
|
|
Uint32 AttributeNullableFlag;
|
|
|
|
Uint32 AttributeDKey;
|
|
|
|
Uint32 AttributeExtType;
|
|
|
|
Uint32 AttributeExtPrecision;
|
|
|
|
Uint32 AttributeExtScale;
|
|
|
|
Uint32 AttributeExtLength;
|
|
|
|
Uint32 AttributeAutoIncrement;
|
2005-11-07 12:19:28 +01:00
|
|
|
Uint32 AttributeStorageType;
|
2004-04-14 10:53:21 +02:00
|
|
|
char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE];
|
|
|
|
|
2006-03-29 17:04:00 +03:00
|
|
|
Attribute() {}
|
2004-04-14 10:53:21 +02:00
|
|
|
void init();
|
|
|
|
|
|
|
|
inline
|
|
|
|
Uint32 sizeInWords()
|
|
|
|
{
|
|
|
|
return ((1 << AttributeSize) * AttributeArraySize + 31) >> 5;
|
|
|
|
}
|
|
|
|
|
2005-01-07 11:55:20 +01:00
|
|
|
// compute old-sty|e attribute size and array size
|
2004-04-14 10:53:21 +02:00
|
|
|
inline bool
|
|
|
|
translateExtType() {
|
|
|
|
switch (AttributeExtType) {
|
|
|
|
case DictTabInfo::ExtUndefined:
|
2005-01-07 11:55:20 +01:00
|
|
|
return false;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtTinyint:
|
|
|
|
case DictTabInfo::ExtTinyunsigned:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtSmallint:
|
|
|
|
case DictTabInfo::ExtSmallunsigned:
|
|
|
|
AttributeSize = DictTabInfo::a16Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtMediumint:
|
|
|
|
case DictTabInfo::ExtMediumunsigned:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = 3 * AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtInt:
|
|
|
|
case DictTabInfo::ExtUnsigned:
|
|
|
|
AttributeSize = DictTabInfo::a32Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtBigint:
|
|
|
|
case DictTabInfo::ExtBigunsigned:
|
|
|
|
AttributeSize = DictTabInfo::a64Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtFloat:
|
|
|
|
AttributeSize = DictTabInfo::a32Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtDouble:
|
|
|
|
AttributeSize = DictTabInfo::a64Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2005-02-16 12:45:59 +01:00
|
|
|
case DictTabInfo::ExtOlddecimal:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize =
|
|
|
|
(1 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) *
|
|
|
|
AttributeExtLength;
|
2005-02-16 13:14:21 +01:00
|
|
|
break;
|
2005-02-16 12:45:59 +01:00
|
|
|
case DictTabInfo::ExtOlddecimalunsigned:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize =
|
|
|
|
(0 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) *
|
|
|
|
AttributeExtLength;
|
2005-02-16 13:14:21 +01:00
|
|
|
break;
|
2005-02-16 21:19:42 +01:00
|
|
|
case DictTabInfo::ExtDecimal:
|
|
|
|
case DictTabInfo::ExtDecimalunsigned:
|
|
|
|
{
|
|
|
|
// copy from Field_new_decimal ctor
|
|
|
|
uint precision = AttributeExtPrecision;
|
|
|
|
uint scale = AttributeExtScale;
|
|
|
|
if (precision > DECIMAL_MAX_LENGTH || scale >= NOT_FIXED_DEC)
|
|
|
|
precision = DECIMAL_MAX_LENGTH;
|
|
|
|
uint bin_size = my_decimal_get_binary_size(precision, scale);
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = bin_size * AttributeExtLength;
|
|
|
|
}
|
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtChar:
|
|
|
|
case DictTabInfo::ExtBinary:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtVarchar:
|
|
|
|
case DictTabInfo::ExtVarbinary:
|
2005-01-07 11:55:20 +01:00
|
|
|
if (AttributeExtLength > 0xff)
|
|
|
|
return false;
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
2005-01-07 11:55:20 +01:00
|
|
|
AttributeArraySize = AttributeExtLength + 1;
|
|
|
|
break;
|
2004-04-14 10:53:21 +02:00
|
|
|
case DictTabInfo::ExtDatetime:
|
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
|
|
|
// to fix
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = 8 * AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2005-01-08 16:57:51 +01:00
|
|
|
case DictTabInfo::ExtDate:
|
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
|
|
|
// to fix
|
2004-04-14 10:53:21 +02:00
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
2005-01-08 16:57:51 +01:00
|
|
|
AttributeArraySize = 3 * AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-06-10 12:04:30 +02:00
|
|
|
case DictTabInfo::ExtBlob:
|
2004-07-22 12:33:14 +02:00
|
|
|
case DictTabInfo::ExtText:
|
2004-06-10 12:04:30 +02:00
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
2005-01-07 11:55:20 +01:00
|
|
|
// head + inline part (length in precision lower half)
|
2004-09-15 17:44:13 +02:00
|
|
|
AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + (AttributeExtPrecision & 0xFFFF);
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
2004-12-05 19:48:15 +01:00
|
|
|
case DictTabInfo::ExtBit:
|
|
|
|
AttributeSize = DictTabInfo::aBit;
|
|
|
|
AttributeArraySize = AttributeExtLength;
|
2005-01-07 11:55:20 +01:00
|
|
|
break;
|
|
|
|
case DictTabInfo::ExtLongvarchar:
|
|
|
|
case DictTabInfo::ExtLongvarbinary:
|
|
|
|
if (AttributeExtLength > 0xffff)
|
|
|
|
return false;
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = AttributeExtLength + 2;
|
|
|
|
break;
|
2005-01-09 00:45:06 +01:00
|
|
|
case DictTabInfo::ExtTime:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = 3 * AttributeExtLength;
|
|
|
|
break;
|
2005-01-27 17:33:35 +01:00
|
|
|
case DictTabInfo::ExtYear:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = 1 * AttributeExtLength;
|
2005-01-27 18:41:23 +01:00
|
|
|
break;
|
2005-01-27 17:33:35 +01:00
|
|
|
case DictTabInfo::ExtTimestamp:
|
|
|
|
AttributeSize = DictTabInfo::an8Bit;
|
|
|
|
AttributeArraySize = 4 * AttributeExtLength;
|
2005-01-27 18:41:23 +01:00
|
|
|
break;
|
2005-01-07 11:55:20 +01:00
|
|
|
default:
|
|
|
|
return false;
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
2005-01-07 11:55:20 +01:00
|
|
|
return true;
|
2004-04-14 10:53:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void print(FILE *out) {
|
|
|
|
fprintf(out, "AttributeId = %d\n", AttributeId);
|
|
|
|
fprintf(out, "AttributeType = %d\n", AttributeType);
|
|
|
|
fprintf(out, "AttributeSize = %d\n", AttributeSize);
|
|
|
|
fprintf(out, "AttributeArraySize = %d\n", AttributeArraySize);
|
2005-11-07 12:19:28 +01:00
|
|
|
fprintf(out, "AttributeArrayType = %d\n", AttributeArrayType);
|
2004-04-14 10:53:21 +02:00
|
|
|
fprintf(out, "AttributeKeyFlag = %d\n", AttributeKeyFlag);
|
2005-11-07 12:19:28 +01:00
|
|
|
fprintf(out, "AttributeStorageType = %d\n", AttributeStorageType);
|
2004-04-14 10:53:21 +02:00
|
|
|
fprintf(out, "AttributeNullableFlag = %d\n", AttributeNullableFlag);
|
|
|
|
fprintf(out, "AttributeDKey = %d\n", AttributeDKey);
|
|
|
|
fprintf(out, "AttributeGroup = %d\n", AttributeGroup);
|
|
|
|
fprintf(out, "AttributeAutoIncrement = %d\n", AttributeAutoIncrement);
|
|
|
|
fprintf(out, "AttributeExtType = %d\n", AttributeExtType);
|
|
|
|
fprintf(out, "AttributeExtPrecision = %d\n", AttributeExtPrecision);
|
|
|
|
fprintf(out, "AttributeExtScale = %d\n", AttributeExtScale);
|
|
|
|
fprintf(out, "AttributeExtLength = %d\n", AttributeExtLength);
|
|
|
|
fprintf(out, "AttributeDefaultValue = \"%s\"\n",
|
|
|
|
AttributeDefaultValue ? AttributeDefaultValue : "");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const
|
|
|
|
SimpleProperties::SP2StructMapping AttributeMapping[];
|
|
|
|
|
|
|
|
static const Uint32 AttributeMappingSize;
|
|
|
|
|
|
|
|
// Signal constants
|
|
|
|
STATIC_CONST( DataLength = 20 );
|
|
|
|
STATIC_CONST( HeaderLength = 5 );
|
|
|
|
|
|
|
|
private:
|
|
|
|
Uint32 senderRef;
|
|
|
|
Uint32 senderData;
|
|
|
|
Uint32 requestType;
|
|
|
|
Uint32 totalLen;
|
|
|
|
Uint32 offset;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Length of this data = signal->length() - HeaderLength
|
|
|
|
* Sender block ref = signal->senderBlockRef()
|
|
|
|
*/
|
|
|
|
|
|
|
|
Uint32 tabInfoData[DataLength];
|
2004-12-14 10:58:29 +01:00
|
|
|
|
|
|
|
public:
|
2005-11-07 12:19:28 +01:00
|
|
|
enum Depricated
|
2004-12-14 10:58:29 +01:00
|
|
|
{
|
|
|
|
AttributeDGroup = 1009, //Default NotDGroup
|
|
|
|
AttributeStoredInd = 1011, //Default NotStored
|
2005-11-07 12:19:28 +01:00
|
|
|
TableStorageVal = 14, //Disk storage specified per attribute
|
2004-12-14 10:58:29 +01:00
|
|
|
SecondTableId = 17, //Mandatory between DICT's otherwise not allowed
|
|
|
|
FragmentKeyTypeVal = 16 //Default PrimaryKey
|
|
|
|
};
|
2005-11-07 12:19:28 +01:00
|
|
|
|
|
|
|
enum Unimplemented
|
2004-12-14 10:58:29 +01:00
|
|
|
{
|
|
|
|
ScanOptimised = 15, //Default updateOptimised
|
2006-04-10 17:06:33 +02:00
|
|
|
AttributeGroup = 1012, //Default 0
|
|
|
|
FileNo = 102
|
2004-12-14 10:58:29 +01:00
|
|
|
};
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
2005-11-07 12:19:28 +01:00
|
|
|
#define DFGIMAP(x, y, z) \
|
|
|
|
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
|
|
|
|
|
|
|
|
#define DFGIMAP2(x, y, z, u, v) \
|
|
|
|
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
|
|
|
|
|
|
|
|
#define DFGIMAPS(x, y, z, u, v) \
|
|
|
|
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
|
|
|
|
|
|
|
|
#define DFGIMAPB(x, y, z, u, v, l) \
|
|
|
|
{ DictFilegroupInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
|
|
|
|
offsetof(x, l) }
|
|
|
|
|
|
|
|
#define DFGIBREAK(x) \
|
|
|
|
{ DictFilegroupInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 }
|
|
|
|
|
|
|
|
struct DictFilegroupInfo {
|
|
|
|
enum KeyValues {
|
|
|
|
FilegroupName = 1,
|
|
|
|
FilegroupType = 2,
|
|
|
|
FilegroupId = 3,
|
|
|
|
FilegroupVersion = 4,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* File parameters
|
|
|
|
*/
|
|
|
|
FileName = 100,
|
|
|
|
FileType = 101,
|
2006-04-10 17:06:33 +02:00
|
|
|
FileId = 103,
|
2005-11-07 12:19:28 +01:00
|
|
|
FileFGroupId = 104,
|
|
|
|
FileFGroupVersion = 105,
|
|
|
|
FileSizeHi = 106,
|
|
|
|
FileSizeLo = 107,
|
|
|
|
FileFreeExtents = 108,
|
2006-04-10 17:06:33 +02:00
|
|
|
FileVersion = 109,
|
2005-11-07 12:19:28 +01:00
|
|
|
FileEnd = 199, //
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tablespace parameters
|
|
|
|
*/
|
|
|
|
TS_ExtentSize = 1000, // specified in bytes
|
|
|
|
TS_LogfileGroupId = 1001,
|
|
|
|
TS_LogfileGroupVersion = 1002,
|
|
|
|
TS_GrowLimit = 1003, // In bytes
|
|
|
|
TS_GrowSizeHi = 1004,
|
|
|
|
TS_GrowSizeLo = 1005,
|
|
|
|
TS_GrowPattern = 1006,
|
|
|
|
TS_GrowMaxSize = 1007,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logfile group parameters
|
|
|
|
*/
|
|
|
|
LF_UndoBufferSize = 2005, // In bytes
|
|
|
|
LF_UndoGrowLimit = 2000, // In bytes
|
|
|
|
LF_UndoGrowSizeHi = 2001,
|
|
|
|
LF_UndoGrowSizeLo = 2002,
|
|
|
|
LF_UndoGrowPattern = 2003,
|
2006-01-11 11:35:25 +01:00
|
|
|
LF_UndoGrowMaxSize = 2004,
|
|
|
|
LF_UndoFreeWordsHi = 2006,
|
|
|
|
LF_UndoFreeWordsLo = 2007
|
2005-11-07 12:19:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// FragmentType constants
|
|
|
|
enum FileTypeValues {
|
|
|
|
Datafile = 0,
|
|
|
|
Undofile = 1
|
|
|
|
//, Redofile
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GrowSpec {
|
|
|
|
Uint32 GrowLimit;
|
|
|
|
Uint32 GrowSizeHi;
|
|
|
|
Uint32 GrowSizeLo;
|
|
|
|
char GrowPattern[PATH_MAX];
|
|
|
|
Uint32 GrowMaxSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Table data interpretation
|
|
|
|
struct Filegroup {
|
|
|
|
char FilegroupName[MAX_TAB_NAME_SIZE];
|
|
|
|
Uint32 FilegroupType; // ObjType
|
|
|
|
Uint32 FilegroupId;
|
|
|
|
Uint32 FilegroupVersion;
|
|
|
|
|
|
|
|
union {
|
|
|
|
Uint32 TS_ExtentSize;
|
|
|
|
Uint32 LF_UndoBufferSize;
|
|
|
|
};
|
|
|
|
Uint32 TS_LogfileGroupId;
|
|
|
|
Uint32 TS_LogfileGroupVersion;
|
|
|
|
union {
|
|
|
|
GrowSpec TS_DataGrow;
|
|
|
|
GrowSpec LF_UndoGrow;
|
|
|
|
};
|
|
|
|
//GrowSpec LF_RedoGrow;
|
2006-01-11 11:35:25 +01:00
|
|
|
Uint32 LF_UndoFreeWordsHi;
|
|
|
|
Uint32 LF_UndoFreeWordsLo;
|
2006-03-29 17:04:00 +03:00
|
|
|
Filegroup() {}
|
2005-11-07 12:19:28 +01:00
|
|
|
void init();
|
|
|
|
};
|
|
|
|
static const Uint32 MappingSize;
|
|
|
|
static const SimpleProperties::SP2StructMapping Mapping[];
|
|
|
|
|
|
|
|
struct File {
|
|
|
|
char FileName[PATH_MAX];
|
|
|
|
Uint32 FileType;
|
|
|
|
Uint32 FileId;
|
2006-04-10 17:06:33 +02:00
|
|
|
Uint32 FileVersion;
|
2005-11-07 12:19:28 +01:00
|
|
|
Uint32 FilegroupId;
|
|
|
|
Uint32 FilegroupVersion;
|
|
|
|
Uint32 FileSizeHi;
|
|
|
|
Uint32 FileSizeLo;
|
|
|
|
Uint32 FileFreeExtents;
|
2006-03-29 17:04:00 +03:00
|
|
|
|
|
|
|
File() {}
|
2005-11-07 12:19:28 +01:00
|
|
|
void init();
|
|
|
|
};
|
|
|
|
static const Uint32 FileMappingSize;
|
|
|
|
static const SimpleProperties::SP2StructMapping FileMapping[];
|
|
|
|
};
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
#endif
|