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 NDB_LIMITS_H
|
|
|
|
#define NDB_LIMITS_H
|
|
|
|
|
BUG#9626
- Fix valgrind warnings
- Remove static db, schema and table name buffers from Ndb.cpp
mysys/thr_alarm.c:
Initialise sact to zero
ndb/include/kernel/ndb_limits.h:
Set MAX_ATTR_NAME_SIZE to NAME_LEN which is tha maximum in MySQL
ndb/include/kernel/signaldata/GetTabInfo.hpp:
Clean up
ndb/include/ndbapi/Ndb.hpp:
Remove NDB_MAX_INTERNAL_NAME_LENGTH and all char buffers for schema, db and tablename.
Made them dynamic and moved to NdbImpl.hpp
ndb/include/ndbapi/ndbapi_limits.h:
Remove the static length's of attr, db, schema and table name.
ndb/src/common/transporter/Packer.cpp:
Set theSignalId to ~0 when unpacking signal
ndb/src/ndbapi/Ndb.cpp:
Moved schema, database and tablename to NdbImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Add NdbIndexImpl::init and NdbEventImpl::init
Init all vars in NdbIndexImpl, NdbEventImpl, NdbTableImpl and NdbIndexImpl
Delete the pseudo column NDB$RANGE_NO
Copy tablename to internal buff in NdbDictInterface to get proper alignment.
Convert length of table name from bytes words, when setting sz of LinearSectionPtr
Set LinearSectionPtr array size to number of LinearSections used - save some stack.
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Add NdbEventImpl::init and NdbIndexImpl::init
Remove clearNewProperties and copyNewProperties, it's easier to check if all vars are initied if it's done in the same func.
Add buffer for tabname ti NdbDictInterface, memset it to 0 in initializer.
ndb/src/ndbapi/NdbImpl.hpp:
Use BaseString for table, schema and db names.
ndb/src/ndbapi/Ndbinit.cpp:
Move schema and db name to NdbImpl and use BaseString
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Destroy ndb_global_event_buffer_mutex and ndb_print_state_mutex
sql/ha_ndbcluster.cc:
Check if pTrans is not null before calling closeTransaction
Remove NDB_MAX_ATTR_NAME_SIZE
Remove truncation of attr names. When attr name length is same in NDB as in MySQL this will be checked in functin check_column_name
2005-05-18 20:50:29 +02:00
|
|
|
#include <mysql.h>
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
#define RNIL 0xffffff00
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Note that actual value = MAX_NODES - 1,
|
|
|
|
* since NodeId = 0 can not be used
|
|
|
|
*/
|
|
|
|
#define MAX_NDB_NODES 49
|
|
|
|
#define MAX_NODES 64
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MAX_API_NODES = MAX_NODES - No of NDB Nodes in use
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of replicas in the system
|
|
|
|
*/
|
|
|
|
#define MAX_REPLICAS 4
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of local checkpoints stored at a time
|
|
|
|
*/
|
|
|
|
#define MAX_LCP_STORED 3
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of log execution rounds at system restart
|
|
|
|
*/
|
|
|
|
#define MAX_LOG_EXEC 4
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of tuples per page
|
|
|
|
**/
|
|
|
|
#define MAX_TUPLES_PER_PAGE 8191
|
|
|
|
#define MAX_TUPLES_BITS 13 /* 13 bits = 8191 tuples per page */
|
2005-04-10 22:43:17 +02:00
|
|
|
#define MAX_TABLES 20320 /* SchemaFile.hpp */
|
2004-04-14 10:53:21 +02:00
|
|
|
#define MAX_TAB_NAME_SIZE 128
|
BUG#9626
- Fix valgrind warnings
- Remove static db, schema and table name buffers from Ndb.cpp
mysys/thr_alarm.c:
Initialise sact to zero
ndb/include/kernel/ndb_limits.h:
Set MAX_ATTR_NAME_SIZE to NAME_LEN which is tha maximum in MySQL
ndb/include/kernel/signaldata/GetTabInfo.hpp:
Clean up
ndb/include/ndbapi/Ndb.hpp:
Remove NDB_MAX_INTERNAL_NAME_LENGTH and all char buffers for schema, db and tablename.
Made them dynamic and moved to NdbImpl.hpp
ndb/include/ndbapi/ndbapi_limits.h:
Remove the static length's of attr, db, schema and table name.
ndb/src/common/transporter/Packer.cpp:
Set theSignalId to ~0 when unpacking signal
ndb/src/ndbapi/Ndb.cpp:
Moved schema, database and tablename to NdbImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Add NdbIndexImpl::init and NdbEventImpl::init
Init all vars in NdbIndexImpl, NdbEventImpl, NdbTableImpl and NdbIndexImpl
Delete the pseudo column NDB$RANGE_NO
Copy tablename to internal buff in NdbDictInterface to get proper alignment.
Convert length of table name from bytes words, when setting sz of LinearSectionPtr
Set LinearSectionPtr array size to number of LinearSections used - save some stack.
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Add NdbEventImpl::init and NdbIndexImpl::init
Remove clearNewProperties and copyNewProperties, it's easier to check if all vars are initied if it's done in the same func.
Add buffer for tabname ti NdbDictInterface, memset it to 0 in initializer.
ndb/src/ndbapi/NdbImpl.hpp:
Use BaseString for table, schema and db names.
ndb/src/ndbapi/Ndbinit.cpp:
Move schema and db name to NdbImpl and use BaseString
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Destroy ndb_global_event_buffer_mutex and ndb_print_state_mutex
sql/ha_ndbcluster.cc:
Check if pTrans is not null before calling closeTransaction
Remove NDB_MAX_ATTR_NAME_SIZE
Remove truncation of attr names. When attr name length is same in NDB as in MySQL this will be checked in functin check_column_name
2005-05-18 20:50:29 +02:00
|
|
|
#define MAX_ATTR_NAME_SIZE NAME_LEN /* From mysql_com.h */
|
2004-04-14 10:53:21 +02:00
|
|
|
#define MAX_ATTR_DEFAULT_VALUE_SIZE 128
|
|
|
|
#define MAX_ATTRIBUTES_IN_TABLE 128
|
|
|
|
#define MAX_ATTRIBUTES_IN_INDEX 32
|
|
|
|
#define MAX_TUPLE_SIZE_IN_WORDS 2013
|
|
|
|
#define MAX_KEY_SIZE_IN_WORDS 1023
|
|
|
|
#define MAX_FRM_DATA_SIZE 6000
|
2004-12-10 16:15:36 +01:00
|
|
|
#define MAX_NULL_BITS 4096
|
2005-01-10 14:40:54 +01:00
|
|
|
#define MAX_FRAGMENT_DATA_BYTES (4+(2 * 8 * MAX_REPLICAS * MAX_NDB_NODES))
|
2005-07-18 13:31:02 +02:00
|
|
|
#define MAX_NDB_PARTITIONS 1024
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
#define MIN_ATTRBUF ((MAX_ATTRIBUTES_IN_TABLE/24) + 1)
|
|
|
|
/*
|
2004-08-18 11:55:37 +02:00
|
|
|
* Max Number of Records to fetch per SCAN_NEXTREQ in a scan in LQH. The
|
2004-04-14 10:53:21 +02:00
|
|
|
* API can order a multiple of this number of records at a time since
|
|
|
|
* fragments can be scanned in parallel.
|
|
|
|
*/
|
2004-08-17 17:55:47 +02:00
|
|
|
#define MAX_PARALLEL_OP_PER_SCAN 992
|
2004-08-09 17:43:15 +02:00
|
|
|
/*
|
2004-08-18 11:55:37 +02:00
|
|
|
* The default batch size. Configurable parameter.
|
|
|
|
*/
|
|
|
|
#define DEF_BATCH_SIZE 64
|
|
|
|
/*
|
2004-08-09 17:43:15 +02:00
|
|
|
* When calculating the number of records sent from LQH in each batch
|
|
|
|
* one uses SCAN_BATCH_SIZE divided by the expected size of signals
|
|
|
|
* per row. This gives the batch size used for the scan. The NDB API
|
|
|
|
* will receive one batch from each node at a time so there has to be
|
|
|
|
* some care taken also so that the NDB API is not overloaded with
|
|
|
|
* signals.
|
2004-08-18 11:55:37 +02:00
|
|
|
* This parameter is configurable, this is the default value.
|
2004-08-09 17:43:15 +02:00
|
|
|
*/
|
|
|
|
#define SCAN_BATCH_SIZE 32768
|
|
|
|
/*
|
|
|
|
* To protect the NDB API from overload we also define a maximum total
|
|
|
|
* batch size from all nodes. This parameter should most likely be
|
|
|
|
* configurable, or dependent on sendBufferSize.
|
2004-08-18 11:55:37 +02:00
|
|
|
* This parameter is configurable, this is the default value.
|
2004-08-09 17:43:15 +02:00
|
|
|
*/
|
2004-08-11 17:36:31 +02:00
|
|
|
#define MAX_SCAN_BATCH_SIZE 262144
|
2004-04-14 10:53:21 +02:00
|
|
|
/*
|
|
|
|
* Maximum number of Parallel Scan queries on one hash index fragment
|
|
|
|
*/
|
|
|
|
#define MAX_PARALLEL_SCANS_PER_FRAG 12
|
|
|
|
/*
|
|
|
|
* Maximum parallel ordered index scans per primary table fragment.
|
|
|
|
* Implementation limit is (256 minus 12).
|
|
|
|
*/
|
|
|
|
#define MAX_PARALLEL_INDEX_SCANS_PER_FRAG 32
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Computed defines
|
|
|
|
*/
|
|
|
|
#define MAXNROFATTRIBUTESINWORDS (MAX_ATTRIBUTES_IN_TABLE / 32)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Ordered index constants. Make configurable per index later.
|
|
|
|
*/
|
2004-10-22 11:59:57 +00:00
|
|
|
#define MAX_TTREE_NODE_SIZE 64 /* total words in node */
|
|
|
|
#define MAX_TTREE_PREF_SIZE 4 /* words in min prefix */
|
|
|
|
#define MAX_TTREE_NODE_SLACK 2 /* diff between max and min occupancy */
|
2004-04-14 10:53:21 +02:00
|
|
|
|
2004-06-10 12:04:30 +02:00
|
|
|
/*
|
|
|
|
* Blobs.
|
|
|
|
*/
|
2004-10-22 11:59:57 +00:00
|
|
|
#define NDB_BLOB_HEAD_SIZE 2 /* sizeof(NdbBlob::Head) >> 2 */
|
2004-06-10 12:04:30 +02:00
|
|
|
|
2004-12-12 18:37:36 +01:00
|
|
|
/*
|
|
|
|
* Character sets.
|
|
|
|
*/
|
|
|
|
#define MAX_XFRM_MULTIPLY 8 /* max expansion when normalizing */
|
|
|
|
|
2004-10-28 11:19:51 +00:00
|
|
|
/*
|
|
|
|
* Long signals
|
|
|
|
*/
|
|
|
|
#define NDB_SECTION_SEGMENT_SZ 60
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
#endif
|