List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:May 3 2010 4:54am
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas:3588 to 3589)
View as plain text  
 3589 Jonas Oreland	2010-05-03 [merge]
      merge 70 to 71

    modified:
      mysql-test/suite/ndb/r/ndb_basic.result
      mysql-test/suite/ndb/t/ndb_basic.test
      storage/ndb/include/kernel/ndb_limits.h
      storage/ndb/include/kernel/signaldata/CreateEvnt.hpp
      storage/ndb/include/kernel/signaldata/CreateTrig.hpp
      storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp
      storage/ndb/include/ndbapi/ndbapi_limits.h
      storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp
      storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp
      storage/ndb/src/common/util/Bitmask.cpp
      storage/ndb/src/kernel/blocks/LocalProxy.cpp
      storage/ndb/src/kernel/blocks/LocalProxy.hpp
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp
      storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp
      storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
      storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbOperationExec.cpp
      storage/ndb/src/ndbapi/ndberror.c
 3588 Frazer Clement	2010-04-30 [merge]
      Merge 7.0->7.1

    modified:
      storage/ndb/src/ndbapi/NdbDictionary.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result	2010-03-23 08:41:15 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result	2010-05-03 04:49:08 +0000
@@ -600,7 +600,382 @@ c125 int,
 c126 int,
 c127 int,
 c128 int,
+c129 int,
+c130 int,
+c131 int,
+c132 int,
+c133 int,
+c134 int,
+c135 int,
+c136 int,
+c137 int,
+c138 int,
+c139 int,
+c140 int,
+c141 int,
+c142 int,
+c143 int,
+c144 int,
+c145 int,
+c146 int,
+c147 int,
+c148 int,
+c149 int,
+c150 int,
+c151 int,
+c152 int,
+c153 int,
+c154 int,
+c155 int,
+c156 int,
+c157 int,
+c158 int,
+c159 int,
+c160 int,
+c161 int,
+c162 int,
+c163 int,
+c164 int,
+c165 int,
+c166 int,
+c167 int,
+c168 int,
+c169 int,
+c170 int,
+c171 int,
+c172 int,
+c173 int,
+c174 int,
+c175 int,
+c176 int,
+c177 int,
+c178 int,
+c179 int,
+c180 int,
+c181 int,
+c182 int,
+c183 int,
+c184 int,
+c185 int,
+c186 int,
+c187 int,
+c188 int,
+c189 int,
+c190 int,
+c191 int,
+c192 int,
+c193 int,
+c194 int,
+c195 int,
+c196 int,
+c197 int,
+c198 int,
+c199 int,
+c200 int,
+c201 int,
+c202 int,
+c203 int,
+c204 int,
+c205 int,
+c206 int,
+c207 int,
+c208 int,
+c209 int,
+c210 int,
+c211 int,
+c212 int,
+c213 int,
+c214 int,
+c215 int,
+c216 int,
+c217 int,
+c218 int,
+c219 int,
+c220 int,
+c221 int,
+c222 int,
+c223 int,
+c224 int,
+c225 int,
+c226 int,
+c227 int,
+c228 int,
+c229 int,
+c230 int,
+c231 int,
+c232 int,
+c233 int,
+c234 int,
+c235 int,
+c236 int,
+c237 int,
+c238 int,
+c239 int,
+c240 int,
+c241 int,
+c242 int,
+c243 int,
+c244 int,
+c245 int,
+c246 int,
+c247 int,
+c248 int,
+c249 int,
+c250 int,
+c251 int,
+c252 int,
+c253 int,
+c254 int,
+c255 int,
+c256 int,
+c257 int,
+c258 int,
+c259 int,
+c260 int,
+c261 int,
+c262 int,
+c263 int,
+c264 int,
+c265 int,
+c266 int,
+c267 int,
+c268 int,
+c269 int,
+c270 int,
+c271 int,
+c272 int,
+c273 int,
+c274 int,
+c275 int,
+c276 int,
+c277 int,
+c278 int,
+c279 int,
+c280 int,
+c281 int,
+c282 int,
+c283 int,
+c284 int,
+c285 int,
+c286 int,
+c287 int,
+c288 int,
+c289 int,
+c290 int,
+c291 int,
+c292 int,
+c293 int,
+c294 int,
+c295 int,
+c296 int,
+c297 int,
+c298 int,
+c299 int,
+c300 int,
+c301 int,
+c302 int,
+c303 int,
+c304 int,
+c305 int,
+c306 int,
+c307 int,
+c308 int,
+c309 int,
+c310 int,
+c311 int,
+c312 int,
+c313 int,
+c314 int,
+c315 int,
+c316 int,
+c317 int,
+c318 int,
+c319 int,
+c320 int,
+c321 int,
+c322 int,
+c323 int,
+c324 int,
+c325 int,
+c326 int,
+c327 int,
+c328 int,
+c329 int,
+c330 int,
+c331 int,
+c332 int,
+c333 int,
+c334 int,
+c335 int,
+c336 int,
+c337 int,
+c338 int,
+c339 int,
+c340 int,
+c341 int,
+c342 int,
+c343 int,
+c344 int,
+c345 int,
+c346 int,
+c347 int,
+c348 int,
+c349 int,
+c350 int,
+c351 int,
+c352 int,
+c353 int,
+c354 int,
+c355 int,
+c356 int,
+c357 int,
+c358 int,
+c359 int,
+c360 int,
+c361 int,
+c362 int,
+c363 int,
+c364 int,
+c365 int,
+c366 int,
+c367 int,
+c368 int,
+c369 int,
+c370 int,
+c371 int,
+c372 int,
+c373 int,
+c374 int,
+c375 int,
+c376 int,
+c377 int,
+c378 int,
+c379 int,
+c380 int,
+c381 int,
+c382 int,
+c383 int,
+c384 int,
+c385 int,
+c386 int,
+c387 int,
+c388 int,
+c389 int,
+c390 int,
+c391 int,
+c392 int,
+c393 int,
+c394 int,
+c395 int,
+c396 int,
+c397 int,
+c398 int,
+c399 int,
+c400 int,
+c401 int,
+c402 int,
+c403 int,
+c404 int,
+c405 int,
+c406 int,
+c407 int,
+c408 int,
+c409 int,
+c410 int,
+c411 int,
+c412 int,
+c413 int,
+c414 int,
+c415 int,
+c416 int,
+c417 int,
+c418 int,
+c419 int,
+c420 int,
+c421 int,
+c422 int,
+c423 int,
+c424 int,
+c425 int,
+c426 int,
+c427 int,
+c428 int,
+c429 int,
+c430 int,
+c431 int,
+c432 int,
+c433 int,
+c434 int,
+c435 int,
+c436 int,
+c437 int,
+c438 int,
+c439 int,
+c440 int,
+c441 int,
+c442 int,
+c443 int,
+c444 int,
+c445 int,
+c446 int,
+c447 int,
+c448 int,
+c449 int,
+c450 int,
+c451 int,
+c452 int,
+c453 int,
+c454 int,
+c455 int,
+c456 int,
+c457 int,
+c458 int,
+c459 int,
+c460 int,
+c461 int,
+c462 int,
+c463 int,
+c464 int,
+c465 int,
+c466 int,
+c467 int,
+c468 int,
+c469 int,
+c470 int,
+c471 int,
+c472 int,
+c473 int,
+c474 int,
+c475 int,
+c476 int,
+c477 int,
+c478 int,
+c479 int,
+c480 int,
+c481 int,
+c482 int,
+c483 int,
+c484 int,
+c485 int,
+c486 int,
+c487 int,
+c488 int,
+c489 int,
+c490 int,
+c491 int,
+c492 int,
+c493 int,
+c494 int,
+c495 int,
+c496 int,
+c497 int,
+c498 int,
+c499 int,
 primary key using hash(c1)) engine=ndb partition by key(c1);
