summaryrefslogtreecommitdiff
path: root/ndb/include
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-05-18 20:50:29 +0200
committerunknown <msvensson@neptunus.(none)>2005-05-18 20:50:29 +0200
commit446d4631c7ab899fb7caef68ff260fbc642a4698 (patch)
treef44bae30e5751da04802664f573f90c5cc101c55 /ndb/include
parent217b2c42ed12f319302bd11dabcb62c19a175977 (diff)
downloadmariadb-git-446d4631c7ab899fb7caef68ff260fbc642a4698.tar.gz
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
Diffstat (limited to 'ndb/include')
-rw-r--r--ndb/include/kernel/ndb_limits.h4
-rw-r--r--ndb/include/kernel/signaldata/GetTabInfo.hpp32
-rw-r--r--ndb/include/ndbapi/Ndb.hpp11
-rw-r--r--ndb/include/ndbapi/ndbapi_limits.h4
4 files changed, 16 insertions, 35 deletions
diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h
index 2646b54fa02..d91d30baf56 100644
--- a/ndb/include/kernel/ndb_limits.h
+++ b/ndb/include/kernel/ndb_limits.h
@@ -17,6 +17,8 @@
#ifndef NDB_LIMITS_H
#define NDB_LIMITS_H
+#include <mysql.h>
+
#define RNIL 0xffffff00
/**
@@ -52,7 +54,7 @@
#define MAX_TUPLES_BITS 13 /* 13 bits = 8191 tuples per page */
#define MAX_TABLES 1600
#define MAX_TAB_NAME_SIZE 128
-#define MAX_ATTR_NAME_SIZE 32
+#define MAX_ATTR_NAME_SIZE NAME_LEN /* From mysql_com.h */
#define MAX_ATTR_DEFAULT_VALUE_SIZE 128
#define MAX_ATTRIBUTES_IN_TABLE 128
#define MAX_ATTRIBUTES_IN_INDEX 32
diff --git a/ndb/include/kernel/signaldata/GetTabInfo.hpp b/ndb/include/kernel/signaldata/GetTabInfo.hpp
index cb6e38872d3..6b223cab119 100644
--- a/ndb/include/kernel/signaldata/GetTabInfo.hpp
+++ b/ndb/include/kernel/signaldata/GetTabInfo.hpp
@@ -39,23 +39,16 @@ class GetTabInfoReq {
friend bool printGET_TABINFO_REQ(FILE *, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 5 );
- // STATIC_CONST( MaxTableNameLengthInWords = 20 );
public:
- Uint32 senderData;
+ Uint32 senderData;
Uint32 senderRef;
-
- /**
- * 0 = request by id, 1 = request by name
- */
- Uint32 requestType;
-
+ Uint32 requestType; // Bitmask of GetTabInfoReq::RequestType
union {
- Uint32 tableId;
+ Uint32 tableId;
Uint32 tableNameLen;
};
Uint32 unused; // This is located here so that Req & Ref have the same format
- // Uint32 tableName[MaxTableNameLengthInWords];
-
+
enum RequestType {
RequestById = 0,
RequestByName = 1,
@@ -79,22 +72,21 @@ class GetTabInfoRef {
friend bool printGET_TABINFO_REF(FILE *, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 5 );
-
public:
- Uint32 senderData;
+ Uint32 senderData;
Uint32 senderRef;
- Uint32 requestType; // 0 = request by id, 1 = request by name
+ Uint32 requestType; // Bitmask of GetTabInfoReq::RequestType
union {
- Uint32 tableId;
+ Uint32 tableId;
Uint32 tableNameLen;
};
- Uint32 errorCode;
+ Uint32 errorCode;
enum ErrorCode {
- InvalidTableId = 709,
+ InvalidTableId = 709,
TableNotDefined = 723,
TableNameTooLong = 702,
- Busy = 701
+ Busy = 701
};
};
@@ -114,10 +106,10 @@ class GetTabInfoConf {
friend bool printGET_TABINFO_CONF(FILE *, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 4 );
-
+
SECTION( DICT_TAB_INFO = 0 );
public:
- Uint32 senderData;
+ Uint32 senderData;
Uint32 tableId;
Uint32 gci; // For table
Uint32 totalLen; // In words
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 41085e6e06a..a36cdc2b475 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -999,10 +999,6 @@ typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
#define WAITFOR_RESPONSE_TIMEOUT 120000 // Milliseconds
#endif
-#define NDB_MAX_INTERNAL_TABLE_LENGTH NDB_MAX_DATABASE_NAME_SIZE + \
- NDB_MAX_SCHEMA_NAME_SIZE + \
- NDB_MAX_TAB_NAME_SIZE*2
-
/**
* @class Ndb
* @brief Represents the NDB kernel and is the main class of the NDB API.
@@ -1626,12 +1622,7 @@ private:
bool fullyQualifiedNames;
- // Ndb database name.
- char theDataBase[NDB_MAX_DATABASE_NAME_SIZE];
- // Ndb database schema name.
- char theDataBaseSchema[NDB_MAX_SCHEMA_NAME_SIZE];
- char prefixName[NDB_MAX_INTERNAL_TABLE_LENGTH];
- char * prefixEnd;
+
class NdbImpl * theImpl;
class NdbDictionaryImpl* theDictionary;
diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h
index d1cb135b39d..5c4db71b747 100644
--- a/ndb/include/ndbapi/ndbapi_limits.h
+++ b/ndb/include/ndbapi/ndbapi_limits.h
@@ -19,10 +19,6 @@
#define NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY 32
#define NDB_MAX_ATTRIBUTES_IN_INDEX NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY
-#define NDB_MAX_DATABASE_NAME_SIZE 128
-#define NDB_MAX_SCHEMA_NAME_SIZE 128
-#define NDB_MAX_TAB_NAME_SIZE 128
-#define NDB_MAX_ATTR_NAME_SIZE 32
#define NDB_MAX_ATTRIBUTES_IN_TABLE 128
#define NDB_MAX_TUPLE_SIZE_IN_WORDS 2013