From 51cff67d08222d6c2909b4d373f5a406560a3a10 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 11:19:51 +0000 Subject: [PATCH] added test for max limit of 128 attributes in table new define for long signal section size bumbed up limit for attributes to 128 use new define in SectionSegment some bug fixing of send fragmented signal + make chunk size a multiple the dew define for SectionSegment size mysql-test/r/ndb_basic.result: added test for max limit of 128 attributes in table mysql-test/t/ndb_basic.test: added test for max limit of 128 attributes in table ndb/include/kernel/ndb_limits.h: new define for long signal section size ndb/include/ndbapi/ndbapi_limits.h: bumbed up limit for attributes to 128 ndb/src/kernel/vm/LongSignal.hpp: use new define in SectionSegment ndb/src/ndbapi/TransporterFacade.cpp: some bug fixing of send fragmented signal + make chunk size a multiple the dew define for SectionSegment size --- mysql-test/r/ndb_basic.result | 131 ++++++++++++++++++++++++++ mysql-test/t/ndb_basic.test | 136 +++++++++++++++++++++++++++ ndb/include/kernel/ndb_limits.h | 5 + ndb/include/ndbapi/ndbapi_limits.h | 2 +- ndb/src/kernel/vm/LongSignal.hpp | 2 +- ndb/src/ndbapi/TransporterFacade.cpp | 64 +++++++------ 6 files changed, 311 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index abe1b98b536..37083beac89 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -414,3 +414,134 @@ select * from t1 where b IS NOT NULL; a b 1 drop table t1; +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +c9 int, +c10 int, +c11 int, +c12 int, +c13 int, +c14 int, +c15 int, +c16 int, +c17 int, +c18 int, +c19 int, +c20 int, +c21 int, +c22 int, +c23 int, +c24 int, +c25 int, +c26 int, +c27 int, +c28 int, +c29 int, +c30 int, +c31 int, +c32 int, +c33 int, +c34 int, +c35 int, +c36 int, +c37 int, +c38 int, +c39 int, +c40 int, +c41 int, +c42 int, +c43 int, +c44 int, +c45 int, +c46 int, +c47 int, +c48 int, +c49 int, +c50 int, +c51 int, +c52 int, +c53 int, +c54 int, +c55 int, +c56 int, +c57 int, +c58 int, +c59 int, +c60 int, +c61 int, +c62 int, +c63 int, +c64 int, +c65 int, +c66 int, +c67 int, +c68 int, +c69 int, +c70 int, +c71 int, +c72 int, +c73 int, +c74 int, +c75 int, +c76 int, +c77 int, +c78 int, +c79 int, +c80 int, +c81 int, +c82 int, +c83 int, +c84 int, +c85 int, +c86 int, +c87 int, +c88 int, +c89 int, +c90 int, +c91 int, +c92 int, +c93 int, +c94 int, +c95 int, +c96 int, +c97 int, +c98 int, +c99 int, +c100 int, +c101 int, +c102 int, +c103 int, +c104 int, +c105 int, +c106 int, +c107 int, +c108 int, +c109 int, +c110 int, +c111 int, +c112 int, +c113 int, +c114 int, +c115 int, +c116 int, +c117 int, +c118 int, +c119 int, +c120 int, +c121 int, +c122 int, +c123 int, +c124 int, +c125 int, +c126 int, +c127 int, +c128 int, +primary key(c1)) engine=ndb; +drop table t1; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index e79815bbeb1..0d4bffce80d 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -371,3 +371,139 @@ select * from t1 order by b; select * from t1 where b IS NULL; select * from t1 where b IS NOT NULL; drop table t1; + +# +# test the limit of no of attributes in one table +# + +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +c9 int, +c10 int, +c11 int, +c12 int, +c13 int, +c14 int, +c15 int, +c16 int, +c17 int, +c18 int, +c19 int, +c20 int, +c21 int, +c22 int, +c23 int, +c24 int, +c25 int, +c26 int, +c27 int, +c28 int, +c29 int, +c30 int, +c31 int, +c32 int, +c33 int, +c34 int, +c35 int, +c36 int, +c37 int, +c38 int, +c39 int, +c40 int, +c41 int, +c42 int, +c43 int, +c44 int, +c45 int, +c46 int, +c47 int, +c48 int, +c49 int, +c50 int, +c51 int, +c52 int, +c53 int, +c54 int, +c55 int, +c56 int, +c57 int, +c58 int, +c59 int, +c60 int, +c61 int, +c62 int, +c63 int, +c64 int, +c65 int, +c66 int, +c67 int, +c68 int, +c69 int, +c70 int, +c71 int, +c72 int, +c73 int, +c74 int, +c75 int, +c76 int, +c77 int, +c78 int, +c79 int, +c80 int, +c81 int, +c82 int, +c83 int, +c84 int, +c85 int, +c86 int, +c87 int, +c88 int, +c89 int, +c90 int, +c91 int, +c92 int, +c93 int, +c94 int, +c95 int, +c96 int, +c97 int, +c98 int, +c99 int, +c100 int, +c101 int, +c102 int, +c103 int, +c104 int, +c105 int, +c106 int, +c107 int, +c108 int, +c109 int, +c110 int, +c111 int, +c112 int, +c113 int, +c114 int, +c115 int, +c116 int, +c117 int, +c118 int, +c119 int, +c120 int, +c121 int, +c122 int, +c123 int, +c124 int, +c125 int, +c126 int, +c127 int, +c128 int, +primary key(c1)) engine=ndb; +drop table t1; diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h index 88fcff22da7..48a56c019bb 100644 --- a/ndb/include/kernel/ndb_limits.h +++ b/ndb/include/kernel/ndb_limits.h @@ -117,4 +117,9 @@ */ #define NDB_BLOB_HEAD_SIZE 2 /* sizeof(NdbBlob::Head) >> 2 */ +/* + * Long signals + */ +#define NDB_SECTION_SEGMENT_SZ 60 + #endif diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 1cf2d9b342d..6b8787d587d 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -22,7 +22,7 @@ #define NDB_MAX_DATABASE_NAME_SIZE 128 #define NDB_MAX_SCHEMA_NAME_SIZE 128 #define NDB_MAX_TAB_NAME_SIZE 128 -#define NDB_MAX_ATTRIBUTES_IN_TABLE 91 +#define NDB_MAX_ATTRIBUTES_IN_TABLE 128 #define NDB_MAX_TUPLE_SIZE_IN_WORDS 1023 #define NDB_MAX_KEYSIZE_IN_WORDS 1023 diff --git a/ndb/src/kernel/vm/LongSignal.hpp b/ndb/src/kernel/vm/LongSignal.hpp index f9ed443d995..9818358011f 100644 --- a/ndb/src/kernel/vm/LongSignal.hpp +++ b/ndb/src/kernel/vm/LongSignal.hpp @@ -25,7 +25,7 @@ */ struct SectionSegment { - STATIC_CONST( DataLength = 60 ); + STATIC_CONST( DataLength = NDB_SECTION_SEGMENT_SZ ); Uint32 m_ownerRef; Uint32 m_sz; diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 0377cf0c84b..6495fee444a 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -34,6 +34,7 @@ #include #include #include +#include //#define REPORT_TRANSPORTER //#define API_TRACE; @@ -834,10 +835,14 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){ return (ss == SEND_OK ? 0 : -1); } -#define CHUNK_SZ 100u +#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*1 int TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, - LinearSectionPtr ptr[3], Uint32 secs){ + LinearSectionPtr ptr[3], Uint32 secs) +{ + if(getIsNodeSendable(aNode) != true) + return -1; + NdbApiSignal tmp_signal(*(SignalHeader*)aSignal); LinearSectionPtr tmp_ptr[3]; Uint32 unique_id= m_fragmented_signal_id++; // next unique id @@ -855,41 +860,47 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, if (chunk_sz + save_sz > CHUNK_SZ) { // truncate unsigned send_sz= CHUNK_SZ - chunk_sz; + if (i != start_i) // first piece of a new section has to be a multiple of NDB_SECTION_SEGMENT_SZ + { + send_sz= + NDB_SECTION_SEGMENT_SZ + *(send_sz+NDB_SECTION_SEGMENT_SZ-1) + /NDB_SECTION_SEGMENT_SZ; + if (send_sz > save_sz) + send_sz= save_sz; + } tmp_ptr[i].sz= send_sz; - if (fragment_info < 2) + + if (fragment_info < 2) // 1 = first fragment, 2 = middle fragments fragment_info++; // send tmp_signal tmp_data[i-start_i+1]= unique_id; tmp_signal.setLength(i-start_i+2); tmp_signal.m_fragmentInfo= fragment_info; + tmp_signal.m_noOfSections= i-start_i+1; // do prepare send { - int ret; - if(getIsNodeSendable(aNode) == true){ - SendStatus ss = theTransporterRegistry->prepareSend - (&tmp_signal, - 1, // JBB - tmp_signal.getDataPtrSend(), - aNode, - &ptr[start_i]); - assert(ss != SEND_MESSAGE_TOO_BIG); - ret = (ss == SEND_OK ? 0 : -1); - } else - ret = -1; - if (ret != SEND_OK) - return ret; + SendStatus ss = theTransporterRegistry->prepareSend + (&tmp_signal, + 1, /*JBB*/ + tmp_data, + aNode, + &tmp_ptr[start_i]); + assert(ss != SEND_MESSAGE_TOO_BIG); + if (ss != SEND_OK) return -1; } - // setup variables for next signal start_i= i; chunk_sz= 0; tmp_ptr[i].sz= save_sz-send_sz; tmp_ptr[i].p+= send_sz; + if (tmp_ptr[i].sz == 0) + i++; } else { - chunk_sz+= save_sz; + chunk_sz+=save_sz; i++; } } @@ -907,7 +918,7 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, aSignal->setLength(a_sz+tmp_sz+1); // send last fragment - aSignal->m_fragmentInfo= 3; + aSignal->m_fragmentInfo= 3; // 3 = last fragment aSignal->m_noOfSections= i-start_i; } else { aSignal->m_noOfSections= secs; @@ -915,17 +926,16 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, // send aSignal int ret; - if(getIsNodeSendable(aNode) == true){ + { SendStatus ss = theTransporterRegistry->prepareSend - (aSignal, - 1, // JBB + (aSignal, + 1/*JBB*/, aSignal->getDataPtrSend(), - aNode, - &ptr[start_i]); + aNode, + &tmp_ptr[start_i]); assert(ss != SEND_MESSAGE_TOO_BIG); ret = (ss == SEND_OK ? 0 : -1); - } else - ret = -1; + } aSignal->m_noOfSections = 0; aSignal->m_fragmentInfo = 0; aSignal->setLength(a_sz);