+insert into t1 (c1) values (1), (2), (3);
+alter offline table t1 modify c1 int auto_increment;
+alter online table t1 add column c500 bit(1) column_format DYNAMIC;
+delete from t1;
 drop table t1;
 create table t1 (
 a1234567890123456789012345678901234567890 int primary key,

=== modified file 'mysql-test/suite/ndb/t/ndb_basic.test'
--- a/mysql-test/suite/ndb/t/ndb_basic.test	2009-12-15 14:44:50 +0000
+++ b/mysql-test/suite/ndb/t/ndb_basic.test	2010-05-03 04:49:08 +0000
@@ -543,7 +543,383 @@ c125 int,
 c126 int,
 c127 int,
 c128 int,
+c129 int,
+c130 int,
+c131 int,
+c132 int,
+c133 int,
+c134 int,
+c135 int,
+c136 int,
+c137 int,
+c138 int,
+c139 int,
+c140 int,
+c141 int,
+c142 int,
+c143 int,
+c144 int,
+c145 int,
+c146 int,
+c147 int,
+c148 int,
+c149 int,
+c150 int,
+c151 int,
+c152 int,
+c153 int,
+c154 int,
+c155 int,
+c156 int,
+c157 int,
+c158 int,
+c159 int,
+c160 int,
+c161 int,
+c162 int,
+c163 int,
+c164 int,
+c165 int,
+c166 int,
+c167 int,
+c168 int,
+c169 int,
+c170 int,
+c171 int,
+c172 int,
+c173 int,
+c174 int,
+c175 int,
+c176 int,
+c177 int,
+c178 int,
+c179 int,
+c180 int,
+c181 int,
+c182 int,
+c183 int,
+c184 int,
+c185 int,
+c186 int,
+c187 int,
+c188 int,
+c189 int,
+c190 int,
+c191 int,
+c192 int,
+c193 int,
+c194 int,
+c195 int,
+c196 int,
+c197 int,
+c198 int,
+c199 int,
+c200 int,
+c201 int,
+c202 int,
+c203 int,
+c204 int,
+c205 int,
+c206 int,
+c207 int,
+c208 int,
+c209 int,
+c210 int,
+c211 int,
+c212 int,
+c213 int,
+c214 int,
+c215 int,
+c216 int,
+c217 int,
+c218 int,
+c219 int,
+c220 int,
+c221 int,
+c222 int,
+c223 int,
+c224 int,
+c225 int,
+c226 int,
+c227 int,
+c228 int,
+c229 int,
+c230 int,
+c231 int,
+c232 int,
+c233 int,
+c234 int,
+c235 int,
+c236 int,
+c237 int,
+c238 int,
+c239 int,
+c240 int,
+c241 int,
+c242 int,
+c243 int,
+c244 int,
+c245 int,
+c246 int,
+c247 int,
+c248 int,
+c249 int,
+c250 int,
+c251 int,
+c252 int,
+c253 int,
+c254 int,
+c255 int,
+c256 int,
+c257 int,
+c258 int,
+c259 int,
+c260 int,
+c261 int,
+c262 int,
+c263 int,
+c264 int,
+c265 int,
+c266 int,
+c267 int,
+c268 int,
+c269 int,
+c270 int,
+c271 int,
+c272 int,
+c273 int,
+c274 int,
+c275 int,
+c276 int,
+c277 int,
+c278 int,
+c279 int,
+c280 int,
+c281 int,
+c282 int,
+c283 int,
+c284 int,
+c285 int,
+c286 int,
+c287 int,
+c288 int,
+c289 int,
+c290 int,
+c291 int,
+c292 int,
+c293 int,
+c294 int,
+c295 int,
+c296 int,
+c297 int,
+c298 int,
+c299 int,
+c300 int,
+c301 int,
+c302 int,
+c303 int,
+c304 int,
+c305 int,
+c306 int,
+c307 int,
+c308 int,
+c309 int,
+c310 int,
+c311 int,
+c312 int,
+c313 int,
+c314 int,
+c315 int,
+c316 int,
+c317 int,
+c318 int,
+c319 int,
+c320 int,
+c321 int,
+c322 int,
+c323 int,
+c324 int,
+c325 int,
+c326 int,
+c327 int,
+c328 int,
+c329 int,
+c330 int,
+c331 int,
+c332 int,
+c333 int,
+c334 int,
+c335 int,
+c336 int,
+c337 int,
+c338 int,
+c339 int,
+c340 int,
+c341 int,
+c342 int,
+c343 int,
+c344 int,
+c345 int,
+c346 int,
+c347 int,
+c348 int,
+c349 int,
+c350 int,
+c351 int,
+c352 int,
+c353 int,
+c354 int,
+c355 int,
+c356 int,
+c357 int,
+c358 int,
+c359 int,
+c360 int,
+c361 int,
+c362 int,
+c363 int,
+c364 int,
+c365 int,
+c366 int,
+c367 int,
+c368 int,
+c369 int,
+c370 int,
+c371 int,
+c372 int,
+c373 int,
+c374 int,
+c375 int,
+c376 int,
+c377 int,
+c378 int,
+c379 int,
+c380 int,
+c381 int,
+c382 int,
+c383 int,
+c384 int,
+c385 int,
+c386 int,
+c387 int,
+c388 int,
+c389 int,
+c390 int,
+c391 int,
+c392 int,
+c393 int,
+c394 int,
+c395 int,
+c396 int,
+c397 int,
+c398 int,
+c399 int,
+c400 int,
+c401 int,
+c402 int,
+c403 int,
+c404 int,
+c405 int,
+c406 int,
+c407 int,
+c408 int,
+c409 int,
+c410 int,
+c411 int,
+c412 int,
+c413 int,
+c414 int,
+c415 int,
+c416 int,
+c417 int,
+c418 int,
+c419 int,
+c420 int,
+c421 int,
+c422 int,
+c423 int,
+c424 int,
+c425 int,
+c426 int,
+c427 int,
+c428 int,
+c429 int,
+c430 int,
+c431 int,
+c432 int,
+c433 int,
+c434 int,
+c435 int,
+c436 int,
+c437 int,
+c438 int,
+c439 int,
+c440 int,
+c441 int,
+c442 int,
+c443 int,
+c444 int,
+c445 int,
+c446 int,
+c447 int,
+c448 int,
+c449 int,
+c450 int,
+c451 int,
+c452 int,
+c453 int,
+c454 int,
+c455 int,
+c456 int,
+c457 int,
+c458 int,
+c459 int,
+c460 int,
+c461 int,
+c462 int,
+c463 int,
+c464 int,
+c465 int,
+c466 int,
+c467 int,
+c468 int,
+c469 int,
+c470 int,
+c471 int,
+c472 int,
+c473 int,
+c474 int,
+c475 int,
+c476 int,
+c477 int,
+c478 int,
+c479 int,
+c480 int,
+c481 int,
+c482 int,
+c483 int,
+c484 int,
+c485 int,
+c486 int,
+c487 int,
+c488 int,
+c489 int,
+c490 int,
+c491 int,
+c492 int,
+c493 int,
+c494 int,
+c495 int,
+c496 int,
+c497 int,
+c498 int,
+c499 int,
 primary key using hash(c1)) engine=ndb partition by key(c1);
+insert into t1 (c1) values (1), (2), (3);
+alter offline table t1 modify c1 int auto_increment;
+alter online table t1 add column c500 bit(1) column_format DYNAMIC;
+--source include/ndb_backup.inc
+delete from t1;
 drop table t1;
 
 #

=== modified file 'storage/ndb/include/kernel/ndb_limits.h'
--- a/storage/ndb/include/kernel/ndb_limits.h	2010-04-29 14:52:05 +0000
+++ b/storage/ndb/include/kernel/ndb_limits.h	2010-05-03 04:49:08 +0000
@@ -75,7 +75,7 @@
 #define MAX_TAB_NAME_SIZE 128
 #define MAX_ATTR_NAME_SIZE NAME_LEN       /* From mysql_com.h */
 #define MAX_ATTR_DEFAULT_VALUE_SIZE ((MAX_TUPLE_SIZE_IN_WORDS + 1) * 4)  //Add 1 word for AttributeHeader
-#define MAX_ATTRIBUTES_IN_TABLE 128
+#define MAX_ATTRIBUTES_IN_TABLE 512
 #define MAX_ATTRIBUTES_IN_INDEX 32
 #define MAX_TUPLE_SIZE_IN_WORDS 2013
 #define MAX_KEY_SIZE_IN_WORDS 1023
@@ -192,4 +192,14 @@
 
 #define NDB_FILE_BUFFER_SIZE (256*1024)
 
+/**
+ * MAX_ATTRIBUTES_IN_TABLE old handling
+ */
+#define MAXNROFATTRIBUTESINWORDS_OLD (128 / 32)
+
+/**
+ * No of bits available for attribute mask in NDB$EVENTS_0
+ */
+#define MAX_ATTRIBUTES_IN_TABLE_NDB_EVENTS_0 4096
+
 #endif

=== modified file 'storage/ndb/include/kernel/signaldata/CreateEvnt.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp	2010-05-03 04:49:08 +0000
@@ -24,6 +24,9 @@
 #include <NodeBitmask.hpp>
 #include <signaldata/DictTabInfo.hpp>
 #include <AttributeList.hpp>
+
+typedef Bitmask<MAXNROFATTRIBUTESINWORDS_OLD> AttributeMask_OLD;
+
 /**
  * DropEvntReq.
  */
@@ -184,10 +187,11 @@ struct CreateEvntReq {
     EF_ALL = 0xFFFF << 16
   };
   STATIC_CONST( SignalLengthGet = 3 );
-  STATIC_CONST( SignalLengthCreate = 6+MAXNROFATTRIBUTESINWORDS );
-  STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS );
-  //  SECTION( ATTRIBUTE_LIST_SECTION = 0 );
+  STATIC_CONST( SignalLengthCreate = 6+MAXNROFATTRIBUTESINWORDS_OLD );
+  STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS_OLD );
+
   SECTION( EVENT_NAME_SECTION = 0 );
+  SECTION( ATTRIBUTE_MASK = 1 );
 
   union {
     Uint32 m_userRef;             // user block reference
@@ -200,7 +204,7 @@ struct CreateEvntReq {
   Uint32 m_requestInfo;
   Uint32 m_tableId;             // table to event
   Uint32 m_tableVersion;        // table version
-  AttributeMask::Data m_attrListBitmask;
+  AttributeMask_OLD::Data m_attrListBitmask;
   Uint32 m_eventType;           // EventFlags (16 bits) + from DictTabInfo::TableType (16 bits)
   Uint32 m_eventId;             // event table id set by DICT/SUMA
   Uint32 m_eventKey;            // event table key set by DICT/SUMA
@@ -242,13 +246,27 @@ struct CreateEvntReq {
   void setTableVersion(Uint32 val) {
     m_tableVersion = val;
   }
-  AttributeMask getAttrListBitmask() const {
-    AttributeMask tmp;
+  AttributeMask_OLD getAttrListBitmask() const {
+    AttributeMask_OLD tmp;
     tmp.assign(m_attrListBitmask);
     return tmp;
   }
   void setAttrListBitmask(const AttributeMask & val) {
-    AttributeMask::assign(m_attrListBitmask.data, val);
+    setAttrListBitmask(val.getSizeInWords(), val.rep.data);
+  }
+  void setAttrListBitmask(const AttributeMask_OLD & val) {
+    setAttrListBitmask(val.getSizeInWords(), val.rep.data);
+  }
+  void setAttrListBitmask(Uint32 sz, const Uint32 data[]){
+    bzero(m_attrListBitmask.data, sizeof(m_attrListBitmask.data));
+    if (sz >= AttributeMask_OLD::Size)
+    {
+      AttributeMask_OLD::assign(m_attrListBitmask.data, data);
+    }
+    else
+    {
+      BitmaskImpl::assign(sz, m_attrListBitmask.data, data);
+    }
   }
   Uint32 getEventType() const {
     return m_eventType & ~EF_ALL;
@@ -299,7 +317,7 @@ class CreateEvntConf {
 
 public:
   //  STATIC_CONST( InternalLength = 3 );
-  STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS );
+  STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS_OLD );
 
   union {
     Uint32 m_userRef;             // user block reference
@@ -312,7 +330,7 @@ public:
   Uint32 m_requestInfo;
   Uint32 m_tableId;
   Uint32 m_tableVersion;        // table version
-  AttributeMask m_attrListBitmask;
+  AttributeMask_OLD m_attrListBitmask;
   Uint32 m_eventType;
   Uint32 m_eventId;
   Uint32 m_eventKey;
@@ -347,10 +365,10 @@ public:
   void setTableVersion(Uint32 val) {
     m_tableVersion = val;
   }
-  AttributeMask getAttrListBitmask() const {
+  AttributeMask_OLD getAttrListBitmask() const {
     return m_attrListBitmask;
   }
-  void setAttrListBitmask(const AttributeMask & val) {
+  void setAttrListBitmask(const AttributeMask_OLD & val) {
     m_attrListBitmask = val;
   }
   Uint32 getEventType() const {

=== modified file 'storage/ndb/include/kernel/signaldata/CreateTrig.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateTrig.hpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateTrig.hpp	2010-05-03 04:49:08 +0000
@@ -39,9 +39,9 @@ struct CreateTrigReq
     TriggerSrc = 2  // LQH "producing" block(s)
   };
 
-  STATIC_CONST( SignalLength = 13 + MAXNROFATTRIBUTESINWORDS);
+  STATIC_CONST( SignalLength = 13 );
   SECTION( TRIGGER_NAME_SECTION = 0 );
-  SECTION( ATTRIBUTE_MASK_SECTION = 1 );        // not yet in use
+  SECTION( ATTRIBUTE_MASK_SECTION = 1 );
 
   static Uint32 getOnlineFlag(Uint32 i) { return i & 3; }
   static void setOnlineFlag(Uint32 & i, Uint32 v) { i |= (v & 3); }
@@ -62,7 +62,6 @@ struct CreateTrigReq
   Uint32 forceTriggerId;// only for NR/SR
   Uint32 triggerInfo;   // type | timing | event | flags
   Uint32 receiverRef;   // receiver for subscription trigger
-  AttributeMask attributeMask;
 };
 
 struct CreateTrigConf {
@@ -91,7 +90,8 @@ struct CreateTrigRef
     BadRequestType = 4247,
     InvalidName = 4248,
     InvalidTable = 4249,
-    OutOfStringBuffer = 773
+    OutOfStringBuffer = 773,
+    OutOfSectionMemory = 795
   };
 
   STATIC_CONST( SignalLength = 10 );

=== modified file 'storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp	2009-05-12 15:01:40 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp	2010-05-03 04:49:08 +0000
@@ -28,10 +28,8 @@ struct CreateTrigImplReq
     CreateTriggerOffline = 2
   };
 
-  STATIC_CONST( SignalLength = 11 + MAXNROFATTRIBUTESINWORDS);
-  STATIC_CONST( SignalLengthLocal = 11 + MAXNROFATTRIBUTESINWORDS + 3);
-  SECTION( TRIGGER_NAME_SECTION = 0 );
-  SECTION( ATTRIBUTE_MASK_SECTION = 1 );        // not yet in use
+  STATIC_CONST( SignalLength = 11 + 3);
+  SECTION( ATTRIBUTE_MASK_SECTION = 0 );
 
   // tableVersion, indexVersion, name section used only within DICT
 
@@ -46,7 +44,6 @@ struct CreateTrigImplReq
   Uint32 triggerId;
   Uint32 triggerInfo;
   Uint32 receiverRef;
-  AttributeMask attributeMask;
   Uint32 upgradeExtra[3]; // Send TriggerId's as defined in 6.3 here
 };
 

=== modified file 'storage/ndb/include/ndbapi/ndbapi_limits.h'
--- a/storage/ndb/include/ndbapi/ndbapi_limits.h	2009-05-26 18:53:34 +0000
+++ b/storage/ndb/include/ndbapi/ndbapi_limits.h	2010-05-03 04:49:08 +0000
@@ -21,7 +21,7 @@
 
 #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_ATTRIBUTES_IN_TABLE 128
+#define NDB_MAX_ATTRIBUTES_IN_TABLE 512
 
 #define NDB_MAX_TUPLE_SIZE_IN_WORDS 2013
 #define NDB_MAX_KEYSIZE_IN_WORDS 1023

=== modified file 'storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp	2010-05-03 04:49:08 +0000
@@ -83,9 +83,6 @@ printCREATE_TRIG_REQ(FILE* output, const
   fprintf(output, "\n");
   fprintf(output, " receiverRef: 0x%x", sig->receiverRef);
   fprintf(output, "\n");
-  char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
-  fprintf(output, " attributeMask: %s", sig->attributeMask.getText(buf));
-  fprintf(output, "\n");  
   return true;
 }
 

=== modified file 'storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp	2007-12-25 16:26:22 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp	2010-05-03 04:49:08 +0000
@@ -68,9 +68,6 @@ printCREATE_TRIG_IMPL_REQ(FILE* output, 
                   reportAllMonitoredAttributes);
   fprintf(output, " receiverRef: 0x%x", sig->receiverRef);
   fprintf(output, "\n");  
-  char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
-  fprintf(output, " attributeMask: %s", sig->attributeMask.getText(buf));
-  fprintf(output, "\n");  
   return true;
 }
 

=== modified file 'storage/ndb/src/common/util/Bitmask.cpp'
--- a/storage/ndb/src/common/util/Bitmask.cpp	2010-03-29 12:31:44 +0000
+++ b/storage/ndb/src/common/util/Bitmask.cpp	2010-05-03 04:49:08 +0000
@@ -177,6 +177,8 @@ BitmaskImpl::parseMask(unsigned size, Ui
   return cnt;
 }
 
+template struct BitmaskPOD<16>;
+
 #ifdef TEST_BITMASK
 #include <NdbTap.hpp>
 

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2010-03-26 11:52:10 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2010-05-03 04:49:08 +0000
@@ -860,12 +860,19 @@ LocalProxy::sendTIME_SIGNAL(Signal* sign
 void
 LocalProxy::execCREATE_TRIG_IMPL_REQ(Signal* signal)
 {
+  if (!assembleFragments(signal))
+    return;
+
   if (ssQueue<Ss_CREATE_TRIG_IMPL_REQ>(signal))
     return;
   const CreateTrigImplReq* req = (const CreateTrigImplReq*)signal->getDataPtr();
   Ss_CREATE_TRIG_IMPL_REQ& ss = ssSeize<Ss_CREATE_TRIG_IMPL_REQ>();
   ss.m_req = *req;
-  ndbrequire(signal->getLength() <= CreateTrigImplReq::SignalLengthLocal);
+  ndbrequire(signal->getLength() <= CreateTrigImplReq::SignalLength);
+
+  SectionHandle handle(this, signal);
+  saveSections(ss, handle);
+
   sendREQ(signal, ss);
 }
 
@@ -880,7 +887,7 @@ LocalProxy::sendCREATE_TRIG_IMPL_REQ(Sig
   req->senderRef = reference();
   req->senderData = ssId;
   sendSignalNoRelease(workerRef(ss.m_worker), GSN_CREATE_TRIG_IMPL_REQ,
-                      signal, CreateTrigImplReq::SignalLengthLocal, JBB,
+                      signal, CreateTrigImplReq::SignalLength, JBB,
                       handle);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2010-03-26 11:52:10 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2010-05-03 04:49:08 +0000
@@ -301,10 +301,11 @@ protected:
     SsPool<Ss>& sp = Ss::pool(this);
     if (sp.m_usage < Ss::poolSize)
       return false;
-    ndbrequire(signal->getNoOfSections() == 0);
+
+    SectionHandle handle(this, signal);
     GlobalSignalNumber gsn = signal->header.theVerId_signalNumber & 0xFFFF;
     sendSignalWithDelay(reference(), gsn,
-                        signal, 10, signal->length());
+                        signal, 10, signal->length(), &handle);
     return true;
   }
 

=== modified file 'storage/ndb/src/kernel/blocks/backup/Backup.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2010-03-21 19:05:55 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2010-05-03 04:49:08 +0000
@@ -1793,7 +1793,7 @@ Backup::sendCreateTrig(Signal* signal, 
 
   Bitmask<MAXNROFATTRIBUTESINWORDS> attrMask;
   createAttributeMask(tabPtr, attrMask);
-  req->attributeMask = attrMask;
+
   req->tableId = tabPtr.p->tableId;
   req->tableVersion = 0;
   req->indexId = RNIL;
@@ -1826,8 +1826,12 @@ Backup::sendCreateTrig(Signal* signal, 
     TriggerInfo::setTriggerEvent(ti2, triggerEventValues[i]);
     req->triggerInfo = ti2;
 
+    LinearSectionPtr ptr[3];
+    ptr[0].p = attrMask.rep.data;
+    ptr[0].sz = attrMask.getSizeInWords();
+
     sendSignal(DBTUP_REF, GSN_CREATE_TRIG_IMPL_REQ,
-	       signal, CreateTrigImplReq::SignalLength, JBB);
+	       signal, CreateTrigImplReq::SignalLength, JBB, ptr ,1);
   }
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2010-04-29 14:52:05 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2010-05-03 04:49:08 +0000
@@ -8492,7 +8492,6 @@ Dbdict::alterTable_toCreateTrigger(Signa
   TriggerInfo::packTriggerInfo(req->triggerInfo, triggerTmpl.triggerInfo);
 
   req->receiverRef = 0;
-  bzero(&req->attributeMask, sizeof(req->attributeMask));
 
   char triggerName[MAX_TAB_NAME_SIZE];
   sprintf(triggerName, triggerTmpl.nameFormat, impl_req->tableId);
@@ -8506,8 +8505,13 @@ Dbdict::alterTable_toCreateTrigger(Signa
   lsPtr[0].p = buffer;
   lsPtr[0].sz = w.getWordsUsed();
 
+  AttributeMask mask;
+  mask.clear();
+  lsPtr[1].p = mask.rep.data;
+  lsPtr[1].sz = mask.getSizeInWords();
+
   sendSignal(reference(), GSN_CREATE_TRIG_REQ, signal,
-             CreateTrigReq::SignalLength, JBB, lsPtr, 1);
+             CreateTrigReq::SignalLength, JBB, lsPtr, 2);
 }
 
 void
@@ -11887,7 +11891,6 @@ Dbdict::alterIndex_toCreateTrigger(Signa
   TriggerInfo::packTriggerInfo(req->triggerInfo, triggerTmpl.triggerInfo);
 
   req->receiverRef = 0;
-  req->attributeMask = alterIndexPtr.p->m_attrMask;
 
   char triggerName[MAX_TAB_NAME_SIZE];
   sprintf(triggerName, triggerTmpl.nameFormat, impl_req->indexId);
@@ -11901,8 +11904,11 @@ Dbdict::alterIndex_toCreateTrigger(Signa
   lsPtr[0].p = buffer;
   lsPtr[0].sz = w.getWordsUsed();
 
+  lsPtr[1].p = alterIndexPtr.p->m_attrMask.rep.data;
+  lsPtr[1].sz = alterIndexPtr.p->m_attrMask.getSizeInWords();
+
   sendSignal(reference(), GSN_CREATE_TRIG_REQ, signal,
-             CreateTrigReq::SignalLength, JBB, lsPtr, 1);
+             CreateTrigReq::SignalLength, JBB, lsPtr, 2);
 }
 
 void
@@ -12804,7 +12810,6 @@ Dbdict::buildIndex_toCreateConstraint(Si
   TriggerInfo::packTriggerInfo(req->triggerInfo, triggerTmpl.triggerInfo);
 
   req->receiverRef = 0;
-  req->attributeMask = buildIndexPtr.p->m_attrMask;
 
   char triggerName[MAX_TAB_NAME_SIZE];
   sprintf(triggerName, triggerTmpl.nameFormat, impl_req->indexId);
@@ -12818,8 +12823,11 @@ Dbdict::buildIndex_toCreateConstraint(Si
   ls_ptr[0].p = buffer;
   ls_ptr[0].sz = w.getWordsUsed();
 
+  ls_ptr[1].p = buildIndexPtr.p->m_attrMask.rep.data;
+  ls_ptr[1].sz = buildIndexPtr.p->m_attrMask.getSizeInWords();
+
   sendSignal(reference(), GSN_CREATE_TRIG_REQ, signal,
-             CreateTrigReq::SignalLength, JBB, ls_ptr, 1);
+             CreateTrigReq::SignalLength, JBB, ls_ptr, 2);
 }
 
 void
@@ -13776,7 +13784,10 @@ void Dbdict::execUTIL_RELEASE_REF(Signal
  *
  */
 
-const Uint32 Dbdict::sysTab_NDBEVENTS_0_szs[EVENT_SYSTEM_TABLE_LENGTH] = {
+static const
+Uint32
+sysTab_NDBEVENTS_0_szs[] =
+{
   sizeof(((sysTab_NDBEVENTS_0*)0)->NAME),
   sizeof(((sysTab_NDBEVENTS_0*)0)->EVENT_TYPE),
   sizeof(((sysTab_NDBEVENTS_0*)0)->TABLEID),
@@ -13784,7 +13795,23 @@ const Uint32 Dbdict::sysTab_NDBEVENTS_0_
   sizeof(((sysTab_NDBEVENTS_0*)0)->TABLE_NAME),
   sizeof(((sysTab_NDBEVENTS_0*)0)->ATTRIBUTE_MASK),
   sizeof(((sysTab_NDBEVENTS_0*)0)->SUBID),
-  sizeof(((sysTab_NDBEVENTS_0*)0)->SUBKEY)
+  sizeof(((sysTab_NDBEVENTS_0*)0)->SUBKEY),
+  sizeof(((sysTab_NDBEVENTS_0*)0)->ATTRIBUTE_MASK2)
+};
+
+static const
+UintPtr
+sysTab_NDBEVENTS_0_offsets[] =
+{
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->NAME),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->EVENT_TYPE),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->TABLEID),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->TABLEVERSION),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->TABLE_NAME),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->ATTRIBUTE_MASK),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->SUBID),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->SUBKEY),
+  (UintPtr)&(((sysTab_NDBEVENTS_0*)0)->ATTRIBUTE_MASK2)
 };
 
 void
@@ -13804,8 +13831,12 @@ Dbdict::prepareTransactionEventSysTable 
   
   Uint32 tableId = tablePtr.p->tableId; /* System table */
   Uint32 noAttr = tablePtr.p->noOfAttributes;
-  ndbrequire(noAttr == EVENT_SYSTEM_TABLE_LENGTH);
-  
+  if (noAttr > EVENT_SYSTEM_TABLE_LENGTH)
+  {
+    jam();
+    noAttr = EVENT_SYSTEM_TABLE_LENGTH;
+  }
+
   switch (prepReq) {
   case UtilPrepareReq::Update:
   case UtilPrepareReq::Insert:
@@ -14139,12 +14170,14 @@ Dbdict::createEvent_RT_USER_CREATE(Signa
       (r0.getValueType() != SimpleProperties::StringValue) ||
       (r0.getValueLen() <= 0)) {
     jam();
-    releaseSections(handle);
     
     evntRecPtr.p->m_errorCode = 1;
+sendref:
     evntRecPtr.p->m_errorLine = __LINE__;
     evntRecPtr.p->m_errorNode = reference();
     
+    releaseSections(handle);
+
     createEvent_sendReply(signal, evntRecPtr);
     DBUG_VOID_RETURN;
   }
@@ -14154,6 +14187,40 @@ Dbdict::createEvent_RT_USER_CREATE(Signa
     memset(evntRecPtr.p->m_eventRec.TABLE_NAME+len, 0, MAX_TAB_NAME_SIZE-len);
   }
 
+  if (handle.m_cnt >= CreateEvntReq::ATTRIBUTE_MASK)
+  {
+    jam();
+    handle.getSection(ssPtr, CreateEvntReq::ATTRIBUTE_MASK);
+    if (ssPtr.sz >= NDB_ARRAY_SIZE(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2))
+    {
+      jam();
+      evntRecPtr.p->m_errorCode = 1;
+      goto sendref;
+    }
+    bzero(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2,
+          sizeof(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2));
+    copy(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2, ssPtr);
+    memcpy(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK,
+           evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2,
+           sizeof(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK));
+  }
+  else
+  {
+    jam();
+    AttributeMask_OLD m = evntRecPtr.p->m_request.getAttrListBitmask();
+    Uint32 sz0 = m.getSizeInWords();
+    Uint32 sz1 = NDB_ARRAY_SIZE(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK);
+    ndbrequire(sz1 == sz0);
+    bzero(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK,
+          sizeof(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK));
+    bzero(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2,
+          sizeof(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2));
+    BitmaskImpl::assign(sz0, evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK,
+                        m.rep.data);
+    BitmaskImpl::assign(sz0, evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2,
+                        m.rep.data);
+  }
+
   releaseSections(handle);
   
   // Send request to SUMA
@@ -14314,9 +14381,6 @@ Dbdict::createEventUTIL_PREPARE(Signal* 
           evntRecPtr.p->m_request.getEventType() | evntRecPtr.p->m_request.getReportFlags();
 	evntRecPtr.p->m_eventRec.TABLEID  = evntRecPtr.p->m_request.getTableId();
 	evntRecPtr.p->m_eventRec.TABLEVERSION=evntRecPtr.p->m_request.getTableVersion();
-	AttributeMask m = evntRecPtr.p->m_request.getAttrListBitmask();
-	memcpy(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK, &m,
-	       sizeof(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK));
 	evntRecPtr.p->m_eventRec.SUBID  = evntRecPtr.p->m_request.getEventId();
 	evntRecPtr.p->m_eventRec.SUBKEY = evntRecPtr.p->m_request.getEventKey();
 	DBUG_PRINT("info",
@@ -14358,6 +14422,15 @@ Dbdict::createEventUTIL_PREPARE(Signal* 
   }
 }
 
+static
+Uint32
+countPrefixBytes(Uint32 len, const Uint8 * mask)
+{
+  while (len && mask[len - 1] == 0)
+    len--;
+  return len;
+}
+
 void Dbdict::executeTransEventSysTable(Callback *pcallback, Signal *signal,
 				       const Uint32 ptrI,
 				       sysTab_NDBEVENTS_0& m_eventRec,
@@ -14365,17 +14438,39 @@ void Dbdict::executeTransEventSysTable(C
 				       UtilPrepareReq::OperationTypeValue prepReq)
 {
   jam();
-  const Uint32 noAttr = EVENT_SYSTEM_TABLE_LENGTH;
+
+  DictObject * opj_ptr_p = get_object(EVENT_SYSTEM_TABLE_NAME,
+				      sizeof(EVENT_SYSTEM_TABLE_NAME));
+
+  ndbrequire(opj_ptr_p != 0);
+  TableRecordPtr tablePtr;
+  c_tableRecordPool.getPtr(tablePtr, opj_ptr_p->m_id);
+  ndbrequire(tablePtr.i != RNIL); // system table must exist
+
+  Uint32 noAttr = tablePtr.p->noOfAttributes;
+  if (noAttr > EVENT_SYSTEM_TABLE_LENGTH)
+  {
+    jam();
+    noAttr = EVENT_SYSTEM_TABLE_LENGTH;
+  }
+
   Uint32 total_len = 0;
 
   Uint32* attrHdr = signal->theData + 25;
   Uint32* attrPtr = attrHdr;
+  Uint32* dataPtr = attrHdr + noAttr;
 
   Uint32 id=0;
   // attribute 0 event name: Primary Key
   {
-    AttributeHeader::init(attrPtr, id, sysTab_NDBEVENTS_0_szs[id]);
-    total_len += sysTab_NDBEVENTS_0_szs[id];
+    char *base = (char*)&m_eventRec;
+    Uint32 sz = sysTab_NDBEVENTS_0_szs[id];
+    const Uint32 *src = (const Uint32*)(base +sysTab_NDBEVENTS_0_offsets[id]);
+    memcpy(dataPtr, src, sz);
+    dataPtr += (sz / 4);
+
+    AttributeHeader::init(attrPtr, id, sz);
+    total_len += sz;
     attrPtr++; id++;
   }
 
@@ -14383,21 +14478,55 @@ void Dbdict::executeTransEventSysTable(C
   case UtilPrepareReq::Read:
     jam();
     EVENT_TRACE;
+
+    // clear it, since NDB$EVENTS_0.ATTRIBUTE_MASK2 might not be present
+    bzero(m_eventRec.ATTRIBUTE_MASK2, sizeof(m_eventRec.ATTRIBUTE_MASK2));
+
     // no more
     while ( id < noAttr )
       AttributeHeader::init(attrPtr++, id++, 0);
-    ndbrequire(id == (Uint32) noAttr);
+    ndbrequire(id == noAttr);
     break;
   case UtilPrepareReq::Insert:
+  {
     jam();
     EVENT_TRACE;
-    while ( id < noAttr ) {
-      AttributeHeader::init(attrPtr, id, sysTab_NDBEVENTS_0_szs[id]);
-      total_len += sysTab_NDBEVENTS_0_szs[id];
+    char *base = (char*)&m_eventRec;
+    while ( id < noAttr )
+    {
+      if (id != EVENT_SYSTEM_TABLE_ATTRIBUTE_MASK2_ID)
+      {
+        jam();
+        Uint32 sz = sysTab_NDBEVENTS_0_szs[id];
+        AttributeHeader::init(attrPtr, id, sz);
+        const Uint32 *src = (const Uint32*)(base +sysTab_NDBEVENTS_0_offsets[id]);
+        memcpy(dataPtr, src, sz);
+        dataPtr += (sz / 4);
+        total_len += sysTab_NDBEVENTS_0_szs[id];
+      }
+      else
+      {
+        jam();
+        Uint32 szBytes = countPrefixBytes(sizeof(m_eventRec.ATTRIBUTE_MASK2) - 4,
+                                          (Uint8*)m_eventRec.ATTRIBUTE_MASK2);
+        AttributeHeader::init(attrPtr, id, 2 + szBytes);
+
+        Uint8 * lenbytes = (Uint8*)dataPtr;
+        lenbytes[0] = (szBytes & 0xFF);
+        lenbytes[1] = (szBytes / 256);
+        memcpy(lenbytes + 2, m_eventRec.ATTRIBUTE_MASK2, szBytes);
+        if (szBytes & 3)
+        {
+          bzero(lenbytes + 2 + szBytes, 4 - (szBytes & 3));
+        }
+        szBytes += 2;
+        dataPtr += (szBytes + 3) / 4;
+        total_len += 4 * ((szBytes + 3) / 4);
+      }
       attrPtr++; id++;
     }
-    ndbrequire(id == (Uint32) noAttr);
     break;
+  }
   case UtilPrepareReq::Delete:
     ndbrequire(id == 1);
     break;
@@ -14406,16 +14535,13 @@ void Dbdict::executeTransEventSysTable(C
   }
     
   LinearSectionPtr headerPtr;
-  LinearSectionPtr dataPtr;
+  LinearSectionPtr lsdataPtr;
     
   headerPtr.p = attrHdr;
-  headerPtr.sz = noAttr;
+  headerPtr.sz = id;
     
-  dataPtr.p = (Uint32*)&m_eventRec;
-  dataPtr.sz = total_len/4;
-
-  ndbrequire((total_len == sysTab_NDBEVENTS_0_szs[0]) ||
-	     (total_len == sizeof(sysTab_NDBEVENTS_0)));
+  lsdataPtr.p = attrHdr + noAttr;
+  lsdataPtr.sz = total_len/4;
 
 #if 0
     printf("Header size %u\n", headerPtr.sz);
@@ -14423,8 +14549,8 @@ void Dbdict::executeTransEventSysTable(C
       printf("H'%.8x ", attrHdr[i]);
     printf("\n");
     
-    printf("Data size %u\n", dataPtr.sz);
-    for(int i = 0; i < (int)dataPtr.sz; i++)
+    printf("Data size %u\n", lsdataPtr.sz);
+    for(int i = 0; i < (int)lsdataPtr.sz; i++)
       printf("H'%.8x ", dataPage[i]);
     printf("\n");
 #endif
@@ -14434,7 +14560,7 @@ void Dbdict::executeTransEventSysTable(C
 		     prepareId,
 		     id,
 		     headerPtr,
-		     dataPtr);
+		     lsdataPtr);
 }
 
 void Dbdict::executeTransaction(Callback *pcallback,
@@ -14491,21 +14617,54 @@ void Dbdict::parseReadEventSys(Signal* s
   handle.getSection(dataPtr, UtilExecuteReq::DATA_SECTION);
   SectionReader dataReader(dataPtr, getSectionSegmentPool());
   
-  AttributeHeader header;
-  Uint32 *dst = (Uint32*)&m_eventRec;
+  char *base = (char*)&m_eventRec;
 
-  for (int i = 0; i < EVENT_SYSTEM_TABLE_LENGTH; i++) {
-    headerReader.getWord((Uint32 *)&header);
-    int sz = header.getDataSize();
-    for (int i=0; i < sz; i++)
-      dataReader.getWord(dst++);
+  DictObject * opj_ptr_p = get_object(EVENT_SYSTEM_TABLE_NAME,
+				      sizeof(EVENT_SYSTEM_TABLE_NAME));
+
+  ndbrequire(opj_ptr_p != 0);
+  TableRecordPtr tablePtr;
+  c_tableRecordPool.getPtr(tablePtr, opj_ptr_p->m_id);
+  ndbrequire(tablePtr.i != RNIL); // system table must exist
+
+  Uint32 noAttr = tablePtr.p->noOfAttributes;
+  if (noAttr > EVENT_SYSTEM_TABLE_LENGTH)
+  {
+    jam();
+    noAttr = EVENT_SYSTEM_TABLE_LENGTH;
   }
 
-  ndbrequire( ((char*)dst-(char*)&m_eventRec) == sizeof(m_eventRec) );
+  for (Uint32 i = 0; i < noAttr; i++)
+  {
+    jam();
+    Uint32 headerWord;
+    headerReader.getWord(&headerWord);
+    Uint32 sz = AttributeHeader::getDataSize(headerWord);
+    ndbrequire(4 * sz <= sysTab_NDBEVENTS_0_szs[i]);
+    Uint32 * dst = (Uint32*)(base + sysTab_NDBEVENTS_0_offsets[i]);
+    for (Uint32 j = 0; j < sz; j++)
+      dataReader.getWord(dst++);
+  }
 
   releaseSections(handle);
+
+  if (noAttr < EVENT_SYSTEM_TABLE_LENGTH)
+  {
+    jam();
+    bzero(m_eventRec.ATTRIBUTE_MASK2, sizeof(m_eventRec.ATTRIBUTE_MASK2));
+    memcpy(m_eventRec.ATTRIBUTE_MASK2, m_eventRec.ATTRIBUTE_MASK,
+           sizeof(m_eventRec.ATTRIBUTE_MASK));
+  }
+  else
+  {
+    jam();
+    Uint8* lenbytes = (Uint8*)m_eventRec.ATTRIBUTE_MASK2;
+    Uint32 szBytes  = lenbytes[0] + (lenbytes[1] * 256);
+    memmove(lenbytes, lenbytes + 2, szBytes);
+    bzero(lenbytes + szBytes, sizeof(m_eventRec.ATTRIBUTE_MASK2) - szBytes);
+  }
 }
-    
+
 void Dbdict::createEventUTIL_EXECUTE(Signal *signal, 
 				     Uint32 callbackData,
 				     Uint32 returnCode)
@@ -14530,8 +14689,8 @@ void Dbdict::createEventUTIL_EXECUTE(Sig
       evntRec->m_request.setReportFlags(evntRecPtr.p->m_eventRec.EVENT_TYPE);
       evntRec->m_request.setTableId(evntRecPtr.p->m_eventRec.TABLEID);
       evntRec->m_request.setTableVersion(evntRecPtr.p->m_eventRec.TABLEVERSION);
-      evntRec->m_request.setAttrListBitmask(*(AttributeMask*)
-					    evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK);
+      Uint32 sz = NDB_ARRAY_SIZE(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK);
+      evntRec->m_request.setAttrListBitmask(sz, evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK);
       evntRec->m_request.setEventId(evntRecPtr.p->m_eventRec.SUBID);
       evntRec->m_request.setEventKey(evntRecPtr.p->m_eventRec.SUBKEY);
 
@@ -14719,7 +14878,7 @@ void Dbdict::execCREATE_EVNT_REF(Signal*
   ndbout_c("DBDICT(Coordinator) got GSN_CREATE_EVNT_REF evntRecPtr.i = (%d)", evntRecPtr.i);
 #endif
 
-  LinearSectionPtr ptr[1];
+  LinearSectionPtr ptr[2];
 
   int noLSP = 0;
   LinearSectionPtr *ptr0 = NULL;
@@ -14744,8 +14903,10 @@ void Dbdict::execCREATE_EVNT_REF(Signal*
        */
       ptr[0].p = (Uint32 *)evntRecPtr.p->m_eventRec.TABLE_NAME;
       ptr[0].sz = Uint32((strlen(evntRecPtr.p->m_eventRec.TABLE_NAME)+4)/4);
+      ptr[1].p = evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2;
+      ptr[1].sz = NDB_ARRAY_SIZE(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2) - 1;
       ptr0 = ptr;
-      noLSP = 1;
+      noLSP = 2;
     }
   }
   else 
@@ -14780,13 +14941,15 @@ void Dbdict::execCREATE_EVNT_CONF(Signal
 
   // we will only have a valid tablename if it the master DICT sending this
   // but that's ok
-  LinearSectionPtr ptr[1];
+  LinearSectionPtr ptr[2];
   ptr[0].p = (Uint32 *)evntRecPtr.p->m_eventRec.TABLE_NAME;
   ptr[0].sz =
     Uint32(strlen(evntRecPtr.p->m_eventRec.TABLE_NAME)+4)/4; // to make sure we have a null
+  ptr[1].p = evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2;
+  ptr[1].sz = NDB_ARRAY_SIZE(evntRecPtr.p->m_eventRec.ATTRIBUTE_MASK2) - 1;
+
+  createEvent_sendReply(signal, evntRecPtr, ptr, 2);
 
-  createEvent_sendReply(signal, evntRecPtr, ptr, 1);
-    
   return;
 }
 
@@ -16181,7 +16344,6 @@ Dbdict::execCREATE_TRIG_REQ(Signal* sign
     impl_req->triggerId = req->forceTriggerId;
     impl_req->triggerInfo = req->triggerInfo;
     impl_req->receiverRef = req->receiverRef;
-    impl_req->attributeMask = req->attributeMask;
 
     handleClientReq(signal, op_ptr, handle);
     return;
@@ -16364,8 +16526,35 @@ Dbdict::createTrigger_parse(Signal* sign
   triggerPtr.p->indexId = RNIL; // feedback method connects to index
   triggerPtr.p->triggerInfo = impl_req->triggerInfo;
   triggerPtr.p->receiverRef = impl_req->receiverRef;
-  triggerPtr.p->attributeMask = impl_req->attributeMask;
   triggerPtr.p->triggerState = TriggerRecord::TS_DEFINING;
+
+  if (handle.m_cnt >= 2)
+  {
+    jam();
+    SegmentedSectionPtr mask_ptr;
+    handle.getSection(mask_ptr, CreateTrigReq::ATTRIBUTE_MASK_SECTION);
+    if (mask_ptr.sz > triggerPtr.p->attributeMask.getSizeInWords())
+    {
+      jam();
+      setError(error, CreateTrigRef::BadRequestType, __LINE__);
+      return;
+    }
+    ::copy(triggerPtr.p->attributeMask.rep.data, mask_ptr);
+    if (mask_ptr.sz < triggerPtr.p->attributeMask.getSizeInWords())
+    {
+      jam();
+      Uint32 len = triggerPtr.p->attributeMask.getSizeInWords() - mask_ptr.sz;
+      bzero(triggerPtr.p->attributeMask.rep.data + mask_ptr.sz,
+            4 * len);
+    }
+  }
+  else
+  {
+    jam();
+    setError(error, CreateTrigRef::BadRequestType, __LINE__);
+    return;
+  }
+
   {
     Rope name(c_rope_pool, triggerPtr.p->triggerName);
     if (!name.assign(createTriggerPtr.p->m_triggerName)) {
@@ -16962,7 +17151,6 @@ Dbdict::send_create_trig_req(Signal* sig
   req->triggerId = triggerPtr.p->triggerId;
   req->triggerInfo = triggerPtr.p->triggerInfo;
   req->receiverRef = triggerPtr.p->receiverRef;
-  req->attributeMask = triggerPtr.p->attributeMask;
 
   {
     /**
@@ -16991,9 +17179,13 @@ Dbdict::send_create_trig_req(Signal* sig
     req->upgradeExtra[2] = tmp[2];
   }
 
+  LinearSectionPtr ptr[3];
+  ptr[0].p = triggerPtr.p->attributeMask.rep.data;
+  ptr[0].sz = triggerPtr.p->attributeMask.getSizeInWords();
+
   BlockReference ref = createTriggerPtr.p->m_block_list[0];
   sendSignal(ref, GSN_CREATE_TRIG_IMPL_REQ, signal,
-             CreateTrigImplReq::SignalLengthLocal, JBB);
+             CreateTrigImplReq::SignalLength, JBB, ptr, 1);
 }
 
 // CreateTrigger: MISC

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2010-04-01 05:20:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2010-05-03 04:49:08 +0000
@@ -142,7 +142,8 @@
 /**
  * Systable NDB$EVENTS_0
  */
-#define EVENT_SYSTEM_TABLE_LENGTH 8
+#define EVENT_SYSTEM_TABLE_LENGTH 9
+#define EVENT_SYSTEM_TABLE_ATTRIBUTE_MASK2_ID 8
 
 struct sysTab_NDBEVENTS_0 {
   char   NAME[MAX_TAB_NAME_SIZE];
@@ -150,9 +151,12 @@ struct sysTab_NDBEVENTS_0 {
   Uint32 TABLEID;
   Uint32 TABLEVERSION;
   char   TABLE_NAME[MAX_TAB_NAME_SIZE];
-  Uint32 ATTRIBUTE_MASK[MAXNROFATTRIBUTESINWORDS];
+  Uint32 ATTRIBUTE_MASK[MAXNROFATTRIBUTESINWORDS_OLD];
   Uint32 SUBID;
   Uint32 SUBKEY;
+
+  // +1 to allow var size header to be received
+  Uint32 ATTRIBUTE_MASK2[(MAX_ATTRIBUTES_IN_TABLE / 32) + 1];
 };
 
 /**
@@ -2896,8 +2900,6 @@ private:
   };
   typedef Ptr<OpSubEvent> OpSubEventPtr;
 
-  static const Uint32 sysTab_NDBEVENTS_0_szs[];
-
   /**
    * Operation record for create event.
    */

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-04-29 14:52:05 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-05-03 04:49:08 +0000
@@ -22251,11 +22251,18 @@ Dblqh::execCREATE_TRIG_IMPL_REQ(Signal* 
 {
   jamEntry();
 
+  if (!assembleFragments(signal))
+  {
+    jam();
+    return;
+  }
+
   CreateTrigImplReq* req = (CreateTrigImplReq*)signal->getDataPtrSend();
+  SectionHandle handle(this, signal);
   req->senderRef = reference();
   BlockReference tupRef = calcInstanceBlockRef(DBTUP);
   sendSignal(tupRef, GSN_CREATE_TRIG_IMPL_REQ, signal,
-             CreateTrigImplReq::SignalLengthLocal, JBB);
+             signal->getLength(), JBB, &handle);
 }
 
 void

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-03-11 09:47:05 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2010-05-03 04:49:08 +0000
@@ -12960,10 +12960,19 @@ void Dbtc::checkAbortAllTimeout(Signal* 
 void Dbtc::execCREATE_TRIG_IMPL_REQ(Signal* signal)
 {
   jamEntry();
+  if (!assembleFragments(signal))
+  {
+    jam();
+    return;
+  }
+
   const CreateTrigImplReq* req = (const CreateTrigImplReq*)signal->getDataPtr();
   const Uint32 senderRef = req->senderRef;
   const Uint32 senderData = req->senderData;
 
+  SectionHandle handle(this, signal);
+  releaseSections(handle); // Not using mask
+
   TcDefinedTriggerData* triggerData;
   DefinedTriggerPtr triggerPtr;
 

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2010-04-29 14:52:05 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2010-05-03 04:49:08 +0000
@@ -2525,7 +2525,7 @@ private:
                   TriggerActionTime::Value ttime,
                   TriggerEvent::Value tevent);
 
-  bool createTrigger(Tablerec*, const CreateTrigImplReq* req);
+  bool createTrigger(Tablerec*, const CreateTrigImplReq*, const AttributeMask&);
 
   Uint32 dropTrigger(Tablerec* table,
 		     const DropTrigImplReq* req,

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2010-02-18 06:30:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2010-05-03 04:49:08 +0000
@@ -124,6 +124,12 @@ void
 Dbtup::execCREATE_TRIG_IMPL_REQ(Signal* signal)
 {
   jamEntry();
+  if (!assembleFragments(signal))
+  {
+    jam();
+    return;
+  }
+
   const CreateTrigImplReq* req = (const CreateTrigImplReq*)signal->getDataPtr();
   const Uint32 senderRef = req->senderRef;
   const Uint32 senderData = req->senderData;
@@ -133,38 +139,64 @@ Dbtup::execCREATE_TRIG_IMPL_REQ(Signal* 
 
   CreateTrigRef::ErrorCode error = CreateTrigRef::NoError;
 
-  // Find table
-  TablerecPtr tabPtr;
-  tabPtr.i = req->tableId;
-  ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
-
-  if (tabPtr.p->tableStatus != DEFINED )
+  AttributeMask mask;
+  SectionHandle handle(this, signal);
+  if (handle.m_cnt <= CreateTrigImplReq::ATTRIBUTE_MASK_SECTION)
   {
     jam();
-    error = CreateTrigRef::InvalidTable;
+    ndbassert(false);
+    error = CreateTrigRef::BadRequestType;
   }
-  // Create trigger and associate it with the table
-  else if (createTrigger(tabPtr.p, req))
+  else
   {
-    jam();
-    // Send conf
-    CreateTrigImplConf* conf = (CreateTrigImplConf*)signal->getDataPtrSend();
-    conf->senderRef = reference();
-    conf->senderData = senderData;
-    conf->tableId = tableId;
-    conf->triggerId = triggerId;
-    conf->triggerInfo = triggerInfo;
+    SegmentedSectionPtr ptr;
+    handle.getSection(ptr, CreateTrigImplReq::ATTRIBUTE_MASK_SECTION);
+    ndbrequire(ptr.sz == mask.getSizeInWords());
+    ::copy(mask.rep.data, ptr);
+  }
 
-    sendSignal(senderRef, GSN_CREATE_TRIG_IMPL_CONF, 
-               signal, CreateTrigImplConf::SignalLength, JBB);
-    return;
+  releaseSections(handle);
+
+  if (error != CreateTrigRef::NoError)
+  {
+    goto err;
   }
-  else
+
   {
-    jam();
-    error = CreateTrigRef::TooManyTriggers;
+    // Find table
+    TablerecPtr tabPtr;
+    tabPtr.i = req->tableId;
+    ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
+
+    if (tabPtr.p->tableStatus != DEFINED )
+    {
+      jam();
+      error = CreateTrigRef::InvalidTable;
+    }
+    // Create trigger and associate it with the table
+    else if (createTrigger(tabPtr.p, req, mask))
+    {
+      jam();
+      // Send conf
+      CreateTrigImplConf* conf = (CreateTrigImplConf*)signal->getDataPtrSend();
+      conf->senderRef = reference();
+      conf->senderData = senderData;
+      conf->tableId = tableId;
+      conf->triggerId = triggerId;
+      conf->triggerInfo = triggerInfo;
+
+      sendSignal(senderRef, GSN_CREATE_TRIG_IMPL_CONF,
+                 signal, CreateTrigImplConf::SignalLength, JBB);
+      return;
+    }
+    else
+    {
+      jam();
+      error = CreateTrigRef::TooManyTriggers;
+    }
   }
 
+err:
   ndbassert(error != CreateTrigRef::NoError);
   // Send ref
   CreateTrigImplRef* ref = (CreateTrigImplRef*)signal->getDataPtrSend();
@@ -244,7 +276,8 @@ Dbtup::execDROP_TRIG_IMPL_REQ(Signal* si
 /* ---------------------------------------------------------------- */
 bool
 Dbtup::createTrigger(Tablerec* table,
-                     const CreateTrigImplReq* req)
+                     const CreateTrigImplReq* req,
+                     const AttributeMask& mask)
 {
   if (ERROR_INSERTED(4003)) {
     CLEAR_ERROR_INSERT_VALUE;
@@ -352,7 +385,7 @@ Dbtup::createTrigger(Tablerec* table,
     {
       jam();
       // Set attribute mask
-      tptr.p->attributeMask = req->attributeMask;
+      tptr.p->attributeMask = mask;
     }
   }
   return true;

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2010-01-19 08:24:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2010-05-03 04:49:08 +0000
@@ -1805,7 +1805,6 @@ DbUtil::execUTIL_SEQUENCE_REQ(Signal* si
   OperationPtr opPtr;
   ndbrequire(transPtr.p->operations.seize(opPtr));
   
-  ndbrequire(opPtr.p->rs.seize(prepOp->rsLen));
   ndbrequire(opPtr.p->keyInfo.seize(1));
 
   transPtr.p->gci_hi = 0;
@@ -1879,7 +1878,7 @@ DbUtil::getResultSet(Signal* signal, con
   // extract headers
   for(rs.first(it); it.curr.i != RNIL; ) {
     *tmpBuf++ = it.data[0];
-    rs.next(it, ((AttributeHeader*)&it.data[0])->getDataSize() + 1);
+    rs.next(it, AttributeHeader::getDataSize(it.data[0]) + 1);
     noAttr++;
   }
 
@@ -1889,10 +1888,13 @@ DbUtil::getResultSet(Signal* signal, con
   const Uint32* dataBuffer = tmpBuf;
 
   // extract data
-  for(rs.first(it); it.curr.i != RNIL; ) {
-    int sz = ((AttributeHeader*)&it.data[0])->getDataSize();
+  for(rs.first(it); it.curr.i != RNIL; )
+  {
+    jam();
+    int sz = AttributeHeader::getDataSize(it.data[0]);
     rs.next(it,1);
-    for (int i = 0; i < sz; i++) {
+    for (int i = 0; i < sz; i++)
+    {
       *tmpBuf++ = *it.data;
       rs.next(it,1);
       dataSz++;
@@ -2079,11 +2081,6 @@ DbUtil::execUTIL_EXECUTE_REQ(Signal* sig
   opPtr.p->prepOp_i = prepOpPtr.i;
   opPtr.p->m_scanTakeOver = scanTakeOver;
 
-#if 0 //def EVENT_DEBUG
-  printf("opPtr.p->rs.seize( %u )\n", prepOpPtr.p->rsLen);
-#endif
-  ndbrequire(opPtr.p->rs.seize(prepOpPtr.p->rsLen));
-  
  /***********************************************************
    * Store signal data on linear memory in Transaction record 
    ***********************************************************/
@@ -2225,8 +2222,6 @@ DbUtil::runOperation(Signal* signal, Tra
   /**
    * Init operation w.r.t result set
    */
-  initResultSet(op->rs, pop->rsInfo);
-  op->rs.first(op->rsIterator);
   op->rsRecv = 0;
 #if 0 //def EVENT_DEBUG
   printf("pop->rsLen %u\n", pop->rsLen);
@@ -2359,27 +2354,6 @@ DbUtil::sendAttrInfo(Signal* signal, 
 }
 
 void
-DbUtil::initResultSet(ResultSetBuffer & rs, 
-		      const ResultSetInfoBuffer & rsi){
-  
-  ResultSetBuffer::DataBufferIterator rsit;
-  rs.first(rsit);
-  
-  ResultSetInfoBuffer::ConstDataBufferIterator rsiit;
-  for(rsi.first(rsiit); rsiit.curr.i != RNIL; rsi.next(rsiit)){
-    ndbrequire(rsit.curr.i != RNIL);
-    
-    rsit.data[0] = rsiit.data[0];
-#if 0 //def EVENT_DEBUG
-    printf("Init resultset %u, sz %d\n",
-	   rsit.curr.i,
-	   ((AttributeHeader*)&rsit.data[0])->getDataSize() + 1);
-#endif
-    rs.next(rsit, ((AttributeHeader*)&rsit.data[0])->getDataSize() + 1);
-  }
-}
-
-void
 DbUtil::getTransId(Transaction * transP){
 
   Uint32 tmp[2];
@@ -2446,30 +2420,24 @@ DbUtil::execTRANSID_AI(Signal* signal){
   /**
    * Save result
    */
-  ResultSetBuffer::DataBufferIterator rs = opP->rsIterator;
-
   if (longSignal)
   {
     SectionSegment * ptrP = dataPtr.p;
     while (dataLen > NDB_SECTION_SEGMENT_SZ)
     {
-      ndbrequire(opP->rs.import(rs, &ptrP->theData[0], NDB_SECTION_SEGMENT_SZ));
-      opP->rs.next(rs, NDB_SECTION_SEGMENT_SZ);
+      ndbrequire(opP->rs.append(ptrP->theData, NDB_SECTION_SEGMENT_SZ));
       dataLen -= NDB_SECTION_SEGMENT_SZ;
       ptrP = g_sectionSegmentPool.getPtr(ptrP->m_nextSegment);
     }
-    ndbrequire(opP->rs.import(rs, &ptrP->theData[0], dataLen));
-    opP->rs.next(rs, dataLen);
+    ndbrequire(opP->rs.append(ptrP->theData, dataLen));
 
     releaseSections(handle);
   }
   else
   {
     const Uint32 *src = &signal->theData[3];
-    ndbrequire(opP->rs.import(rs,src,dataLen));
-    opP->rs.next(rs, dataLen);
+    ndbrequire(opP->rs.append(src, dataLen));
   }
-  opP->rsIterator = rs;
 
   if(!opP->complete()){
    jam();

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp	2009-10-09 09:28:56 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp	2010-05-03 04:49:08 +0000
@@ -297,7 +297,6 @@ public:
     KeyInfoBuffer                        keyInfo;
     AttrInfoBuffer                       attrInfo;
     ResultSetBuffer                      rs;
-    ResultSetBuffer::DataBufferIterator  rsIterator;
     
     Uint32 transPtrI;
     

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp	2010-05-03 04:49:08 +0000
@@ -144,7 +144,7 @@ public:
   static const unsigned g_sysTableCount;
   // the system tables
   static const SysTable g_sysTable_SYSTAB_0;
-  static const SysTable g_sysTable_NDBEVENTS_0;
+  static SysTable g_sysTable_NDBEVENTS_0;
   // schema trans
   Uint32 c_schemaTransId;
   Uint32 c_schemaTransKey;

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2010-02-02 09:37:52 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2010-05-03 04:49:08 +0000
@@ -464,6 +464,13 @@ Ndbcntr::execREAD_CONFIG_REQ(Signal* sig
   empty.type = ~0;
   f_dd.push_back(empty);
 
+  if (true)
+  {
+    // TODO: add config parameter
+    // remove ATTRIBUTE_MASK2
+    g_sysTable_NDBEVENTS_0.columnCount--;
+  }
+
   ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
   conf->senderRef = reference();
   conf->senderData = senderData;
@@ -2319,8 +2326,23 @@ void Ndbcntr::createSystableLab(Signal* 
     w.add(DictTabInfo::AttributeKeyFlag, (Uint32)column.keyFlag);
     w.add(DictTabInfo::AttributeStorageType, 
 	  (Uint32)NDB_STORAGETYPE_MEMORY);
-    w.add(DictTabInfo::AttributeArrayType, 
-	  (Uint32)NDB_ARRAYTYPE_FIXED);
+    switch(column.type){
+    case DictTabInfo::ExtVarbinary:
+      jam();
+      w.add(DictTabInfo::AttributeArrayType,
+            (Uint32)NDB_ARRAYTYPE_SHORT_VAR);
+      break;
+    case DictTabInfo::ExtLongvarbinary:
+      jam();
+      w.add(DictTabInfo::AttributeArrayType,
+            (Uint32)NDB_ARRAYTYPE_MEDIUM_VAR);
+      break;
+    default:
+      jam();
+      w.add(DictTabInfo::AttributeArrayType,
+            (Uint32)NDB_ARRAYTYPE_FIXED);
+      break;
+    }
     w.add(DictTabInfo::AttributeNullableFlag, (Uint32)column.nullable);
     w.add(DictTabInfo::AttributeExtType, (Uint32)column.type);
     w.add(DictTabInfo::AttributeExtLength, (Uint32)column.length);

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp	2010-05-03 04:49:08 +0000
@@ -68,7 +68,7 @@ column_NDBEVENTS_0[] = {
     false, false
   },
   { 5, "ATTRIBUTE_MASK",
-    DictTabInfo::ExtUnsigned, MAXNROFATTRIBUTESINWORDS,
+    DictTabInfo::ExtUnsigned, MAXNROFATTRIBUTESINWORDS_OLD,
     false, false
   },
   { 6, "SUBID",
@@ -79,9 +79,13 @@ column_NDBEVENTS_0[] = {
     DictTabInfo::ExtUnsigned, 1,
     false, false
   },
+  { 8, "ATTRIBUTE_MASK2",
+    DictTabInfo::ExtLongvarbinary, MAX_ATTRIBUTES_IN_TABLE_NDB_EVENTS_0 / 8,
+    false, true
+  }
 };
 
-const Ndbcntr::SysTable
+Ndbcntr::SysTable
 Ndbcntr::g_sysTable_NDBEVENTS_0 = {
   "sys/def/NDB$EVENTS_0",
   arrayLength(column_NDBEVENTS_0), column_NDBEVENTS_0,

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-03-11 19:47:09 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-05-03 04:49:08 +0000
@@ -2930,10 +2930,12 @@ Suma::create_triggers(Signal* signal, Su
     req->tableVersion = 0; // not used
     req->indexId = ~(Uint32)0;
     req->indexVersion = 0;
-    req->attributeMask = attrMask;
-    
+
+    LinearSectionPtr ptr[3];
+    ptr[0].p = attrMask.rep.data;
+    ptr[0].sz = attrMask.getSizeInWords();
     sendSignal(DBTUP_REF, GSN_CREATE_TRIG_IMPL_REQ, 
-               signal, CreateTrigImplReq::SignalLength, JBB);
+               signal, CreateTrigImplReq::SignalLength, JBB, ptr, 1);
   }
 }
 

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2010-04-30 12:30:18 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2010-05-03 04:49:08 +0000
@@ -4372,6 +4372,9 @@ NdbDictInterface::createEvent(class Ndb 
   req->setUserRef(m_reference);
   req->setUserData(0);
 
+  Uint32 seccnt = 1;
+  LinearSectionPtr ptr[2];
+
   if (getFlag) {
     // getting event from Dictionary
     req->setRequestType(CreateEvntReq::RT_USER_GET);
@@ -4390,6 +4393,9 @@ NdbDictInterface::createEvent(class Ndb 
       req->setReportAll();
     if (evnt.m_rep & NdbDictionary::Event::ER_SUBSCRIBE)
       req->setReportSubscribe();
+    ptr[1].p = evnt.m_attrListBitmask.rep.data;
+    ptr[1].sz = evnt.m_attrListBitmask.getSizeInWords();
+    seccnt++;
   }
 
   UtilBufferWriter w(m_buffer);
@@ -4410,11 +4416,10 @@ NdbDictInterface::createEvent(class Ndb 
 	 internal_tabname.c_str());
   }
 
-  LinearSectionPtr ptr[1];
   ptr[0].p = (Uint32*)m_buffer.get_data();
   ptr[0].sz = (m_buffer.length()+3) >> 2;
 
-  int ret = dictSignal(&tSignal,ptr, 1,
+  int ret = dictSignal(&tSignal,ptr, seccnt,
 		       0, // master
 		       WAIT_CREATE_INDX_REQ,
 		       DICT_WAITFOR_TIMEOUT, 100,
@@ -4441,16 +4446,37 @@ NdbDictInterface::createEvent(class Ndb 
     evnt.m_attrListBitmask = evntConf->getAttrListBitmask();
     evnt.mi_type           = evntConf->getEventType();
     evnt.setTable(dataPtr);
+    if (!m_tableData.empty())
+    {
+      Uint32 len = m_tableData.length();
+      assert((len & 3) == 0);
+      len /= 4;
+      if (len <= evnt.m_attrListBitmask.getSizeInWords())
+      {
+        evnt.m_attrListBitmask.clear();
+        memcpy(evnt.m_attrListBitmask.rep.data, m_tableData.get_data(), 4*len);
+      }
+      else
+      {
+        memcpy(evnt.m_attrListBitmask.rep.data, m_tableData.get_data(),
+               4*evnt.m_attrListBitmask.getSizeInWords());
+      }
+    }
   } else {
     if ((Uint32) evnt.m_tableImpl->m_id         != evntConf->getTableId() ||
 	evnt.m_tableImpl->m_version    != evntConf->getTableVersion() ||
 	//evnt.m_attrListBitmask != evntConf->getAttrListBitmask() ||
 	evnt.mi_type           != evntConf->getEventType()) {
       ndbout_c("ERROR*************");
+      m_buffer.clear();
+      m_tableData.clear();
       ERR_RETURN(getNdbError(), 1);
     }
   }
 
+  m_buffer.clear();
+  m_tableData.clear();
+
   DBUG_RETURN(0);
 }
 
@@ -4686,6 +4712,7 @@ NdbDictInterface::execCREATE_EVNT_CONF(N
   DBUG_ENTER("NdbDictInterface::execCREATE_EVNT_CONF");
 
   m_buffer.clear();
+  m_tableData.clear();
   unsigned int len = signal->getLength() << 2;
   m_buffer.append((char *)&len, sizeof(len));
   m_buffer.append(signal->getDataPtr(), len);
@@ -4693,6 +4720,10 @@ NdbDictInterface::execCREATE_EVNT_CONF(N
   if (signal->m_noOfSections > 0) {
     m_buffer.append((char *)ptr[0].p, strlen((char *)ptr[0].p)+1);
   }
+  if (signal->m_noOfSections > 1)
+  {
+    m_tableData.append(ptr[1].p, 4 * ptr[1].sz);
+  }
 
   const CreateEvntConf * const createEvntConf=
     CAST_CONSTPTR(CreateEvntConf, signal->getDataPtr());

=== modified file 'storage/ndb/src/ndbapi/NdbOperationExec.cpp'
--- a/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2010-01-28 15:16:46 +0000
+++ b/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2010-05-03 04:49:08 +0000
@@ -626,7 +626,10 @@ NdbOperation::repack_read(Uint32 len)
      * or READ_PACKED
      * (Correct NdbRecAttrs will be used when data is received)
      */
-    assert(1+ MAXNROFATTRIBUTESINWORDS <= TcKeyReq::MaxAttrInfo);
+    if (all == false && ((1 + newlen) > TcKeyReq::MaxAttrInfo))
+    {
+      return save;
+    }
     
     theNdb->releaseSignals(cnt, theFirstATTRINFO, theCurrentATTRINFO);
     theFirstATTRINFO = 0;
@@ -640,7 +643,7 @@ NdbOperation::repack_read(Uint32 len)
     else  
     {
       AttributeHeader::init(ptr, AttributeHeader::READ_PACKED, 4*newlen);
-      memcpy(ptr + 1, &mask, 4*MAXNROFATTRIBUTESINWORDS);
+      memcpy(ptr + 1, &mask, 4*newlen);
       return 1+newlen;
     }
   }

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2010-04-29 14:52:05 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2010-05-03 04:49:08 +0000
@@ -410,6 +410,7 @@ ErrorBundle ErrorCodes[] = {
   { 749,  HA_WRONG_CREATE_OPTION, IE, "Primary Table in wrong state" },
   { 779,  HA_WRONG_CREATE_OPTION, SE, "Invalid undo buffer size" },
   { 791,  HA_WRONG_CREATE_OPTION, SE, "Too many total bits in bitfields" },
+  { 795,  DMEC, IE, "Out of LongMessageBuffer in DICT" },
   { 764,  HA_WRONG_CREATE_OPTION, SE, "Invalid extent size" },
   { 789,  HA_WRONG_CREATE_OPTION, AE, "Logfile group not found" },
   { 765,  DMEC, SE, "Out of filegroup records" },


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100503045326-r85pnah0x29abpjl.bundle
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas:3588 to 3589)Jonas Oreland3 May