List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:March 20 2012 7:36am
Subject:bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3838 to 3853)
View as plain text  
 3853 magnus.blaudd@stripped	2012-03-20 [merge]
      Merge

    modified:
      sql/ndb_mi.cc
 3852 Martin Skold	2012-03-19 [merge]
      Merged from 7.1

    modified:
      mysql-test/suite/ndb/r/ndb_alter_table_online.result
      mysql-test/suite/ndb/r/ndb_global_schema_lock.result
      mysql-test/suite/ndb/t/ndb_alter_table_online.test
      sql/ha_ndbcluster.cc
      storage/ndb/include/kernel/signaldata/ApiVersion.hpp
      storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp
      storage/ndb/include/kernel/signaldata/LqhKey.hpp
      storage/ndb/include/kernel/trigger_definitions.h
      storage/ndb/src/common/debugger/signaldata/ApiVersion.cpp
      storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
      storage/ndb/src/mgmsrv/MgmtSrvr.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/test/ndbapi/testIndex.cpp
 3851 Bernd Ocklin	2012-03-16
      set correct name on versioned configured mysql.spec file

    modified:
      cmake/make_dist.cmake.in
 3850 Bernd Ocklin	2012-03-16
      adopt rpm spec files and WiX to cluster

    modified:
      packaging/WiX/CPackWixConfig.cmake
      packaging/WiX/create_msi.cmake.in
      packaging/WiX/mysql_server.wxs.in
      support-files/CMakeLists.txt
      support-files/mysql.spec.sh
 3849 magnus.blaudd@stripped	2012-03-15
      ndb
       - don't specify which SSL library to use in storage/ndb/compile-cluster

    modified:
      storage/ndb/compile-cluster
 3848 magnus.blaudd@stripped	2012-03-15 [merge]
      Merge 7.1 -> 7.2

    modified:
      storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt
      storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp
      storage/ndb/src/ndbjtie/test/CMakeLists.txt
      storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp
 3847 John David Duncan	2012-03-14 [merge]
      Merge

    modified:
      storage/ndb/memcache/src/ndb_worker.cc
 3846 magnus.blaudd@stripped	2012-03-14 [merge]
      Merge 7.1 -> 7.2

    modified:
      storage/ndb/src/common/transporter/TransporterRegistry.cpp
      storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/restore.cpp
      storage/ndb/src/kernel/blocks/restore.hpp
      storage/ndb/test/ndbapi/bench/asyncGenerator.cpp
      storage/ndb/test/ndbapi/bench/dbPopulate.cpp
      storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp
      storage/ndb/test/ndbapi/bench/mainPopulate.cpp
      storage/ndb/test/ndbapi/bench/userInterface.cpp
      storage/ndb/test/src/NDBT_Tables.cpp
 3845 Frazer Clement	2012-03-13 [merge]
      Merge 7.1->7.2

    modified:
      storage/ndb/include/kernel/kernel_config_parameters.h
      storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
      storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
      storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
      storage/ndb/src/kernel/blocks/record_types.hpp
      storage/ndb/src/kernel/vm/Configuration.cpp
      storage/ndb/src/kernel/vm/DynArr256.cpp
      storage/ndb/src/kernel/vm/DynArr256.hpp
      storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp
 3844 magnus.blaudd@stripped	2012-03-13
      WL#6225 Adapt MySQL Custer to 5.6
       - New columns has been added to SHOW SLAVE STATUS 
       - Make test more resilient to MySQL Server changes by removing
         the call to SHOW SLAVE STATUS and instead use the suggested
         include files for checking that the slave thread has no error
         and are still running

    modified:
      mysql-test/suite/ndb_rpl/r/ndb_rpl_circular.result
      mysql-test/suite/ndb_rpl/t/ndb_rpl_circular.test
 3843 magnus.blaudd@stripped	2012-03-13 [merge]
      Merge 7.1 -> 7.2

    removed:
      storage/ndb/bin/
      storage/ndb/bin/.empty
      storage/ndb/bin/check-regression.sh
      storage/ndb/bin/makeTestPrograms_html.sh
 3842 Frazer Clement	2012-03-12 [merge]
      Merge 7.1->7.2

    modified:
      mysql-test/suite/ndb_rpl/t/disabled.def
      sql/ha_ndbcluster.cc
      sql/ndb_conflict.cc
      sql/ndb_conflict_trans.cc
      storage/ndb/test/ndbapi/bench/asyncGenerator.cpp
      storage/ndb/test/ndbapi/bench/dbPopulate.cpp
      storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp
      storage/ndb/test/ndbapi/bench/mainPopulate.cpp
      storage/ndb/test/ndbapi/bench/ndb_error.hpp
      storage/ndb/test/ndbapi/bench/testData.h
      storage/ndb/test/ndbapi/bench/userInterface.h
 3841 Jonas Oreland	2012-03-12 [merge]
      ndb - bump version to 7.2.6

 3840 Jonas Oreland	2012-03-12
      ndb - bump version to 7.2.6

    modified:
      VERSION
      storage/ndb/VERSION
 3839 Jonas Oreland	2012-03-12 {clone-mysql-5.5.20-ndb-7.2.5-src-build} [merge]
      ndb - merge 71 to 72

    modified:
      storage/ndb/src/kernel/vm/mt_thr_config.cpp
      storage/ndb/src/mgmsrv/ConfigInfo.cpp
 3838 Jonas Oreland	2012-03-12 [merge]
      ndb - merge 71 to 72

    modified:
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainFieldHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainFieldHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/KeyValueHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainFieldHandler.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainTypeHandler.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SmartValueHandler.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/ValueHandler.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/ValueHandlerFactory.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/store/Column.java
      storage/ndb/clusterj/clusterj-jdbc/src/main/java/com/mysql/clusterj/jdbc/ValueHandlerBatchingJDBCSetImpl.java
      storage/ndb/clusterj/clusterj-jdbc/src/main/java/com/mysql/clusterj/jdbc/ValueHandlerBindValuesImpl.java
      storage/ndb/clusterj/clusterj-jdbc/src/main/java/com/mysql/clusterj/jdbc/ValueHandlerImpl.java
      storage/ndb/clusterj/clusterj-openjpa/src/main/java/com/mysql/clusterj/openjpa/NdbOpenJPADomainTypeHandlerImpl.java
      storage/ndb/clusterj/clusterj-openjpa/src/main/java/com/mysql/clusterj/openjpa/NdbOpenJPAStoreManager.java
      storage/ndb/clusterj/clusterj-openjpa/src/main/java/com/mysql/clusterj/openjpa/NdbOpenJPAValueHandler.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/BlobTest.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/domaintypehandler/CrazyDomainTypeHandlerFactoryImpl.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/model/CharsetUtf8.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ColumnImpl.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordBlobImpl.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordImpl.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordOperationImpl.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerFactoryImpl.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerImpl.java
      storage/ndb/src/ndbjtie/CMakeLists.txt
=== modified file 'VERSION'
--- a/VERSION	2012-02-14 08:00:53 +0000
+++ b/VERSION	2012-03-12 12:21:42 +0000
@@ -1,4 +1,4 @@
 MYSQL_VERSION_MAJOR=5
 MYSQL_VERSION_MINOR=5
 MYSQL_VERSION_PATCH=20
-MYSQL_VERSION_EXTRA=-ndb-7.2.5
+MYSQL_VERSION_EXTRA=-ndb-7.2.6

=== modified file 'cmake/make_dist.cmake.in'
--- a/cmake/make_dist.cmake.in	2011-06-10 07:12:10 +0000
+++ b/cmake/make_dist.cmake.in	2012-03-16 08:38:40 +0000
@@ -120,8 +120,13 @@ CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/s
    ${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
 
 # Copy spec files
-CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/mysql.${VERSION}.spec
-   ${PACKAGE_DIR}/support-files/mysql.${VERSION}.spec COPYONLY)
+SET(SPECFILENAME "mysql.${VERSION}.spec")
+IF("${VERSION}" MATCHES "-ndb-")
+  STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
+  SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
+ENDIF()
+CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/${SPECFILENAME}
+   ${PACKAGE_DIR}/support-files/${SPECFILENAME} COPYONLY)
 
 # Add documentation, if user has specified where to find them
 IF(MYSQL_DOCS_LOCATION)

=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_online.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2011-06-22 11:29:27 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2012-03-19 12:09:39 +0000
@@ -641,3 +641,11 @@ alter online table t1 add column c502 va
 ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 14000. You have to change some columns to TEXT or BLOBs
 delete from t1;
 drop table t1;
+create table t1(a int(10) unsigned not null auto_increment,
+b varchar(20) default 'x',
+c varchar(20) default null,
+primary key (a) ) engine=ndbcluster;
+alter online table t1 add e varchar(20) default 'x' column_format dynamic;
+ERROR 42000: This version of MySQL doesn't yet support 'alter online table t1 add e varchar(20) default 'x' column_format dynamic'
+alter online table t1 add e varchar(20) default null column_format dynamic;
+drop table t1;

=== modified file 'mysql-test/suite/ndb/r/ndb_global_schema_lock.result'
--- a/mysql-test/suite/ndb/r/ndb_global_schema_lock.result	2011-03-28 07:34:23 +0000
+++ b/mysql-test/suite/ndb/r/ndb_global_schema_lock.result	2012-03-19 12:09:39 +0000
@@ -17,6 +17,8 @@ CREATE TABLE t3 LIKE t2;
 @ndb_schema_locks_count:=VARIABLE_VALUE-@ndb_init_schema_locks_count
 1
 ALTER TABLE t3 ADD COLUMN b int default NULL;
+Warnings:
+Warning	1478	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
 @ndb_schema_locks_count:=VARIABLE_VALUE-@ndb_init_schema_locks_count
 1
 INSERT INTO t2 VALUES(1);
@@ -73,6 +75,8 @@ ERROR HY000: Can't execute the given com
 CREATE TABLE t3 LIKE t10;
 ERROR HY000: Table 't3' was not locked with LOCK TABLES
 ALTER TABLE t10 ADD COLUMN b int default NULL;
+Warnings:
+Warning	1478	Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
 @ndb_schema_locks_count:=VARIABLE_VALUE-@ndb_init_schema_locks_count
 1
 TRUNCATE TABLE t10;

=== modified file 'mysql-test/suite/ndb/t/ndb_alter_table_online.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online.test	2011-06-22 08:20:35 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online.test	2012-03-19 12:09:39 +0000
@@ -689,3 +689,17 @@ alter online table t1 add column c502 va
 delete from t1;
 drop table t1;
 
+
+#
+# Bug #13830980 MYSQL COMPLAINS OF NOT SUPPORTING ALTER ONLINE EVEN WHEN VALID OPTIONS ARE USED
+#
+
+create table t1(a int(10) unsigned not null auto_increment,
+                b varchar(20) default 'x',
+                c varchar(20) default null,
+                primary key (a) ) engine=ndbcluster;
+
+--error ER_NOT_SUPPORTED_YET
+alter online table t1 add e varchar(20) default 'x' column_format dynamic;
+alter online table t1 add e varchar(20) default null column_format dynamic;
+drop table t1;

=== modified file 'mysql-test/suite/ndb_rpl/r/ndb_rpl_circular.result'
--- a/mysql-test/suite/ndb_rpl/r/ndb_rpl_circular.result	2011-09-21 10:57:59 +0000
+++ b/mysql-test/suite/ndb_rpl/r/ndb_rpl_circular.result	2012-03-13 08:52:15 +0000
@@ -11,48 +11,8 @@ SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
 2	3
-show slave status;;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	#
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-Replicate_Ignore_Server_Ids	
-Master_Server_Id	1
-Master_Bind	
+include/check_slave_no_error.inc
+include/check_slave_is_running.inc
 Slave Binlog contains all ops as log_slave_updates is on
 show variables like 'server_id';
 Variable_name	Value

=== modified file 'mysql-test/suite/ndb_rpl/t/disabled.def'
--- a/mysql-test/suite/ndb_rpl/t/disabled.def	2011-07-11 11:09:58 +0000
+++ b/mysql-test/suite/ndb_rpl/t/disabled.def	2012-03-12 16:23:57 +0000
@@ -11,7 +11,8 @@
 ##############################################################################
 
 ndb_rpl_ctype_ucs2_def : bug #34661 rpl_ndb_ctype_ucs2_def fails in 6.2
+ndb_rpl_conflict_load_epoch_trans : Not designed for determinism
 
 ndb_rpl_slave_lsu : SEAGULL ndb-force-binlog-format-statement
 ndb_rpl_slave_lsu_anyval : SEAGULL ndb-force-binlog-format-statement
-ndb_rpl_row_implicit_commit_binlog : SEAGULL ndb-force-binlog-format-statement
+ndb_rpl_row_implicit_commit_binlog : SEAGULL ndb-force-binlog-format-statement
\ No newline at end of file

=== modified file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_circular.test'
--- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular.test	2011-05-18 12:56:24 +0000
+++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_circular.test	2012-03-13 08:52:15 +0000
@@ -38,9 +38,10 @@ sync_slave_with_master master;
 --connection slave
 SELECT * FROM t1 ORDER BY a;
 #SELECT * FROM t2 ORDER BY a;
-# BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical show slave status;
+
+# Check slave has no errors and are running
+--source include/check_slave_no_error.inc
+--source include/check_slave_is_running.inc
 
 --echo Slave Binlog contains all ops as log_slave_updates is on
 show variables like 'server_id';

=== modified file 'packaging/WiX/CPackWixConfig.cmake'
--- a/packaging/WiX/CPackWixConfig.cmake	2011-06-30 15:46:53 +0000
+++ b/packaging/WiX/CPackWixConfig.cmake	2012-03-16 08:07:11 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 # 
 # 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
@@ -23,7 +23,7 @@ IF(ESSENTIALS)
  ENDIF()
 ELSE()
   SET(CPACK_COMPONENTS_USED 
-    "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries")
+    "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries;ClusterTools;ClusterDataNode;ClusterManagementServer;ClusterManagementClient")
 ENDIF()
 
 
@@ -111,6 +111,29 @@ SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "T
 SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)")
 SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2)
 
+#Feature "Cluster"
+SET(CPACK_COMPONENT_GROUP_CLUSTER_DISPLAY_NAME "MySQL Cluster")
+SET(CPACK_COMPONENT_GROUP_CLUSTER_DESCRIPTION "Installs MySQL Cluster")
+
+ #Subfeature "ClusterTools"
+ SET(CPACK_COMPONENT_CLUSTERTOOLS_GROUP "Cluster")
+ SET(CPACK_COMPONENT_CLUSTERTOOLS_DISPLAY_NAME "Cluster Tools")
+ SET(CPACK_COMPONENT_CLUSTERTOOLS_DESCRIPTION "Installs Cluster Tools")
+
+ #Subfeature "Cluster Storage Engines"
+ SET(CPACK_COMPONENT_CLUSTERDATANODE_GROUP "Cluster")
+ SET(CPACK_COMPONENT_CLUSTERDATANODE_DISPLAY_NAME "Cluster Storage Engines")
+ SET(CPACK_COMPONENT_CLUSTERDATANODE_DESCRIPTION "Installs Cluster Storage Engines")
+
+ #Subfeature "Cluster Management Server"
+ SET(CPACK_COMPONENT_CLUSTERMANAGEMENTSERVER_GROUP "Cluster")
+ SET(CPACK_COMPONENT_CLUSTERMANAGEMENTSERVER_DISPLAY_NAME "Cluster Management Server")
+ SET(CPACK_COMPONENT_CLUSTERMANAGEMENTSERVER_DESCRIPTION "Installs Cluster Management Server")
+
+ #Subfeature "Cluster Management Client"
+ SET(CPACK_COMPONENT_CLUSTERMANAGEMENTCLIENT_GROUP "Cluster")
+ SET(CPACK_COMPONENT_CLUSTERMANAGEMENTCLIENT_DISPLAY_NAME "Cluster Management Client")
+ SET(CPACK_COMPONENT_CLUSTERMANAGEMENTCLIENT_DESCRIPTION "Installs Cluster Management Client")
 
 #Feature Misc (hidden, installs only if everything is installed)
 SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1)

=== modified file 'packaging/WiX/create_msi.cmake.in'
--- a/packaging/WiX/create_msi.cmake.in	2011-06-30 15:46:53 +0000
+++ b/packaging/WiX/create_msi.cmake.in	2012-03-16 08:07:11 +0000
@@ -29,6 +29,12 @@ SET(WIXCA_LOCATION "@WIXCA_LOCATION@")
 SET(COPYING_RTF "@COPYING_RTF@")
 SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")
 SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")
+SET(PRODUCT_NAME "MySQL Cluster")
+SET(WIXCA_LOCATION "@CMAKE_BINARY_DIR@/packaging/WiX/ca/RelWithDebInfo/wixca.dll")
+
+# we use codes different from server codes
+SET(UPGRADE_ID "847b8aea-26b3-4440-8fc8-fa9b482a2603")
+SET(UPGRADE_CODE "847b8aea-26b3-4440-8fc8-fa9b482a2603")
 
 LIST(APPEND EXCLUDE_DIRS
      bin/debug

=== modified file 'packaging/WiX/mysql_server.wxs.in'
--- a/packaging/WiX/mysql_server.wxs.in	2011-06-30 15:46:53 +0000
+++ b/packaging/WiX/mysql_server.wxs.in	2012-03-16 08:07:11 +0000
@@ -20,15 +20,15 @@
 
   <Product 
     Id="*" 
-    UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
-    Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" 
+    UpgradeCode="@UPGRADE_CODE@"
+    Name="@PRODUCT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@" 
     Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@" 
     Language="1033" 
     Manufacturer="@MANUFACTURER@">
     
     <Package Id='*'
        Keywords='Installer'
-       Description="MySQL Database Server"
+       Description="@PRODUCT_NAME@"
        Manufacturer='@MANUFACTURER@'
        InstallerVersion='200'
        Languages='1033'
@@ -39,7 +39,7 @@
     <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
 
     <!-- Upgrade -->
-    <Upgrade Id="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3">
+    <Upgrade Id="@UPGRADE_ID@">
       <UpgradeVersion 
         Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
         IncludeMinimum="yes"
@@ -156,7 +156,7 @@
     <Directory Id='TARGETDIR' Name='SourceDir'>
       <Directory Id='@PlatformProgramFilesFolder@'>
         <Directory Id='directory.MySQL' Name='MySQL'>
-          <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>
+          <Directory Id='INSTALLDIR' Name='@PRODUCT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@'>
           </Directory>
         </Directory>
       </Directory>

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2012-03-07 12:38:54 +0000
+++ b/sql/ha_ndbcluster.cc	2012-03-19 12:09:39 +0000
@@ -912,6 +912,8 @@ check_completed_operations_pre_commit(Th
     const bool op_has_conflict_detection = (first->getCustomData() != NULL);
     if (!op_has_conflict_detection)
     {
+      DBUG_ASSERT(err.code != (int) error_op_after_refresh_op);
+
       /* 'Normal path' - ignore key (not) present, others are errors */
       if (err.classification != NdbError::NoError &&
           err.classification != NdbError::ConstraintViolation &&
@@ -958,15 +960,18 @@ check_completed_operations_pre_commit(Th
   {
     const NdbOperation* last_conflict_op = trans->getLastDefinedOperation();
 
+    NdbError nonMaskedError;
+    assert(nonMaskedError.code == 0);
+
     if (trans->execute(NdbTransaction::NoCommit,
                        NdbOperation::AO_IgnoreError,
                        thd_ndb->m_force_send))
     {
-      abort();
-      //err= trans->getNdbError();
+      /* Transaction execute failed, even with IgnoreError... */
+      nonMaskedError = trans->getNdbError();
+      assert(nonMaskedError.code != 0);
     }
-
-    if (trans->getNdbError().code)
+    else if (trans->getNdbError().code)
     {
       /* Check the result codes of the operations we added */
       const NdbOperation* conflict_op = NULL;
@@ -981,26 +986,34 @@ check_completed_operations_pre_commit(Th
         if ((err.code != 0) &&
             (err.code != (int) error_op_after_refresh_op))
         {
-          if (err.status == NdbError::TemporaryError)
-          {
-            /* Slave will roll back and retry entire transaction. */
-            ERR_RETURN(err);
-          }
-          else
-          {
-            char msg[FN_REFLEN];
-            my_snprintf(msg, sizeof(msg), "Executing extra operations for "
-                        "conflict handling hit Ndb error %d '%s'",
-                        err.code, err.message);
-            push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                                ER_EXCEPTIONS_WRITE_ERROR,
-                                ER(ER_EXCEPTIONS_WRITE_ERROR), msg);
-            /* Slave will stop replication. */
-            DBUG_RETURN(ER_EXCEPTIONS_WRITE_ERROR);
-          }
+          /* Found a real error, break out and handle it */
+          nonMaskedError = err;
+          break;
         }
       } while (conflict_op != last_conflict_op);
     }
+
+    /* Handle errors with extra conflict handling operations */
+    if (nonMaskedError.code != 0)
+    {
+      if (nonMaskedError.status == NdbError::TemporaryError)
+      {
+        /* Slave will roll back and retry entire transaction. */
+        ERR_RETURN(nonMaskedError);
+      }
+      else
+      {
+        char msg[FN_REFLEN];
+        my_snprintf(msg, sizeof(msg), "Executing extra operations for "
+                    "conflict handling hit Ndb error %d '%s'",
+                    nonMaskedError.code, nonMaskedError.message);
+        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                            ER_EXCEPTIONS_WRITE_ERROR,
+                            ER(ER_EXCEPTIONS_WRITE_ERROR), msg);
+        /* Slave will stop replication. */
+        DBUG_RETURN(ER_EXCEPTIONS_WRITE_ERROR);
+      }
+    }
   }
 #endif
   DBUG_RETURN(0);
@@ -1066,11 +1079,11 @@ ha_ndbcluster::release_completed_operati
   trans->releaseCompletedQueries();
 }
 
-int execute_no_commit(Thd_ndb *thd_ndb, NdbTransaction *trans,
+int execute_no_commit(THD* thd, Thd_ndb *thd_ndb, NdbTransaction *trans,
                       bool ignore_no_key,
                       uint *ignore_count= 0);
 inline
-int execute_no_commit(Thd_ndb *thd_ndb, NdbTransaction *trans,
+int execute_no_commit(THD* thd, Thd_ndb *thd_ndb, NdbTransaction *trans,
                       bool ignore_no_key,
                       uint *ignore_count)
 {
@@ -1081,18 +1094,35 @@ int execute_no_commit(Thd_ndb *thd_ndb, 
   thd_ndb->m_execute_count++;
   thd_ndb->m_unsent_bytes= 0;
   DBUG_PRINT("info", ("execute_count: %u", thd_ndb->m_execute_count));
-  if (trans->execute(NdbTransaction::NoCommit,
-                     NdbOperation::AO_IgnoreError,
-                     thd_ndb->m_force_send))
+  int rc= 0;
+  do
   {
-    DBUG_RETURN(-1);
+    if (trans->execute(NdbTransaction::NoCommit,
+                       NdbOperation::AO_IgnoreError,
+                       thd_ndb->m_force_send))
+    {
+      rc= -1;
+      break;
+    }
+    if (!ignore_no_key || trans->getNdbError().code == 0)
+    {
+      rc= trans->getNdbError().code;
+      break;
+    }
+
+    rc = check_completed_operations_pre_commit(thd_ndb, trans,
+                                               first, last,
+                                               ignore_count);
+  } while (0);
+
+  if (unlikely(thd->slave_thread &&
+               rc != 0))
+  {
+    g_ndb_slave_state.atTransactionAbort();
   }
-  if (!ignore_no_key || trans->getNdbError().code == 0)
-    DBUG_RETURN(trans->getNdbError().code);
 
-  DBUG_RETURN(check_completed_operations_pre_commit(thd_ndb, trans,
-                                                    first, last,
-                                                    ignore_count));
+  DBUG_PRINT("info", ("execute_no_commit rc is %d", rc));
+  DBUG_RETURN(rc);
 }
 
 int execute_commit(THD* thd, Thd_ndb *thd_ndb, NdbTransaction *trans,
@@ -1117,21 +1147,40 @@ int execute_commit(THD* thd, Thd_ndb *th
   thd_ndb->m_execute_count++;
   thd_ndb->m_unsent_bytes= 0;
   DBUG_PRINT("info", ("execute_count: %u", thd_ndb->m_execute_count));
-  if (trans->execute(NdbTransaction::Commit, ao, force_send))
+  int rc= 0;
+  do
   {
-    if (thd->slave_thread)
-      g_ndb_slave_state.atTransactionAbort();
-    DBUG_RETURN(-1);
-  }
-  /* Success of some sort */
+    if (trans->execute(NdbTransaction::Commit, ao, force_send))
+    {
+      rc= -1;
+      break;
+    }
+
+    if (!ignore_error || trans->getNdbError().code == 0)
+    {
+      rc= trans->getNdbError().code;
+      break;
+    }
+
+    rc= check_completed_operations(thd_ndb, trans, first, last,
+                                   ignore_count);
+  } while (0);
+
   if (thd->slave_thread)
   {
-    g_ndb_slave_state.atTransactionCommit();
+    if (likely(rc == 0))
+    {
+      /* Success */
+      g_ndb_slave_state.atTransactionCommit();
+    }
+    else
+    {
+      g_ndb_slave_state.atTransactionAbort();
+    }
   }
-  if (!ignore_error || trans->getNdbError().code == 0)
-    DBUG_RETURN(trans->getNdbError().code);
-  DBUG_RETURN(check_completed_operations(thd_ndb, trans, first, last,
-                                         ignore_count));
+
+  DBUG_PRINT("info", ("execute_commit rc is %d", rc));
+  DBUG_RETURN(rc);
 }
 
 inline
@@ -3042,7 +3091,7 @@ int ha_ndbcluster::ndb_pk_update_row(THD
       if (error != 0)
         ERR_RETURN(op->getNdbError());
     }
-    if (execute_no_commit(m_thd_ndb, trans, m_ignore_no_key) != 0) 
+    if (execute_no_commit(thd, m_thd_ndb, trans, m_ignore_no_key) != 0)
     {
       table->status= STATUS_NOT_FOUND;
       DBUG_RETURN(ndb_err(trans));
@@ -3448,7 +3497,7 @@ inline int ha_ndbcluster::fetch_next(Ndb
     */
     if (m_thd_ndb->m_unsent_bytes && m_blobs_pending)
     {
-      if (execute_no_commit(m_thd_ndb, trans, m_ignore_no_key) != 0)
+      if (execute_no_commit(table->in_use, m_thd_ndb, trans, m_ignore_no_key) != 0)
         DBUG_RETURN(ndb_err(trans));
     }
     
@@ -4062,7 +4111,7 @@ int ha_ndbcluster::ordered_index_scan(co
     m_thd_ndb->m_sorted_scan_count++;
   }
 
-  if (execute_no_commit(m_thd_ndb, trans, m_ignore_no_key) != 0)
+  if (execute_no_commit(table->in_use, m_thd_ndb, trans, m_ignore_no_key) != 0)
     DBUG_RETURN(ndb_err(trans));
   
   DBUG_RETURN(next_result(buf));
@@ -4226,7 +4275,7 @@ int ha_ndbcluster::full_table_scan(const
       ERR_RETURN(op->getNdbError());
   } // if (check_if_pushable(NdbQueryOperationDef::TableScan))
   
-  if (execute_no_commit(m_thd_ndb, trans, m_ignore_no_key) != 0)
+  if (execute_no_commit(table->in_use, m_thd_ndb, trans, m_ignore_no_key) != 0)
     DBUG_RETURN(ndb_err(trans));
   DBUG_PRINT("exit", ("Scan started successfully"));
   DBUG_RETURN(next_result(buf));
@@ -4439,6 +4488,15 @@ ha_ndbcluster::prepare_conflict_detectio
   conflict_handled = false;
 
   /*
+    Special check for apply_status table, as we really don't want
+    to do any special handling with it
+  */
+  if (unlikely(m_share == ndb_apply_status_share))
+  {
+    DBUG_RETURN(0);
+  }
+
+  /*
      Check transaction id first, as in transactional conflict detection,
      the transaction id is what eventually dictates whether an operation
      is applied or not.
@@ -4521,6 +4579,8 @@ ha_ndbcluster::prepare_conflict_detectio
                       "events received without transaction ids.  Check --ndb-log-transaction-id setting "
                       "on upstream Cluster.",
                       m_share->key);
+    /* This is a user error, but we want them to notice, so treat seriously */
+    DBUG_RETURN( ER_SLAVE_CORRUPT_EVENT );
   }
 
   /*
@@ -5472,14 +5532,14 @@ int ha_ndbcluster::exec_bulk_update(uint
   }
 
   uint ignore_count= 0;
-  if (execute_no_commit(m_thd_ndb, trans,
+  THD *thd= table->in_use;
+  if (execute_no_commit(thd, m_thd_ndb, trans,
                         m_ignore_no_key || m_read_before_write_removal_used,
                         &ignore_count) != 0)
   {
     no_uncommitted_rows_execute_failure();
     DBUG_RETURN(ndb_err(trans));
   }
-  THD *thd= table->in_use;
   if (!thd->slave_thread)
   {
     assert(m_rows_changed >= ignore_count);
@@ -5791,7 +5851,7 @@ int ha_ndbcluster::ndb_update_row(const 
       !(cursor || (batch_allowed && have_pk)) ||
       need_flush)
   {
-    if (execute_no_commit(m_thd_ndb, trans,
+    if (execute_no_commit(thd, m_thd_ndb, trans,
                           m_ignore_no_key || m_read_before_write_removal_used,
                           &ignore_count) != 0)
     {
@@ -5899,7 +5959,8 @@ int ha_ndbcluster::end_bulk_delete()
   }
 
   uint ignore_count= 0;
-  if (execute_no_commit(m_thd_ndb, trans,
+  THD *thd= table->in_use;
+  if (execute_no_commit(thd, m_thd_ndb, trans,
                         m_ignore_no_key || m_read_before_write_removal_used,
                         &ignore_count) != 0)
   {
@@ -5907,7 +5968,6 @@ int ha_ndbcluster::end_bulk_delete()
     DBUG_RETURN(ndb_err(trans));
   }
 
-  THD *thd= table->in_use;
   if (!thd->slave_thread)
   {
     assert(m_rows_deleted >= ignore_count);
@@ -6109,7 +6169,7 @@ int ha_ndbcluster::ndb_delete_row(const 
 
   // Execute delete operation
   uint ignore_count= 0;
-  if (execute_no_commit(m_thd_ndb, trans,
+  if (execute_no_commit(thd, m_thd_ndb, trans,
                         m_ignore_no_key || m_read_before_write_removal_used,
                         &ignore_count) != 0)
   {
@@ -6734,7 +6794,7 @@ int ha_ndbcluster::close_scan()
     */
     DBUG_PRINT("info", ("thd_ndb->m_unsent_bytes: %ld",
                         (long) m_thd_ndb->m_unsent_bytes));    
-    if (execute_no_commit(m_thd_ndb, trans, m_ignore_no_key) != 0)
+    if (execute_no_commit(table->in_use, m_thd_ndb, trans, m_ignore_no_key) != 0)
     {
       no_uncommitted_rows_execute_failure();
       DBUG_RETURN(ndb_err(trans));
@@ -7303,7 +7363,7 @@ ha_ndbcluster::flush_bulk_insert(bool al
   if (! (m_thd_ndb->trans_options & TNTO_TRANSACTIONS_OFF))
   {
     if (!allow_batch &&
-        execute_no_commit(m_thd_ndb, trans, m_ignore_no_key) != 0)
+        execute_no_commit(table->in_use, m_thd_ndb, trans, m_ignore_no_key) != 0)
     {
       no_uncommitted_rows_execute_failure();
       DBUG_RETURN(ndb_err(trans));
@@ -8147,7 +8207,7 @@ int ndbcluster_commit(handlerton *hton, 
     if (g_ndb_slave_state.conflict_flags & SCS_OPS_DEFINED)
     {
       if (thd_ndb->m_unsent_bytes)
-        res = execute_no_commit(thd_ndb, trans, TRUE);
+        res = execute_no_commit(thd, thd_ndb, trans, TRUE);
     }
 
     if (likely(res == 0))
@@ -15559,6 +15619,7 @@ HA_ALTER_FLAGS supported_alter_operation
     HA_ADD_UNIQUE_INDEX |
     HA_DROP_UNIQUE_INDEX |
     HA_ADD_COLUMN |
+    HA_COLUMN_DEFAULT_VALUE |
     HA_COLUMN_STORAGE |
     HA_COLUMN_FORMAT |
     HA_ADD_PARTITION |
@@ -15613,6 +15674,13 @@ int ha_ndbcluster::check_if_supported_al
     }
   }
 
+  if (alter_flags->is_set(HA_COLUMN_DEFAULT_VALUE) &&
+      !alter_flags->is_set(HA_ADD_COLUMN))
+  {
+    DBUG_PRINT("info", ("Altering default value is not supported"));
+    DBUG_RETURN(HA_ALTER_NOT_SUPPORTED);
+  }
+
   if ((*alter_flags & not_supported).is_set())
   {
 #ifndef DBUG_OFF
@@ -15642,13 +15710,14 @@ int ha_ndbcluster::check_if_supported_al
          Check that we are only adding columns
        */
        /*
-         HA_COLUMN_STORAGE & HA_COLUMN_FORMAT
+         HA_COLUMN_DEFAULT_VALUE & HA_COLUMN_STORAGE & HA_COLUMN_FORMAT
          are set if they are specified in an later cmd
          even if they're no change. This is probably a bug
          conclusion: add them to add_column-mask, so that we silently "accept" them
          In case of someone trying to change a column, the HA_CHANGE_COLUMN would be set
          which we don't support, so we will still return HA_ALTER_NOT_SUPPORTED in those cases
        */
+       add_column.set_bit(HA_COLUMN_DEFAULT_VALUE);
        add_column.set_bit(HA_COLUMN_STORAGE);
        add_column.set_bit(HA_COLUMN_FORMAT);
        if ((*alter_flags & ~add_column).is_set())

=== modified file 'sql/ndb_conflict.cc'
--- a/sql/ndb_conflict.cc	2012-01-31 13:19:19 +0000
+++ b/sql/ndb_conflict.cc	2012-03-12 16:23:57 +0000
@@ -248,6 +248,12 @@ st_ndb_slave_state::resetPerAttemptCount
 void
 st_ndb_slave_state::atTransactionAbort()
 {
+#ifdef HAVE_NDB_BINLOG
+  /* Reset any gathered transaction dependency information */
+  atEndTransConflictHandling();
+  trans_conflict_apply_state = SAS_NORMAL;
+#endif
+
   /* Reset current-transaction counters + state */
   resetPerAttemptCounters();
 }

=== modified file 'sql/ndb_conflict_trans.cc'
--- a/sql/ndb_conflict_trans.cc	2011-09-07 22:50:01 +0000
+++ b/sql/ndb_conflict_trans.cc	2012-03-12 15:16:41 +0000
@@ -401,6 +401,8 @@ track_operation(const NdbDictionary::Tab
                          packed_key_buff,
                          required_buff_size))
   {
+    if (!error_text)
+      error_text="track_operation : Failed packing key";
     DBUG_RETURN(-1);
   }
 
@@ -445,6 +447,8 @@ track_operation(const NdbDictionary::Tab
       */
       existing->updateRowTransactionId(newTransIdOnRow);
 
+      assert(res == 0 || error_text != NULL);
+
       DBUG_RETURN(res);
     }
     else
@@ -453,10 +457,18 @@ track_operation(const NdbDictionary::Tab
          How can we have two updates to the same row with the
          same transaction id?  Only if the transaction id
          is invalid (e.g. not set)
+         In normal cases with only one upstream master, each
+         distinct master user transaction will have a unique
+         id, and all operations on a row in that transaction
+         will be merged in TUP prior to emitting a SUMA
+         event.
+         This could be relaxed for more complex upstream
+         topologies, but acts as a sanity guard currently.
       */
       if (existingTransIdOnRow != InvalidTransactionId)
       {
         assert(false);
+        error_text= "Two row operations to same key sharing user transaction id";
         DBUG_RETURN(-1);
       }
     }

=== modified file 'sql/ndb_mi.cc'
--- a/sql/ndb_mi.cc	2011-09-09 09:30:43 +0000
+++ b/sql/ndb_mi.cc	2012-03-15 11:24:49 +0000
@@ -28,11 +28,13 @@ extern Master_info *active_mi;
 
 uint32 ndb_mi_get_master_server_id()
 {
+  DBUG_ASSERT (active_mi != NULL);
   return (uint32) active_mi->master_id;
 }
 
 const char* ndb_mi_get_group_master_log_name()
 {
+  DBUG_ASSERT (active_mi != NULL);
 #if MYSQL_VERSION_ID < 50600
   return active_mi->rli.group_master_log_name;
 #else
@@ -42,6 +44,7 @@ const char* ndb_mi_get_group_master_log_
 
 uint64 ndb_mi_get_group_master_log_pos()
 {
+  DBUG_ASSERT (active_mi != NULL);
 #if MYSQL_VERSION_ID < 50600
   return (uint64) active_mi->rli.group_master_log_pos;
 #else
@@ -51,6 +54,7 @@ uint64 ndb_mi_get_group_master_log_pos()
 
 uint64 ndb_mi_get_future_event_relay_log_pos()
 {
+  DBUG_ASSERT (active_mi != NULL);
 #if MYSQL_VERSION_ID < 50600
   return (uint64) active_mi->rli.future_event_relay_log_pos;
 #else
@@ -60,6 +64,7 @@ uint64 ndb_mi_get_future_event_relay_log
 
 uint64 ndb_mi_get_group_relay_log_pos()
 {
+  DBUG_ASSERT (active_mi != NULL);
 #if MYSQL_VERSION_ID < 50600
   return (uint64) active_mi->rli.group_relay_log_pos;
 #else
@@ -69,27 +74,44 @@ uint64 ndb_mi_get_group_relay_log_pos()
 
 bool ndb_mi_get_ignore_server_id(uint32 server_id)
 {
+  DBUG_ASSERT (active_mi != NULL);
   return (active_mi->shall_ignore_server_id(server_id) != 0);
 }
 
 uint32 ndb_mi_get_slave_run_id()
 {
+  DBUG_ASSERT (active_mi != NULL);
+#if MYSQL_VERSION_ID < 50600
   return active_mi->rli.slave_run_id;
+#else
+  return active_mi->rli->slave_run_id;
+#endif
 }
 
 bool ndb_mi_get_in_relay_log_statement(Relay_log_info* rli)
 {
+  DBUG_ASSERT (rli != NULL);
   return (rli->get_flag(Relay_log_info::IN_STMT) != 0);
 }
 
 ulong ndb_mi_get_relay_log_trans_retries()
 {
+  DBUG_ASSERT (active_mi != NULL);
+#if MYSQL_VERSION_ID < 50600
   return active_mi->rli.trans_retries;
+#else
+  return active_mi->rli->trans_retries;
+#endif
 }
 
 void ndb_mi_set_relay_log_trans_retries(ulong number)
 {
+  DBUG_ASSERT (active_mi != NULL);
+#if MYSQL_VERSION_ID < 50600
   active_mi->rli.trans_retries = number;
+#else
+  active_mi->rli->trans_retries = number;
+#endif
 }
 
 /* #ifdef HAVE_NDB_BINLOG */

=== modified file 'storage/ndb/VERSION'
--- a/storage/ndb/VERSION	2012-03-05 07:24:11 +0000
+++ b/storage/ndb/VERSION	2012-03-12 12:24:10 +0000
@@ -2,7 +2,7 @@
 # Should be updated when creating a new NDB version
 NDB_VERSION_MAJOR=7
 NDB_VERSION_MINOR=2
-NDB_VERSION_BUILD=5
+NDB_VERSION_BUILD=6
 NDB_VERSION_STATUS=""
 NDB_SHARED_LIB_VERSION_MAJOR=6
 NDB_SHARED_LIB_VERSION_MINOR=0

=== removed directory 'storage/ndb/bin'
=== removed file 'storage/ndb/bin/.empty'

=== removed file 'storage/ndb/bin/check-regression.sh'
--- a/storage/ndb/bin/check-regression.sh	2011-02-01 21:05:11 +0000
+++ b/storage/ndb/bin/check-regression.sh	1970-01-01 00:00:00 +0000
@@ -1,197 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2003, 2005 MySQL AB
-#  All rights reserved. Use is subject to license terms.
-#
-# 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; version 2 of the License.
-#
-# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
-
-# NAME
-#   check-regression.sh
-# 
-# SYNOPSIS
-#   check-regression.sh
-#
-# DESCRIPTION
-#
-# This scrip must be run before any major cvs checkins are done.
-# It will perform a number of regression tests to check that 
-# nothing is broken.
-#
-# OPTIONS
-#
-# EXAMPLES
-#   
-#   
-# ENVIRONMENT
-#   NDB_PROJ_HOME       Home dir for ndb
-#   verbose             verbose printouts
-#
-# FILES
-#   $NDB_PROJ_HOME/lib/funcs.sh  general shell script functions
-#
-#
-# SEE ALSO
-#   
-# DIAGNOSTICTS
-#   
-#   
-# VERSION   
-#   1.0
-#   
-# AUTHOR
-#   
-#
-
-. $NDB_PROJ_HOME/lib/funcs.sh    # Load some good stuff
-
-synopsis="check-regression.sh"
-progname=`basename $0`
-
-numOfTestsOK=0
-numOfTestsFailed=0
-
-LOG=check-regression.`date '+%Y-%m-%d'`
-
-executeTest()
-{
-    eval "$@" | tee -a $LOG
-
-    if [ $? -eq 0 ] 
-    then
-	echo "SUCCESS: $@"
-	numOfTestsOK=`expr $numOfTestsOK + 1`
-    else
-	echo "FAILED: $@"
-	numOfTestsFailed=`expr $numOfTestsFailed + 1`
-    fi
-}
-
-#
-# INFO 
-#
-trace "Starting: `date`"
-trace "NDB_PROJ_HOME = $NDB_PROJ_HOME"
-trace "NDB_TOP = $NDB_TOP"
-
-#
-# THE TESTS TO EXECUTE
-#
-
-# Testsuite: testDataBuffers
-# Number of tests: 1
-executeTest 'drop_tab ' TB00 TB01 TB02 TB03 TB04 TB05 TB06 TB07 TB08 TB09 TB10 TB11 TB12 TB13 TB14 TB15
-executeTest 'testDataBuffers'
-executeTest 'drop_tab ' TB00 TB01 TB02 TB03 TB04 TB05 TB06 TB07 TB08 TB09 TB10 TB11 TB12 TB13 TB14 TB15
-
-TABLES="T9 T13"
-
-# Testsuite: testBasic
-# Number of tests: 16
-executeTest 'testBasic -n PkInsert' $TABLES
-executeTest 'testBasic -n PkRead' $TABLES
-executeTest 'testBasic -n PkUpdate' $TABLES
-executeTest 'testBasic -n PkDelete' $TABLES
-#executeTest 'testBasic -n UpdateAndRead' 
-#executeTest 'testBasic -n PkReadAndLocker'
-#executeTest 'testBasic -n PkReadAndLocker2'
-#executeTest 'testBasic -n PkReadUpdateAndLocker'
-#executeTest 'testBasic -n ReadWithLocksAndInserts'
-#executeTest 'testBasic -n ReadConsistency'
-#executeTest 'testBasic -n PkInsertTwice'
-#executeTest 'testBasic -n Fill'
-#executeTest 'testBasic -n FillTwice'
-#executeTest 'testBasic -n NoCommitSleep'
-#executeTest 'testBasic -n NoCommit626'
-#executeTest 'testBasic -n NoCommitAndClose'
-
-# Testsuite: testBasicAsynch
-# Number of tests: 4
-executeTest 'testBasicAsynch -n PkInsertAsynch' $TABLES
-executeTest 'testBasicAsynch -n PkReadAsynch' $TABLES
-executeTest 'testBasicAsynch -n PkUpdateAsynch' $TABLES
-executeTest 'testBasicAsynch -n PkDeleteAsynch' $TABLES
-
-# Testsuite: testDict
-# Number of tests: 6
-#executeTest 'testDict -n CreateAndDrop'
-#executeTest 'testDict -n CreateAndDropWithData'
-#executeTest 'testDict -n CreateAndDropDuring'
-#executeTest 'testDict -n CreateInvalidTables'
-#executeTest 'testDict -n CreateTableWhenDbIsFull'
-#executeTest 'testDict -n CreateMaxTables'
-
-# Testsuite: testScan
-# Number of tests: 34
-#executeTest 'testScan -n ScanRead'
-#executeTest 'testScan -n ScanRead16'
-executeTest 'testScan -n ScanRead240' $TABLES
-executeTest 'testScan -n ScanUpdate' $TABLES
-executeTest 'testScan -n ScanUpdate2' $TABLES
-executeTest 'testScan -n ScanDelete' $TABLES
-executeTest 'testScan -n ScanDelete2' $TABLES
-#executeTest 'testScan -n ScanUpdateAndScanRead'
-#executeTest 'testScan -n ScanReadAndLocker'
-#executeTest 'testScan -n ScanReadAndPkRead'
-#executeTest 'testScan -n ScanRead488'
-#executeTest 'testScan -n ScanWithLocksAndInserts'
-#executeTest 'testScan -n ScanReadAbort'
-#executeTest 'testScan -n ScanReadAbort15'
-#executeTest 'testScan -n ScanReadAbort16'
-#executeTest 'testScan -n ScanUpdateAbort16'
-#executeTest 'testScan -n ScanReadAbort240'
-#executeTest 'testScan -n ScanReadRestart'
-#executeTest 'testScan -n ScanReadRestart16'
-#executeTest 'testScan -n ScanReadRestart32'
-#executeTest 'testScan -n ScanUpdateRestart'
-#executeTest 'testScan -n ScanUpdateRestart16'
-#executeTest 'testScan -n CheckGetValue'
-#executeTest 'testScan -n CloseWithoutStop'
-#executeTest 'testScan -n NextScanWhenNoMore'
-#executeTest 'testScan -n ExecuteScanWithoutOpenScan'
-#executeTest 'testScan -n OnlyOpenScanOnce'
-#executeTest 'testScan -n OnlyOneOpInScanTrans'
-#executeTest 'testScan -n OnlyOneOpBeforeOpenScan'
-#executeTest 'testScan -n OnlyOneScanPerTrans'
-#executeTest 'testScan -n NoCloseTransaction'
-#executeTest 'testScan -n CheckInactivityTimeOut'
-#executeTest 'testScan -n CheckInactivityBeforeClose'
-#executeTest 'testScan -n CheckAfterTerror'
-
-# Testsuite: testScanInterpreter
-# Number of tests: 1
-#executeTest 'testScanInterpreter -n ScanLessThan'
-
-TABLES="T6 T13"
-
-# Testsuite: testSystemRestart
-# Number of tests: 4
-executeTest 'testSystemRestart -l 1 -n SR1' $TABLES
-executeTest 'testSystemRestart -l 1 -n SR2' $TABLES
-#executeTest 'testSystemRestart -n SR_UNDO'
-#executeTest 'testSystemRestart -n SR_FULLDB'
-
-# TESTS FINISHED
-trace "Finished: `date`"
-
-#
-# TEST SUMMARY
-#
-if [ $numOfTestsFailed -eq 0 ] 
-then
-    echo "-- REGRESSION TEST SUCCESSFUL --"
-else
-    echo "-- REGRESSION TEST FAILED!! --"
-fi
-echo "Number of successful tests: $numOfTestsOK"
-echo "Number of failed tests    : $numOfTestsFailed"

=== removed file 'storage/ndb/bin/makeTestPrograms_html.sh'
--- a/storage/ndb/bin/makeTestPrograms_html.sh	2011-02-01 21:05:11 +0000
+++ b/storage/ndb/bin/makeTestPrograms_html.sh	1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2003, 2005 MySQL AB
-#  All rights reserved. Use is subject to license terms.
-#
-# 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; version 2 of the License.
-#
-# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
-
-rm $1
-touch $1
-echo "<table border="1" width=640>" >> $1
-echo "<tr>" >> $1
-echo "<td><b>Name</b></td><td>&nbsp;</td><td width="70%"><b>Description</b></td>" >> $1
-echo "</tr>" >> $1
-testBasic --print_html >> $1
-testBackup --print_html >> $1
-testBasicAsynch --print_html >> $1
-testDict --print_html >> $1
-testBank --print_html >> $1
-testIndex --print_html >> $1
-testNdbApi --print_html >> $1
-testNodeRestart --print_html >> $1
-testOperations --print_html >> $1
-testRestartGci --print_html >> $1
-testScan --print_html >> $1
-testScanInterpreter --print_html >> $1
-testSystemRestart --print_html >> $1
-echo "</table>" >> $1
-

=== modified file 'storage/ndb/compile-cluster'
--- a/storage/ndb/compile-cluster	2011-12-12 17:20:53 +0000
+++ b/storage/ndb/compile-cluster	2012-03-15 08:23:12 +0000
@@ -85,7 +85,7 @@ my $cmake_version_id;
   my @args;
   
   # Hardcoded options controlling how to build MySQL Server
-  push(@args, "-DWITH_SSL=bundled");
+  # push(@args, "-DWITH_SSL=bundled");
  
   if ($opt_debug)
   {

=== modified file 'storage/ndb/include/kernel/kernel_config_parameters.h'
--- a/storage/ndb/include/kernel/kernel_config_parameters.h	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/include/kernel/kernel_config_parameters.h	2012-03-13 15:18:24 +0000
@@ -21,8 +21,6 @@
 
 #define PRIVATE_BASE          14000
 
-#define CFG_ACC_DIR_RANGE     (PRIVATE_BASE +  1)
-#define CFG_ACC_DIR_ARRAY     (PRIVATE_BASE +  2)
 #define CFG_ACC_FRAGMENT      (PRIVATE_BASE +  3)
 #define CFG_ACC_OP_RECS       (PRIVATE_BASE +  4)
 #define CFG_ACC_OVERFLOW_RECS (PRIVATE_BASE +  5)

=== modified file 'storage/ndb/include/kernel/signaldata/ApiVersion.hpp'
--- a/storage/ndb/include/kernel/signaldata/ApiVersion.hpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/include/kernel/signaldata/ApiVersion.hpp	2012-03-19 12:09:39 +0000
@@ -62,7 +62,7 @@ class ApiVersionConf {
   Uint32 senderRef;
   Uint32 nodeId; //api node id
   Uint32 version; // Version of API node
-  Uint32 inet_addr;
+  Uint32 m_inet_addr; // The bare name "inet_addr" can conflict with arpa/inet.h
   Uint32 mysql_version; // MySQL version
 };
 

=== modified file 'storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp'
--- a/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp	2012-03-19 12:09:39 +0000
@@ -256,8 +256,8 @@ struct FireTrigConf
   static Uint32 getFiredCount(Uint32 v) {
     return NoOfFiredTriggers::getFiredCount(v);
   }
-  static Uint32 getDeferredBit(Uint32 v) {
-    return NoOfFiredTriggers::getDeferredBit(v);
+  static Uint32 getDeferredUKBit(Uint32 v) {
+    return NoOfFiredTriggers::getDeferredUKBit(v);
   }
   static void setDeferredBit(Uint32 & v) {
     NoOfFiredTriggers::setDeferredBit(v);

=== modified file 'storage/ndb/include/kernel/signaldata/LqhKey.hpp'
--- a/storage/ndb/include/kernel/signaldata/LqhKey.hpp	2011-09-02 09:16:56 +0000
+++ b/storage/ndb/include/kernel/signaldata/LqhKey.hpp	2012-03-19 12:09:39 +0000
@@ -715,8 +715,8 @@ private:
   static Uint32 getFiredCount(Uint32 v) {
     return NoOfFiredTriggers::getFiredCount(v);
   }
-  static Uint32 getDeferredBit(Uint32 v) {
-    return NoOfFiredTriggers::getDeferredBit(v);
+  static Uint32 getDeferredUKBit(Uint32 v) {
+    return NoOfFiredTriggers::getDeferredUKBit(v);
   }
   static void setDeferredBit(Uint32 & v) {
     NoOfFiredTriggers::setDeferredBit(v);

=== modified file 'storage/ndb/include/kernel/trigger_definitions.h'
--- a/storage/ndb/include/kernel/trigger_definitions.h	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/include/kernel/trigger_definitions.h	2012-03-19 12:09:39 +0000
@@ -198,16 +198,17 @@ struct TriggerInfo {
 
 struct NoOfFiredTriggers
 {
-  STATIC_CONST( DeferredBit = (Uint32(1) << 31) );
+  STATIC_CONST( DeferredUKBit = (Uint32(1) << 31) );
+  STATIC_CONST( DeferredBits = (DeferredUKBit));
 
   static Uint32 getFiredCount(Uint32 v) {
-    return v & ~(Uint32(DeferredBit));
+    return v & ~(Uint32(DeferredBits));
   }
-  static Uint32 getDeferredBit(Uint32 v) {
-    return (v & Uint32(DeferredBit)) != 0;
+  static Uint32 getDeferredUKBit(Uint32 v) {
+    return (v & Uint32(DeferredUKBit)) != 0;
   }
   static void setDeferredBit(Uint32 & v) {
-    v |= Uint32(DeferredBit);
+    v |= Uint32(DeferredUKBit);
   }
 };
 

=== modified file 'storage/ndb/memcache/src/ndb_worker.cc'
--- a/storage/ndb/memcache/src/ndb_worker.cc	2011-12-18 23:21:21 +0000
+++ b/storage/ndb/memcache/src/ndb_worker.cc	2012-03-15 03:21:12 +0000
@@ -458,8 +458,16 @@ op_status_t WorkerStep1::do_read() {
   Operation op(plan, OP_READ);
   setKeyForReading(op);
   
-  NdbOperation::LockMode lockmode = plan->canUseSimpleRead() ?
-    NdbOperation::LM_SimpleRead : NdbOperation::LM_Read;
+  NdbOperation::LockMode lockmode;
+  NdbTransaction::ExecType commitflag;
+  if(plan->canUseSimpleRead()) {
+    lockmode = NdbOperation::LM_SimpleRead;
+    commitflag = NdbTransaction::Commit;
+  }
+  else {
+    lockmode = NdbOperation::LM_Read;
+    commitflag = NdbTransaction::NoCommit;
+  }
   
   if(! op.readTuple(tx, lockmode)) {
     logger->log(LOG_WARNING, 0, "readTuple(): %s\n", tx->getNdbError().message);
@@ -470,7 +478,7 @@ op_status_t WorkerStep1::do_read() {
   /* Save the workitem in the transaction and prepare for async execution */ 
   wqitem->next_step = (void *) 
     (wqitem->base.use_ext_val ? worker_check_read : worker_finalize_read);
-  tx->executeAsynchPrepare(NdbTransaction::NoCommit, callback_main, (void *) wqitem);
+  tx->executeAsynchPrepare(commitflag, callback_main, (void *) wqitem);
   return op_async_prepared;  
 }
 

=== modified file 'storage/ndb/src/common/debugger/signaldata/ApiVersion.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/ApiVersion.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/ApiVersion.cpp	2012-03-19 12:09:39 +0000
@@ -46,6 +46,6 @@ printAPI_VERSION_CONF(FILE * output,
           " senderRef: (node: %d, block: %d), nodeId: %d\n" \
           " version: %d, mysql_version: %d, inet_addr: %d\n",
 	  refToNode(sig->senderRef), refToBlock(sig->senderRef),
-	  sig->nodeId, sig->version, sig->mysql_version, sig->inet_addr);
+	  sig->nodeId, sig->version, sig->mysql_version, sig->m_inet_addr);
   return true;
 }

=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-01-30 15:12:41 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-03-14 10:31:02 +0000
@@ -1257,7 +1257,7 @@ TransporterRegistry::poll_TCP(Uint32 tim
 
   recvdata.m_socket_poller.clear();
 
-  bool extra_socket = m_has_extra_wakeup_socket;
+  const bool extra_socket = m_has_extra_wakeup_socket;
   if (extra_socket && recvdata.m_transporters.get(0))
   {
     const NDB_SOCKET_TYPE socket = m_extra_wakeup_sockets[0];

=== modified file 'storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp	2011-12-01 13:47:41 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp	2012-03-13 15:18:24 +0000
@@ -25,6 +25,7 @@
 #endif
 
 #include <pc.hpp>
+#include <DynArr256.hpp>
 #include <SimulatedBlock.hpp>
 
 #ifdef DBACC_C
@@ -104,8 +105,6 @@ ndbout << "Ptr: " << ptr.p->word32 << " 
 #define ZDEFAULT_LIST 3
 #define ZWORDS_IN_PAGE 2048
 #define ZADDFRAG 0
-#define ZDIRARRAY 68
-#define ZDIRRANGESIZE 65
 //#define ZEMPTY_FRAGMENT 0
 #define ZFRAGMENTSIZE 64
 #define ZFIRSTTIME 1
@@ -155,6 +154,7 @@ ndbout << "Ptr: " << ptr.p->word32 << " 
 #define ZREL_ROOT_FRAG 5
 #define ZREL_FRAG 6
 #define ZREL_DIR 7
+#define ZREL_ODIR 8
 
 /* ------------------------------------------------------------------------- */
 /* ERROR CODES                                                               */
@@ -181,6 +181,18 @@ ndbout << "Ptr: " << ptr.p->word32 << " 
 #define ZTO_OP_STATE_ERROR 631
 #define ZTOO_EARLY_ACCESS_ERROR 632
 #define ZDIR_RANGE_FULL_ERROR 633 // on fragment
+
+#if ZBUF_SIZE != ((1 << ZSHIFT_PLUS) - (1 << ZSHIFT_MINUS))
+#error ZBUF_SIZE != ((1 << ZSHIFT_PLUS) - (1 << ZSHIFT_MINUS))
+#endif
+
+static
+inline
+Uint32 mul_ZBUF_SIZE(Uint32 i)
+{
+  return (i << ZSHIFT_PLUS) - (i << ZSHIFT_MINUS);
+}
+
 #endif
 
 class ElementHeader {
@@ -306,24 +318,6 @@ enum State {
 // Records
 
 /* --------------------------------------------------------------------------------- */
-/* DIRECTORY RANGE                                                                   */
-/* --------------------------------------------------------------------------------- */
-  struct DirRange {
-    Uint32 dirArray[256];
-  }; /* p2c: size = 1024 bytes */
-  
-  typedef Ptr<DirRange> DirRangePtr;
-
-/* --------------------------------------------------------------------------------- */
-/* DIRECTORYARRAY                                                                    */
-/* --------------------------------------------------------------------------------- */
-struct Directoryarray {
-  Uint32 pagep[256];
-}; /* p2c: size = 1024 bytes */
-
-  typedef Ptr<Directoryarray> DirectoryarrayPtr;
-
-/* --------------------------------------------------------------------------------- */
 /* FRAGMENTREC. ALL INFORMATION ABOUT FRAMENT AND HASH TABLE IS SAVED IN FRAGMENT    */
 /*         REC  A POINTER TO FRAGMENT RECORD IS SAVED IN ROOTFRAGMENTREC FRAGMENT    */
 /* --------------------------------------------------------------------------------- */
@@ -356,7 +350,6 @@ struct Fragmentrec {
   Uint32 expReceiveIndex;
   Uint32 expReceiveForward;
   Uint32 expSenderDirIndex;
-  Uint32 expSenderDirptr;
   Uint32 expSenderIndex;
   Uint32 expSenderPageptr;
 
@@ -370,9 +363,8 @@ struct Fragmentrec {
 // in its turn references the pages) for the bucket pages and the overflow
 // bucket pages.
 //-----------------------------------------------------------------------------
-  Uint32 directory;
-  Uint32 dirsize;
-  Uint32 overflowdir;
+  DynArr256::Head directory;
+  DynArr256::Head overflowdir;
   Uint32 lastOverIndex;
 
 //-----------------------------------------------------------------------------
@@ -459,12 +451,10 @@ struct Fragmentrec {
 // hashcheckbit is the bit to check whether to send element to split bucket or not
 // k (== 6) is the number of buckets per page
 // lhfragbits is the number of bits used to calculate the fragment id
-// lhdirbits is the number of bits used to calculate the page id
 //-----------------------------------------------------------------------------
   Uint8 hashcheckbit;
   Uint8 k;
   Uint8 lhfragbits;
-  Uint8 lhdirbits;
 
 //-----------------------------------------------------------------------------
 // nodetype can only be STORED in this release. Is currently only set, never read
@@ -693,10 +683,7 @@ private:
   void releaseFragResources(Signal* signal, Uint32 fragIndex);
   void releaseRootFragRecord(Signal* signal, RootfragmentrecPtr rootPtr);
   void releaseRootFragResources(Signal* signal, Uint32 tableId);
-  void releaseDirResources(Signal* signal,
-                           Uint32 fragIndex,
-                           Uint32 dirIndex,
-                           Uint32 startIndex);
+  void releaseDirResources(Signal* signal);
   void releaseDirectoryResources(Signal* signal,
                                  Uint32 fragIndex,
                                  Uint32 dirIndex,
@@ -708,8 +695,6 @@ private:
   void initScanFragmentPart(Signal* signal);
   Uint32 checkScanExpand(Signal* signal);
   Uint32 checkScanShrink(Signal* signal);
-  void initialiseDirRec(Signal* signal);
-  void initialiseDirRangeRec(Signal* signal);
   void initialiseFragRec(Signal* signal);
   void initialiseFsConnectionRec(Signal* signal);
   void initialiseFsOpRec(Signal* signal);
@@ -777,6 +762,9 @@ private:
   void seizeRightlist(Signal* signal);
   Uint32 readTablePk(Uint32 lkey1, Uint32 lkey2, Uint32 eh, OperationrecPtr);
   Uint32 getElement(Signal* signal, OperationrecPtr& lockOwner);
+  Uint32 getPagePtr(DynArr256::Head&, Uint32);
+  bool setPagePtr(DynArr256::Head& directory, Uint32 index, Uint32 ptri);
+  Uint32 unsetPagePtr(DynArr256::Head& directory, Uint32 index);
   void getdirindex(Signal* signal);
   void commitdelete(Signal* signal);
   void deleteElement(Signal* signal);
@@ -810,17 +798,13 @@ private:
   void putOpInFragWaitQue(Signal* signal);
   void putOverflowRecInFrag(Signal* signal);
   void putRecInFreeOverdir(Signal* signal);
-  void releaseDirectory(Signal* signal);
-  void releaseDirrange(Signal* signal);
   void releaseFsConnRec(Signal* signal);
   void releaseFsOpRec(Signal* signal);
   void releaseOpRec(Signal* signal);
   void releaseOverflowRec(Signal* signal);
   void releaseOverpage(Signal* signal);
   void releasePage(Signal* signal);
-  void releaseLogicalPage(Fragmentrec * fragP, Uint32 logicalPageId);
   void seizeDirectory(Signal* signal);
-  void seizeDirrange(Signal* signal);
   void seizeFragrec(Signal* signal);
   void seizeFsConnectRec(Signal* signal);
   void seizeFsOpRec(Signal* signal);
@@ -871,27 +855,9 @@ private:
 
   // Variables
 /* --------------------------------------------------------------------------------- */
-/* DIRECTORY RANGE                                                                   */
+/* DIRECTORY                                                                         */
 /* --------------------------------------------------------------------------------- */
-  DirRange *dirRange;
-  DirRangePtr expDirRangePtr;
-  DirRangePtr gnsDirRangePtr;
-  DirRangePtr newDirRangePtr;
-  DirRangePtr rdDirRangePtr;
-  DirRangePtr nciOverflowrangeptr;
-  Uint32 cdirrangesize;
-  Uint32 cfirstfreeDirrange;
-/* --------------------------------------------------------------------------------- */
-/* DIRECTORYARRAY                                                                    */
-/* --------------------------------------------------------------------------------- */
-  Directoryarray *directoryarray;
-  DirectoryarrayPtr expDirptr;
-  DirectoryarrayPtr rdDirptr;
-  DirectoryarrayPtr sdDirptr;
-  DirectoryarrayPtr nciOverflowDirptr;
-  Uint32 cdirarraysize;
-  Uint32 cdirmemory;
-  Uint32 cfirstfreedir;
+  DynArr256Pool   directoryPool;
 /* --------------------------------------------------------------------------------- */
 /* FRAGMENTREC. ALL INFORMATION ABOUT FRAMENT AND HASH TABLE IS SAVED IN FRAGMENT    */
 /*         REC  A POINTER TO FRAGMENT RECORD IS SAVED IN ROOTFRAGMENTREC FRAGMENT    */

=== modified file 'storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp	2011-12-01 10:45:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp	2012-03-13 11:57:27 +0000
@@ -24,18 +24,17 @@
 
 void Dbacc::initData() 
 {
-  cdirarraysize = ZDIRARRAY;
   coprecsize = ZOPRECSIZE;
   cpagesize = ZPAGESIZE;
   ctablesize = ZTABLESIZE;
   cfragmentsize = ZFRAGMENTSIZE;
-  cdirrangesize = ZDIRRANGESIZE;
   coverflowrecsize = ZOVERFLOWRECSIZE;
   cscanRecSize = ZSCAN_REC_SIZE;
 
-  
-  dirRange = 0;
-  directoryarray = 0;
+  Pool_context pc;
+  pc.m_block = this;
+  directoryPool.init(RT_DBACC_DIRECTORY, pc);
+
   fragmentrec = 0;
   operationrec = 0;
   overflowRecord = 0;
@@ -102,14 +101,6 @@ void Dbacc::initRecords() 
 					    sizeof(Operationrec),
 					    coprecsize);
 
-  dirRange = (DirRange*)allocRecord("DirRange",
-				    sizeof(DirRange), 
-				    cdirrangesize);
-
-  directoryarray = (Directoryarray*)allocRecord("Directoryarray",
-						sizeof(Directoryarray), 
-						cdirarraysize);
-
   fragmentrec = (Fragmentrec*)allocRecord("Fragmentrec",
 					  sizeof(Fragmentrec), 
 					  cfragmentsize);
@@ -166,16 +157,7 @@ Dbacc::Dbacc(Block_context& ctx, Uint32 
 
 #ifdef VM_TRACE
   {
-    void* tmp[] = { &expDirRangePtr,
-		    &gnsDirRangePtr,
-		    &newDirRangePtr,
-		    &rdDirRangePtr,
-		    &nciOverflowrangeptr,
-                    &expDirptr,
-                    &rdDirptr,
-                    &sdDirptr,
-                    &nciOverflowDirptr,
-                    &fragrecptr,
+    void* tmp[] = { &fragrecptr,
                     &operationRecPtr,
                     &idrOperationRecPtr,
                     &mlpqOperPtr,
@@ -231,14 +213,6 @@ Dbacc::Dbacc(Block_context& ctx, Uint32 
 
 Dbacc::~Dbacc() 
 {
-  deallocRecord((void **)&dirRange, "DirRange",
-		sizeof(DirRange), 
-		cdirrangesize);
-  
-  deallocRecord((void **)&directoryarray, "Directoryarray",
-		sizeof(Directoryarray), 
-		cdirarraysize);
-  
   deallocRecord((void **)&fragmentrec, "Fragmentrec",
 		sizeof(Fragmentrec), 
 		cfragmentsize);

=== modified file 'storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2011-12-23 17:07:44 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2012-03-13 15:18:24 +0000
@@ -99,12 +99,10 @@ void Dbacc::execCONTINUEB(Signal* signal
       break;
     }
   case ZREL_DIR:
+  case ZREL_ODIR:
     {
       jam();
-      Uint32 fragIndex = signal->theData[1];
-      Uint32 dirIndex = signal->theData[2];
-      Uint32 startIndex = signal->theData[3];
-      releaseDirResources(signal, fragIndex, dirIndex, startIndex);
+      releaseDirResources(signal);
       break;
     }
 
@@ -215,11 +213,9 @@ void Dbacc::initialiseRecordsLab(Signal*
     break;
   case 4:
     jam();
-    initialiseDirRec(signal);
     break;
   case 5:
     jam();
-    initialiseDirRangeRec(signal);
     break;
   case 6:
     jam();
@@ -296,8 +292,6 @@ void Dbacc::execREAD_CONFIG_REQ(Signal* 
     m_ctx.m_config.getOwnConfigIterator();
   ndbrequire(p != 0);
   
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_RANGE, &cdirrangesize));
-  ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_ARRAY, &cdirarraysize));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_FRAGMENT, &cfragmentsize));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_OP_RECS, &coprecsize));
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_OVERFLOW_RECS, 
@@ -336,48 +330,6 @@ void Dbacc::sttorrysignalLab(Signal* sig
 }//Dbacc::sttorrysignalLab()
 
 /* --------------------------------------------------------------------------------- */
-/* INITIALISE_DIR_REC                                                                */
-/*              INITIALATES THE DIRECTORY RECORDS.                                   */
-/* --------------------------------------------------------------------------------- */
-void Dbacc::initialiseDirRec(Signal* signal) 
-{
-  DirectoryarrayPtr idrDirptr;
-  ndbrequire(cdirarraysize > 0);
-  for (idrDirptr.i = 0; idrDirptr.i < cdirarraysize; idrDirptr.i++) {
-    refresh_watch_dog();
-    ptrAss(idrDirptr, directoryarray);
-    for (Uint32 i = 0; i <= 255; i++) {
-      idrDirptr.p->pagep[i] = RNIL;
-    }//for
-  }//for
-  cdirmemory = 0;
-  cfirstfreedir = RNIL;
-}//Dbacc::initialiseDirRec()
-
-/* --------------------------------------------------------------------------------- */
-/* INITIALISE_DIR_RANGE_REC                                                          */
-/*              INITIALATES THE DIR_RANGE RECORDS.                                   */
-/* --------------------------------------------------------------------------------- */
-void Dbacc::initialiseDirRangeRec(Signal* signal) 
-{
-  DirRangePtr idrDirRangePtr;
-
-  ndbrequire(cdirrangesize > 0);
-  for (idrDirRangePtr.i = 0; idrDirRangePtr.i < cdirrangesize; idrDirRangePtr.i++) {
-    refresh_watch_dog();
-    ptrAss(idrDirRangePtr, dirRange);
-    idrDirRangePtr.p->dirArray[0] = idrDirRangePtr.i + 1;
-    for (Uint32 i = 1; i < 256; i++) {
-      idrDirRangePtr.p->dirArray[i] = RNIL;
-    }//for
-  }//for
-  idrDirRangePtr.i = cdirrangesize - 1;
-  ptrAss(idrDirRangePtr, dirRange);
-  idrDirRangePtr.p->dirArray[0] = RNIL;
-  cfirstfreeDirrange = 0;
-}//Dbacc::initialiseDirRangeRec()
-
-/* --------------------------------------------------------------------------------- */
 /* INITIALISE_FRAG_REC                                                               */
 /*              INITIALATES THE FRAGMENT RECORDS.                                    */
 /* --------------------------------------------------------------------------------- */
@@ -545,55 +497,22 @@ void Dbacc::execACCFRAGREQ(Signal* signa
     addFragRefuse(signal, ZFULL_FRAGRECORD_ERROR);
     return;
   }//if
-  if (cfirstfreeDirrange == RNIL) {
-    jam();
-    releaseFragRecord(signal, fragrecptr);
-    addFragRefuse(signal, ZDIR_RANGE_ERROR);
-    return;
-  } else {
-    jam();
-    seizeDirrange(signal);
-  }//if
-
-  fragrecptr.p->directory = newDirRangePtr.i;
-  seizeDirectory(signal);
-  if (tresult < ZLIMIT_OF_ERROR) {
-    jam();
-    newDirRangePtr.p->dirArray[0] = sdDirptr.i;
-  } else {
-    jam();
-    addFragRefuse(signal, tresult);
-    return;
-  }//if
-
   seizePage(signal);
   if (tresult > ZLIMIT_OF_ERROR) {
     jam();
     addFragRefuse(signal, tresult);
     return;
   }//if
-  sdDirptr.p->pagep[0] = spPageptr.i;
+  if (!setPagePtr(fragrecptr.p->directory, 0, spPageptr.i))
+  {
+    jam();
+    addFragRefuse(signal, ZDIR_RANGE_FULL_ERROR);
+    return;
+  }
+
   tipPageId = 0;
   inpPageptr = spPageptr;
   initPage(signal);
-  if (cfirstfreeDirrange == RNIL) {
-    jam();
-    addFragRefuse(signal, ZDIR_RANGE_ERROR);
-    return;
-  } else {
-    jam();
-    seizeDirrange(signal);
-  }//if
-  fragrecptr.p->overflowdir = newDirRangePtr.i;
-  seizeDirectory(signal);
-  if (tresult < ZLIMIT_OF_ERROR) {
-    jam();
-    newDirRangePtr.p->dirArray[0] = sdDirptr.i;
-  } else {
-    jam();
-    addFragRefuse(signal, tresult);
-    return;
-  }//if
 
   Uint32 userPtr = req->userPtr;
   BlockReference retRef = req->userRef;
@@ -723,14 +642,24 @@ void Dbacc::releaseFragResources(Signal*
   regFragPtr.i = fragIndex;
   ptrCheckGuard(regFragPtr, cfragmentsize, fragmentrec);
   verifyFragCorrect(regFragPtr);
-  if (regFragPtr.p->directory != RNIL) {
-    jam();
-    releaseDirResources(signal, regFragPtr.i, regFragPtr.p->directory, 0);
-    regFragPtr.p->directory = RNIL;
-  } else if (regFragPtr.p->overflowdir != RNIL) {
+  if (!regFragPtr.p->directory.isEmpty()) {
     jam();
-    releaseDirResources(signal, regFragPtr.i, regFragPtr.p->overflowdir, 0);
-    regFragPtr.p->overflowdir = RNIL;
+    DynArr256::ReleaseIterator iter;
+    DynArr256 dir(directoryPool, regFragPtr.p->directory);
+    dir.init(iter);
+    signal->theData[0] = ZREL_DIR;
+    signal->theData[1] = regFragPtr.i;
+    memcpy(&signal->theData[2], &iter, sizeof(iter));
+    sendSignal(cownBlockref, GSN_CONTINUEB, signal, 2 + sizeof(iter) / 4, JBB);
+  } else if (!regFragPtr.p->overflowdir.isEmpty()) {
+    jam();
+    DynArr256::ReleaseIterator iter;
+    DynArr256 dir(directoryPool, regFragPtr.p->overflowdir);
+    dir.init(iter);
+    signal->theData[0] = ZREL_ODIR;
+    signal->theData[1] = regFragPtr.i;
+    memcpy(&signal->theData[2], &iter, sizeof(iter));
+    sendSignal(cownBlockref, GSN_CONTINUEB, signal, 2 + sizeof(iter) / 4, JBB);
   } else if (regFragPtr.p->firstOverflowRec != RNIL) {
     jam();
     releaseOverflowResources(signal, regFragPtr);
@@ -752,58 +681,68 @@ void Dbacc::verifyFragCorrect(Fragmentre
   ndbrequire(regFragPtr.p->lockOwnersList == RNIL);
 }//Dbacc::verifyFragCorrect()
 
-void Dbacc::releaseDirResources(Signal* signal, 
-				Uint32 fragIndex, 
-				Uint32 dirIndex, 
-				Uint32 startIndex)
-{
-  DirRangePtr regDirRangePtr;
-  regDirRangePtr.i = dirIndex;
-  ptrCheckGuard(regDirRangePtr, cdirrangesize, dirRange);
-  for (Uint32 i = startIndex; i < 256; i++) {
-    jam();
-    if (regDirRangePtr.p->dirArray[i] != RNIL) {
-      jam();
-      Uint32 directoryIndex = regDirRangePtr.p->dirArray[i];
-      regDirRangePtr.p->dirArray[i] = RNIL;
-      releaseDirectoryResources(signal, fragIndex, dirIndex, (i + 1), directoryIndex);
-      return;
-    }//if
-  }//for
-  rdDirRangePtr = regDirRangePtr;
-  releaseDirrange(signal);
-  signal->theData[0] = ZREL_FRAG;
-  signal->theData[1] = fragIndex;
-  sendSignal(cownBlockref, GSN_CONTINUEB, signal, 2, JBB);
-}//Dbacc::releaseDirResources()
+void Dbacc::releaseDirResources(Signal* signal)
+{
+  jam();
+  Uint32 fragIndex = signal->theData[1];
+
+  DynArr256::ReleaseIterator iter;
+  memcpy(&iter, &signal->theData[2], sizeof(iter));
+
+  FragmentrecPtr regFragPtr;
+  regFragPtr.i = fragIndex;
+  ptrCheckGuard(regFragPtr, cfragmentsize, fragmentrec);
+  verifyFragCorrect(regFragPtr);
+
+  DynArr256::Head* directory;
+  switch (signal->theData[0])
+  {
+  case ZREL_DIR:
+    jam();
+    directory = &regFragPtr.p->directory;
+    break;
+  case ZREL_ODIR:
+    jam();
+    directory = &regFragPtr.p->overflowdir;
+    break;
+  default:
+    ndbrequire(false);
+  }
 
-void Dbacc::releaseDirectoryResources(Signal* signal,
-                                      Uint32 fragIndex,
-                                      Uint32 dirIndex,
-                                      Uint32 startIndex,
-                                      Uint32 directoryIndex)
-{
-  DirectoryarrayPtr regDirPtr;
-  regDirPtr.i = directoryIndex;
-  ptrCheckGuard(regDirPtr, cdirarraysize, directoryarray);
-  for (Uint32 i = 0; i < 256; i++) {
+  DynArr256 dir(directoryPool, *directory);
+  Uint32 ret;
+  Uint32 pagei;
+  /* TODO: find a good value for count
+   * bigger value means quicker release of big index,
+   * but longer time slice so less concurrent
+   */
+  int count = 10;
+  while (count > 0 &&
+         (ret = dir.release(iter, &pagei)) != 0)
+  {
     jam();
-    if (regDirPtr.p->pagep[i] != RNIL) {
+    count--;
+    if (ret == 1 && pagei != RNIL)
+    {
       jam();
-      rpPageptr.i = regDirPtr.p->pagep[i];
+      rpPageptr.i = pagei;
       ptrCheckGuard(rpPageptr, cpagesize, page8);
       releasePage(signal);
-      regDirPtr.p->pagep[i] = RNIL;
-    }//if
-  }//for
-  rdDirptr = regDirPtr;
-  releaseDirectory(signal);
-  signal->theData[0] = ZREL_DIR;
-  signal->theData[1] = fragIndex;
-  signal->theData[2] = dirIndex;
-  signal->theData[3] = startIndex;
-  sendSignal(cownBlockref, GSN_CONTINUEB, signal, 4, JBB);
-}//Dbacc::releaseDirectoryResources()
+    }
+  }
+  if (ret != 0)
+  {
+    jam();
+    memcpy(&signal->theData[2], &iter, sizeof(iter));
+    sendSignal(cownBlockref, GSN_CONTINUEB, signal, 2 + sizeof(iter) / 4, JBB);
+  }
+  else
+  {
+    jam();
+    signal->theData[0] = ZREL_FRAG;
+    sendSignal(cownBlockref, GSN_CONTINUEB, signal, 2, JBB);
+  }
+}//Dbacc::releaseDirResources()
 
 void Dbacc::releaseOverflowResources(Signal* signal, FragmentrecPtr regFragPtr)
 {
@@ -2662,8 +2601,6 @@ void Dbacc::execACC_LOCKREQ(Signal* sign
 /* --------------------------------------------------------------------------------- */
 void Dbacc::insertElement(Signal* signal) 
 {
-  DirRangePtr inrOverflowrangeptr;
-  DirectoryarrayPtr inrOverflowDirptr;
   OverflowRecordPtr inrOverflowRecPtr;
   Page8Ptr inrNewPageptr;
   Uint32 tinrNextSamePage;
@@ -2694,12 +2631,7 @@ void Dbacc::insertElement(Signal* signal
       if (tinrNextSamePage == ZFALSE) {
         jam();     /* NEXT CONTAINER IS IN AN OVERFLOW PAGE */
         tinrTmp = idrPageptr.p->word32[tidrContainerptr + 1];
-        inrOverflowrangeptr.i = fragrecptr.p->overflowdir;
-        ptrCheckGuard(inrOverflowrangeptr, cdirrangesize, dirRange);
-        arrGuard((tinrTmp >> 8), 256);
-        inrOverflowDirptr.i = inrOverflowrangeptr.p->dirArray[tinrTmp >> 8];
-        ptrCheckGuard(inrOverflowDirptr, cdirarraysize, directoryarray);
-        idrPageptr.i = inrOverflowDirptr.p->pagep[tinrTmp & 0xff];
+        idrPageptr.i = getPagePtr(fragrecptr.p->overflowdir, tinrTmp);
         ptrCheckGuard(idrPageptr, cpagesize, page8);
       }//if
       ndbrequire(tidrPageindex < ZEMPTYLIST);
@@ -2791,8 +2723,7 @@ void Dbacc::insertContainer(Signal* sign
   Uint32 guard26;
 
   tidrResult = ZFALSE;
-  tidrContainerptr = (tidrPageindex << ZSHIFT_PLUS) - (tidrPageindex << ZSHIFT_MINUS);
-  tidrContainerptr = tidrContainerptr + ZHEAD_SIZE;
+  tidrContainerptr = mul_ZBUF_SIZE(tidrPageindex) + ZHEAD_SIZE;
   /* --------------------------------------------------------------------------------- */
   /*       CALCULATE THE POINTER TO THE ELEMENT TO BE INSERTED AND THE POINTER TO THE  */
   /*       CONTAINER HEADER OF THE OTHER SIDE OF THE BUFFER.                           */
@@ -3027,7 +2958,7 @@ void Dbacc::seizeLeftlist(Signal* signal
   Uint32 tsllHeadIndex;
   Uint32 tsllTmp;
 
-  tsllHeadIndex = ((tslPageindex << ZSHIFT_PLUS) - (tslPageindex << ZSHIFT_MINUS)) + ZHEAD_SIZE;
+  tsllHeadIndex = mul_ZBUF_SIZE(tslPageindex) + ZHEAD_SIZE;
   arrGuard(tsllHeadIndex + 1, 2048);
   tslNextfree = slPageptr.p->word32[tsllHeadIndex];
   tslPrevfree = slPageptr.p->word32[tsllHeadIndex + 1];
@@ -3043,13 +2974,13 @@ void Dbacc::seizeLeftlist(Signal* signal
   } else {
     ndbrequire(tslPrevfree < ZEMPTYLIST);
     jam();
-    tsllTmp = ((tslPrevfree << ZSHIFT_PLUS) - (tslPrevfree << ZSHIFT_MINUS)) + ZHEAD_SIZE;
+    tsllTmp = mul_ZBUF_SIZE(tslPrevfree) + ZHEAD_SIZE;
     dbgWord32(slPageptr, tsllTmp, tslNextfree);
     slPageptr.p->word32[tsllTmp] = tslNextfree;
   }//if
   if (tslNextfree < ZEMPTYLIST) {
     jam();
-    tsllTmp = (((tslNextfree << ZSHIFT_PLUS) - (tslNextfree << ZSHIFT_MINUS)) + ZHEAD_SIZE) + 1;
+    tsllTmp = mul_ZBUF_SIZE(tslNextfree) + ZHEAD_SIZE + 1;
     dbgWord32(slPageptr, tsllTmp, tslPrevfree);
     slPageptr.p->word32[tsllTmp] = tslPrevfree;
   } else {
@@ -3084,7 +3015,7 @@ void Dbacc::seizeLeftlist(Signal* signal
     slPageptr.p->word32[ZPOS_EMPTY_LIST] = tsllTmp;
     if (tslNextfree < ZEMPTYLIST) {
       jam();
-      tsllTmp = ((tslNextfree << ZSHIFT_PLUS) - (tslNextfree << ZSHIFT_MINUS)) + ZHEAD_SIZE;
+      tsllTmp = mul_ZBUF_SIZE(tslNextfree) + ZHEAD_SIZE;
       tsllTmp1 = slPageptr.p->word32[tsllTmp] & 0xfe03ffff;
       tsllTmp1 = tsllTmp1 | (tslPageindex << 18);
       dbgWord32(slPageptr, tsllTmp, tsllTmp1);
@@ -3112,7 +3043,7 @@ void Dbacc::seizeRightlist(Signal* signa
   Uint32 tsrlHeadIndex;
   Uint32 tsrlTmp;
 
-  tsrlHeadIndex = ((tslPageindex << ZSHIFT_PLUS) - (tslPageindex << ZSHIFT_MINUS)) + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
+  tsrlHeadIndex = mul_ZBUF_SIZE(tslPageindex) + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
   arrGuard(tsrlHeadIndex + 1, 2048);
   tslNextfree = slPageptr.p->word32[tsrlHeadIndex];
   tslPrevfree = slPageptr.p->word32[tsrlHeadIndex + 1];
@@ -3124,13 +3055,13 @@ void Dbacc::seizeRightlist(Signal* signa
   } else {
     ndbrequire(tslPrevfree < ZEMPTYLIST);
     jam();
-    tsrlTmp = ((tslPrevfree << ZSHIFT_PLUS) - (tslPrevfree << ZSHIFT_MINUS)) + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
+    tsrlTmp = mul_ZBUF_SIZE(tslPrevfree) + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
     dbgWord32(slPageptr, tsrlTmp, tslNextfree);
     slPageptr.p->word32[tsrlTmp] = tslNextfree;
   }//if
   if (tslNextfree < ZEMPTYLIST) {
     jam();
-    tsrlTmp = ((tslNextfree << ZSHIFT_PLUS) - (tslNextfree << ZSHIFT_MINUS)) + ((ZHEAD_SIZE + ZBUF_SIZE) - (ZCON_HEAD_SIZE - 1));
+    tsrlTmp = mul_ZBUF_SIZE(tslNextfree) + ((ZHEAD_SIZE + ZBUF_SIZE) - (ZCON_HEAD_SIZE - 1));
     dbgWord32(slPageptr, tsrlTmp, tslPrevfree);
     slPageptr.p->word32[tsrlTmp] = tslPrevfree;
   } else {
@@ -3163,7 +3094,7 @@ void Dbacc::seizeRightlist(Signal* signa
     slPageptr.p->word32[ZPOS_EMPTY_LIST] = tsrlTmp | (tslPageindex << 16);
     if (tslNextfree < ZEMPTYLIST) {
       jam();
-      tsrlTmp = ((tslNextfree << ZSHIFT_PLUS) - (tslNextfree << ZSHIFT_MINUS)) + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
+      tsrlTmp = mul_ZBUF_SIZE(tslNextfree) + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
       tsrlTmp1 = slPageptr.p->word32[tsrlTmp] & 0xfe03ffff;
       dbgWord32(slPageptr, tsrlTmp, tsrlTmp1 | (tslPageindex << 18));
       slPageptr.p->word32[tsrlTmp] = tsrlTmp1 | (tslPageindex << 18);
@@ -3223,10 +3154,33 @@ void Dbacc::seizeRightlist(Signal* signa
 /*                     THE ADDRESS OF THE ELEMENT IN THE HASH TABLE,(GDI_PAGEPTR,    */
 /*                     TGDI_PAGEINDEX) ACCORDING TO LH3.                             */
 /* --------------------------------------------------------------------------------- */
+Uint32 Dbacc::getPagePtr(DynArr256::Head& directory, Uint32 index)
+{
+  DynArr256 dir(directoryPool, directory);
+  Uint32* ptr = dir.get(index);
+  return *ptr;
+}
+
+bool Dbacc::setPagePtr(DynArr256::Head& directory, Uint32 index, Uint32 ptri)
+{
+  DynArr256 dir(directoryPool, directory);
+  Uint32* ptr = dir.set(index);
+  if (ptr == NULL) return false;
+  *ptr = ptri;
+  return true;
+}
+
+Uint32 Dbacc::unsetPagePtr(DynArr256::Head& directory, Uint32 index)
+{
+  DynArr256 dir(directoryPool, directory);
+  Uint32* ptr = dir.get(index);
+  Uint32 ptri = *ptr;
+  *ptr = RNIL;
+  return ptri;
+}
+
 void Dbacc::getdirindex(Signal* signal) 
 {
-  DirRangePtr gdiDirRangePtr;
-  DirectoryarrayPtr gdiDirptr;
   Uint32 tgdiTmp;
   Uint32 tgdiAddress;
 
@@ -3235,17 +3189,12 @@ void Dbacc::getdirindex(Signal* signal) 
   tgdiTmp = operationRecPtr.p->hashValue >> tgdiTmp;
   tgdiTmp = (tgdiTmp << fragrecptr.p->k) | tgdiPageindex;
   tgdiAddress = tgdiTmp & fragrecptr.p->maxp;
-  gdiDirRangePtr.i = fragrecptr.p->directory;
-  ptrCheckGuard(gdiDirRangePtr, cdirrangesize, dirRange);
   if (tgdiAddress < fragrecptr.p->p) {
     jam();
     tgdiAddress = tgdiTmp & ((fragrecptr.p->maxp << 1) | 1);
   }//if
   tgdiTmp = tgdiAddress >> fragrecptr.p->k;
-  arrGuard((tgdiTmp >> 8), 256);
-  gdiDirptr.i = gdiDirRangePtr.p->dirArray[tgdiTmp >> 8];
-  ptrCheckGuard(gdiDirptr, cdirarraysize, directoryarray);
-  gdiPageptr.i = gdiDirptr.p->pagep[tgdiTmp & 0xff];	/* DIRECTORY INDEX OF SEND BUCKET PAGE */
+  gdiPageptr.i = getPagePtr(fragrecptr.p->directory, tgdiTmp);
   ptrCheckGuard(gdiPageptr, cpagesize, page8);
 }//Dbacc::getdirindex()
 
@@ -3318,15 +3267,12 @@ Uint32
 Dbacc::getElement(Signal* signal, OperationrecPtr& lockOwnerPtr) 
 {
   Uint32 errcode;
-  DirRangePtr geOverflowrangeptr;
-  DirectoryarrayPtr geOverflowDirptr;
   Uint32 tgeElementHeader;
   Uint32 tgeElemStep;
   Uint32 tgeContainerhead;
   Uint32 tgePageindex;
   Uint32 tgeActivePageDir;
   Uint32 tgeNextptrtype;
-  register Uint32 tgeKeyptr;
   register Uint32 tgeRemLen;
   register Uint32 TelemLen = fragrecptr.p->elementLength;
   register Uint32* Tkeydata = (Uint32*)&signal->theData[7];
@@ -3348,12 +3294,11 @@ Dbacc::getElement(Signal* signal, Operat
   const Uint32 tmp = fragrecptr.p->k + fragrecptr.p->lhfragbits;
   const Uint32 opHashValuePart = (operationRecPtr.p->hashValue >> tmp) &0xFFFF;
   do {
-    tgeContainerptr = (tgePageindex << ZSHIFT_PLUS) - (tgePageindex << ZSHIFT_MINUS);
+    tgeContainerptr = mul_ZBUF_SIZE(tgePageindex);
     if (tgeNextptrtype == ZLEFT) {
       jam();
       tgeContainerptr = tgeContainerptr + ZHEAD_SIZE;
       tgeElementptr = tgeContainerptr + ZCON_HEAD_SIZE;
-      tgeKeyptr = (tgeElementptr + ZELEM_HEAD_SIZE) + localkeylen;
       tgeElemStep = TelemLen;
       tgeForward = 1;
       if (unlikely(tgeContainerptr >= 2048)) 
@@ -3371,7 +3316,6 @@ Dbacc::getElement(Signal* signal, Operat
       jam();
       tgeContainerptr = tgeContainerptr + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
       tgeElementptr = tgeContainerptr - 1;
-      tgeKeyptr = (tgeElementptr - ZELEM_HEAD_SIZE) - localkeylen;
       tgeElemStep = 0 - TelemLen;
       tgeForward = (Uint32)-1;
       if (unlikely(tgeContainerptr >= 2048)) 
@@ -3475,12 +3419,7 @@ Dbacc::getElement(Signal* signal, Operat
     if (((tgeContainerhead >> 9) & 1) == ZFALSE) {
       jam();
       tgeActivePageDir = gePageptr.p->word32[tgeContainerptr + 1];	/* NEXT PAGE ID */
-      geOverflowrangeptr.i = fragrecptr.p->overflowdir;
-      ptrCheckGuard(geOverflowrangeptr, cdirrangesize, dirRange);
-      arrGuard((tgeActivePageDir >> 8), 256);
-      geOverflowDirptr.i = geOverflowrangeptr.p->dirArray[tgeActivePageDir >> 8];
-      ptrCheckGuard(geOverflowDirptr, cdirarraysize, directoryarray);
-      gePageptr.i = geOverflowDirptr.p->pagep[tgeActivePageDir & 0xff];
+      gePageptr.i = getPagePtr(fragrecptr.p->overflowdir, tgeActivePageDir);
       ptrCheckGuard(gePageptr, cpagesize, page8);
     }//if
   } while (1);
@@ -3555,7 +3494,7 @@ void Dbacc::commitdelete(Signal* signal)
   lastPageptr.i = gdiPageptr.i;
   lastPageptr.p = gdiPageptr.p;
   tlastForward = ZTRUE;
-  tlastContainerptr = (tlastPageindex << ZSHIFT_PLUS) - (tlastPageindex << ZSHIFT_MINUS);
+  tlastContainerptr = mul_ZBUF_SIZE(tlastPageindex);
   tlastContainerptr = tlastContainerptr + ZHEAD_SIZE;
   arrGuard(tlastContainerptr, 2048);
   tlastContainerhead = lastPageptr.p->word32[tlastContainerptr];
@@ -3685,8 +3624,6 @@ void Dbacc::deleteElement(Signal* signal
 /* --------------------------------------------------------------------------------- */
 void Dbacc::getLastAndRemove(Signal* signal) 
 {
-  DirRangePtr glrOverflowrangeptr;
-  DirectoryarrayPtr glrOverflowDirptr;
   Uint32 tglrHead;
   Uint32 tglrTmp;
 
@@ -3701,15 +3638,10 @@ void Dbacc::getLastAndRemove(Signal* sig
       jam();
       arrGuard(tlastContainerptr + 1, 2048);
       tglrTmp = lastPageptr.p->word32[tlastContainerptr + 1];
-      glrOverflowrangeptr.i = fragrecptr.p->overflowdir;
-      ptrCheckGuard(glrOverflowrangeptr, cdirrangesize, dirRange);
-      arrGuard((tglrTmp >> 8), 256);
-      glrOverflowDirptr.i = glrOverflowrangeptr.p->dirArray[tglrTmp >> 8];
-      ptrCheckGuard(glrOverflowDirptr, cdirarraysize, directoryarray);
-      lastPageptr.i = glrOverflowDirptr.p->pagep[tglrTmp & 0xff];
+      lastPageptr.i = getPagePtr(fragrecptr.p->overflowdir, tglrTmp);
       ptrCheckGuard(lastPageptr, cpagesize, page8);
     }//if
-    tlastContainerptr = (tlastPageindex << ZSHIFT_PLUS) - (tlastPageindex << ZSHIFT_MINUS);
+    tlastContainerptr = mul_ZBUF_SIZE(tlastPageindex);
     if (((tlastContainerhead >> 7) & 3) == ZLEFT) {
       jam();
       tlastForward = ZTRUE;
@@ -3827,7 +3759,7 @@ void Dbacc::releaseLeftlist(Signal* sign
     trlPrevused = (trlHead >> 18) & 0x7f;
     if (trlNextused < ZEMPTYLIST) {
       jam();
-      tullTmp1 = (trlNextused << ZSHIFT_PLUS) - (trlNextused << ZSHIFT_MINUS);
+      tullTmp1 = mul_ZBUF_SIZE(trlNextused);
       tullTmp1 = tullTmp1 + ZHEAD_SIZE;
       tullTmp = rlPageptr.p->word32[tullTmp1] & 0xfe03ffff;
       dbgWord32(rlPageptr, tullTmp1, tullTmp | (trlPrevused << 18));
@@ -3838,7 +3770,7 @@ void Dbacc::releaseLeftlist(Signal* sign
     }//if
     if (trlPrevused < ZEMPTYLIST) {
       jam();
-      tullTmp1 = (trlPrevused << ZSHIFT_PLUS) - (trlPrevused << ZSHIFT_MINUS);
+      tullTmp1 = mul_ZBUF_SIZE(trlPrevused);
       tullTmp1 = tullTmp1 + ZHEAD_SIZE;
       tullTmp = rlPageptr.p->word32[tullTmp1] & 0xfffc07ff;
       dbgWord32(rlPageptr, tullTmp1, tullTmp | (trlNextused << 11));
@@ -3863,7 +3795,7 @@ void Dbacc::releaseLeftlist(Signal* sign
   rlPageptr.p->word32[tullIndex] = tullTmp1;
   if (tullTmp1 < ZEMPTYLIST) {
     jam();
-    tullTmp1 = (tullTmp1 << ZSHIFT_PLUS) - (tullTmp1 << ZSHIFT_MINUS);
+    tullTmp1 = mul_ZBUF_SIZE(tullTmp1);
     tullTmp1 = (tullTmp1 + ZHEAD_SIZE) + 1;
     dbgWord32(rlPageptr, tullTmp1, trlPageindex);
     rlPageptr.p->word32[tullTmp1] = trlPageindex;	/* UPDATES PREV POINTER IN THE NEXT FREE */
@@ -3920,7 +3852,7 @@ void Dbacc::releaseRightlist(Signal* sig
     trlPrevused = (trlHead >> 18) & 0x7f;
     if (trlNextused < ZEMPTYLIST) {
       jam();
-      turlTmp1 = (trlNextused << ZSHIFT_PLUS) - (trlNextused << ZSHIFT_MINUS);
+      turlTmp1 = mul_ZBUF_SIZE(trlNextused);
       turlTmp1 = turlTmp1 + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
       turlTmp = rlPageptr.p->word32[turlTmp1] & 0xfe03ffff;
       dbgWord32(rlPageptr, turlTmp1, turlTmp | (trlPrevused << 18));
@@ -3931,7 +3863,7 @@ void Dbacc::releaseRightlist(Signal* sig
     }//if
     if (trlPrevused < ZEMPTYLIST) {
       jam();
-      turlTmp1 = (trlPrevused << ZSHIFT_PLUS) - (trlPrevused << ZSHIFT_MINUS);
+      turlTmp1 = mul_ZBUF_SIZE(trlPrevused);
       turlTmp1 = turlTmp1 + ((ZHEAD_SIZE + ZBUF_SIZE) - ZCON_HEAD_SIZE);
       turlTmp = rlPageptr.p->word32[turlTmp1] & 0xfffc07ff;
       dbgWord32(rlPageptr, turlTmp1, turlTmp | (trlNextused << 11));
@@ -3957,7 +3889,7 @@ void Dbacc::releaseRightlist(Signal* sig
   rlPageptr.p->word32[turlIndex] = turlTmp1;
   if (turlTmp1 < ZEMPTYLIST) {
     jam();
-    turlTmp = (turlTmp1 << ZSHIFT_PLUS) - (turlTmp1 << ZSHIFT_MINUS);
+    turlTmp = mul_ZBUF_SIZE(turlTmp1);
     turlTmp = turlTmp + ((ZHEAD_SIZE + ZBUF_SIZE) - (ZCON_HEAD_SIZE - 1));
     dbgWord32(rlPageptr, turlTmp, trlPageindex);
     rlPageptr.p->word32[turlTmp] = trlPageindex;	/* UPDATES PREV POINTER IN THE NEXT FREE */
@@ -5084,12 +5016,8 @@ void Dbacc::insertLockOwnersList(Signal*
 /* --------------------------------------------------------------------------------- */
 void Dbacc::allocOverflowPage(Signal* signal) 
 {
-  DirRangePtr aopDirRangePtr;
-  DirectoryarrayPtr aopOverflowDirptr;
   OverflowRecordPtr aopOverflowRecPtr;
   Uint32 taopTmp1;
-  Uint32 taopTmp2;
-  Uint32 taopTmp3;
 
   tresult = 0;
   if (cfirstfreepage == RNIL)
@@ -5112,11 +5040,6 @@ void Dbacc::allocOverflowPage(Signal* si
     jam();
     tresult = ZOVER_REC_ERROR;
     return;
-  } else if ((cfirstfreedir == RNIL) &&
-             (cdirarraysize <= cdirmemory)) {
-    jam();
-    tresult = ZDIRSIZE_ERROR;
-    return;
   } else {
     jam();
     seizeOverRec(signal);
@@ -5128,22 +5051,14 @@ void Dbacc::allocOverflowPage(Signal* si
   fragrecptr.p->firstOverflowRec = aopOverflowRecPtr.i;
   fragrecptr.p->lastOverflowRec = aopOverflowRecPtr.i;
   taopTmp1 = aopOverflowRecPtr.p->dirindex;
-  aopDirRangePtr.i = fragrecptr.p->overflowdir;
-  taopTmp2 = taopTmp1 >> 8;
-  taopTmp3 = taopTmp1 & 0xff;
-  ptrCheckGuard(aopDirRangePtr, cdirrangesize, dirRange);
-  arrGuard(taopTmp2, 256);
-  if (aopDirRangePtr.p->dirArray[taopTmp2] == RNIL) {
-    jam();
-    seizeDirectory(signal);
-    ndbrequire(tresult <= ZLIMIT_OF_ERROR);
-    aopDirRangePtr.p->dirArray[taopTmp2] = sdDirptr.i;
-  }//if
-  aopOverflowDirptr.i = aopDirRangePtr.p->dirArray[taopTmp2];
   seizePage(signal);
   ndbrequire(tresult <= ZLIMIT_OF_ERROR);
-  ptrCheckGuard(aopOverflowDirptr, cdirarraysize, directoryarray);
-  aopOverflowDirptr.p->pagep[taopTmp3] = spPageptr.i;
+  if (!setPagePtr(fragrecptr.p->overflowdir, taopTmp1, spPageptr.i))
+  {
+    jam();
+    tresult = ZOVER_REC_ERROR;
+  }
+  ndbrequire(tresult <= ZLIMIT_OF_ERROR);
   tiopPageId = aopOverflowRecPtr.p->dirindex;
   iopOverflowRecPtr = aopOverflowRecPtr;
   iopPageptr = spPageptr;
@@ -5189,8 +5104,6 @@ Uint32 Dbacc::checkScanExpand(Signal* si
   Uint32 TreleaseInd = 0;
   Uint32 TreleaseScanBucket;
   Uint32 TreleaseScanIndicator[MAX_PARALLEL_SCANS_PER_FRAG];
-  DirectoryarrayPtr TDirptr;
-  DirRangePtr TDirRangePtr;
   Page8Ptr TPageptr;
   ScanRecPtr TscanPtr;
 
@@ -5248,14 +5161,9 @@ Uint32 Dbacc::checkScanExpand(Signal* si
   }//for
   if (TreleaseInd == 1) {
     TreleaseScanBucket = TSplit;
-    TDirRangePtr.i = fragrecptr.p->directory;
     TPageIndex = TreleaseScanBucket & ((1 << fragrecptr.p->k) - 1);	/* PAGE INDEX OBS K = 6 */
     TDirInd = TreleaseScanBucket >> fragrecptr.p->k;	/* DIRECTORY INDEX OBS K = 6 */
-    ptrCheckGuard(TDirRangePtr, cdirrangesize, dirRange);
-    arrGuard((TDirInd >> 8), 256);
-    TDirptr.i = TDirRangePtr.p->dirArray[TDirInd >> 8];
-    ptrCheckGuard(TDirptr, cdirarraysize, directoryarray);
-    TPageptr.i = TDirptr.p->pagep[TDirInd & 0xff];
+    TPageptr.i = getPagePtr(fragrecptr.p->directory, TDirInd);
     ptrCheckGuard(TPageptr, cpagesize, page8);
     for (Ti = 0; Ti < MAX_PARALLEL_SCANS_PER_FRAG; Ti++) {
       if (TreleaseScanIndicator[Ti] == 1) {
@@ -5281,8 +5189,6 @@ void Dbacc::execEXPANDCHECK2(Signal* sig
     return;
   }
 
-  DirectoryarrayPtr newDirptr;
-
   fragrecptr.i = signal->theData[0];
   tresult = 0;	/* 0= FALSE,1= TRUE,> ZLIMIT_OF_ERROR =ERRORCODE */
   Uint32 tmp = 1;
@@ -5340,62 +5246,35 @@ void Dbacc::execEXPANDCHECK2(Signal* sig
   /*       THE NEXT HASH BIT. THIS BIT IS USED IN THE SPLIT MECHANISM TO      */
   /*       DECIDE WHICH ELEMENT GOES WHERE.                                   */
   /*--------------------------------------------------------------------------*/
-  expDirRangePtr.i = fragrecptr.p->directory;
   texpReceivedBucket = (fragrecptr.p->maxp + fragrecptr.p->p) + 1;	/* RECEIVED BUCKET */
   texpDirInd = texpReceivedBucket >> fragrecptr.p->k;
-  newDirptr.i = RNIL;
-  ptrNull(newDirptr);
-  texpDirRangeIndex = texpDirInd >> 8;
-  ptrCheckGuard(expDirRangePtr, cdirrangesize, dirRange);
-  Uint32 max_dir_range_size = (256 * (100 - m_free_pct)) / 100;
-  if (ERROR_INSERTED(3002)) {
-      debug_lh_vars("EXP");
-      max_dir_range_size = 2;
+  if ((texpReceivedBucket & ((1 << fragrecptr.p->k) - 1)) == 0)
+  { // Need new bucket
+    expPageptr.i = RNIL;
   }
-  if (texpDirRangeIndex >= max_dir_range_size) {
-    jam();
-    ndbrequire(texpDirRangeIndex == max_dir_range_size);
-    if (fragrecptr.p->dirRangeFull == ZFALSE) {
-      jam();
-      fragrecptr.p->dirRangeFull = ZTRUE;
-    }
-    return;
+  else
+  {
+    expPageptr.i = getPagePtr(fragrecptr.p->directory, texpDirInd);
+#ifdef VM_TRACE
+    require(expPageptr.i != RNIL);
+#endif
   }
-  expDirptr.i = expDirRangePtr.p->dirArray[texpDirRangeIndex];
-  if (expDirptr.i == RNIL) {
-    jam();
-    seizeDirectory(signal);
-    if (tresult > ZLIMIT_OF_ERROR) {
-      jam();
-      return;
-    } else {
-      jam();
-      newDirptr = sdDirptr;
-      expDirptr = sdDirptr;
-      expDirRangePtr.p->dirArray[texpDirRangeIndex] = sdDirptr.i;
-    }//if
-  } else {
-    ptrCheckGuard(expDirptr, cdirarraysize, directoryarray);
-  }//if
-  texpDirPageIndex = texpDirInd & 0xff;
-  expPageptr.i = expDirptr.p->pagep[texpDirPageIndex];
   if (expPageptr.i == RNIL) {
     jam();
     seizePage(signal);
     if (tresult > ZLIMIT_OF_ERROR) {
       jam();
-      if (newDirptr.i != RNIL) {
-        jam();
-        rdDirptr.i = newDirptr.i;
-        releaseDirectory(signal);
-      }//if
       return;
     }//if
-    expDirptr.p->pagep[texpDirPageIndex] = spPageptr.i;
+    if (!setPagePtr(fragrecptr.p->directory, texpDirInd, spPageptr.i))
+    {
+      jam();
+      tresult = ZDIR_RANGE_FULL_ERROR;
+      return;
+    }
     tipPageId = texpDirInd;
     inpPageptr = spPageptr;
     initPage(signal);
-    fragrecptr.p->dirsize++;
     expPageptr = spPageptr;
   } else {
     ptrCheckGuard(expPageptr, cpagesize, page8);
@@ -5407,14 +5286,12 @@ void Dbacc::execEXPANDCHECK2(Signal* sig
   /*       THE NEXT ACTION IS TO FIND THE PAGE, THE PAGE INDEX AND THE PAGE   */
   /*       DIRECTORY OF THE BUCKET TO BE SPLIT.                               */
   /*--------------------------------------------------------------------------*/
-  expDirRangePtr.i = fragrecptr.p->directory;
   cexcPageindex = fragrecptr.p->p & ((1 << fragrecptr.p->k) - 1);	/* PAGE INDEX OBS K = 6 */
   texpDirInd = fragrecptr.p->p >> fragrecptr.p->k;	/* DIRECTORY INDEX OBS K = 6 */
-  ptrCheckGuard(expDirRangePtr, cdirrangesize, dirRange);
-  arrGuard((texpDirInd >> 8), 256);
-  expDirptr.i = expDirRangePtr.p->dirArray[texpDirInd >> 8];
-  ptrCheckGuard(expDirptr, cdirarraysize, directoryarray);
-  excPageptr.i = expDirptr.p->pagep[texpDirInd & 0xff];
+  excPageptr.i = getPagePtr(fragrecptr.p->directory, texpDirInd);
+#ifdef VM_TRACE
+  require(excPageptr.i != RNIL);
+#endif
   fragrecptr.p->expSenderIndex = cexcPageindex;
   fragrecptr.p->expSenderPageptr = excPageptr.i;
   if (excPageptr.i == RNIL) {
@@ -5437,7 +5314,6 @@ void Dbacc::endofexpLab(Signal* signal) 
   if (fragrecptr.p->p > fragrecptr.p->maxp) {
     jam();
     fragrecptr.p->maxp = (fragrecptr.p->maxp << 1) | 1;
-    fragrecptr.p->lhdirbits++;
     fragrecptr.p->hashcheckbit++;
     fragrecptr.p->p = 0;
   }//if
@@ -5525,7 +5401,7 @@ void Dbacc::expandcontainer(Signal* sign
   cexcPrevconptr = 0;
   cexcForward = ZTRUE;
  EXP_CONTAINER_LOOP:
-  cexcContainerptr = (cexcPageindex << ZSHIFT_PLUS) - (cexcPageindex << ZSHIFT_MINUS);
+  cexcContainerptr = mul_ZBUF_SIZE(cexcPageindex);
   if (cexcForward == ZTRUE) {
     jam();
     cexcContainerptr = cexcContainerptr + ZHEAD_SIZE;
@@ -5727,8 +5603,6 @@ Uint32 Dbacc::checkScanShrink(Signal* si
   Uint32 TreleaseScanBucket;
   Uint32 TreleaseInd = 0;
   Uint32 TreleaseScanIndicator[MAX_PARALLEL_SCANS_PER_FRAG];
-  DirectoryarrayPtr TDirptr;
-  DirRangePtr TDirRangePtr;
   Page8Ptr TPageptr;
   ScanRecPtr TscanPtr;
 
@@ -5793,14 +5667,9 @@ Uint32 Dbacc::checkScanShrink(Signal* si
   if (TreleaseInd == 1) {
     jam();
     TreleaseScanBucket = TmergeSource;
-    TDirRangePtr.i = fragrecptr.p->directory;
     TPageIndex = TreleaseScanBucket & ((1 << fragrecptr.p->k) - 1);	/* PAGE INDEX OBS K = 6 */
     TDirInd = TreleaseScanBucket >> fragrecptr.p->k;	/* DIRECTORY INDEX OBS K = 6 */
-    ptrCheckGuard(TDirRangePtr, cdirrangesize, dirRange);
-    arrGuard((TDirInd >> 8), 256);
-    TDirptr.i = TDirRangePtr.p->dirArray[TDirInd >> 8];
-    ptrCheckGuard(TDirptr, cdirarraysize, directoryarray);
-    TPageptr.i = TDirptr.p->pagep[TDirInd & 0xff];
+    TPageptr.i = getPagePtr(fragrecptr.p->directory, TDirInd);
     ptrCheckGuard(TPageptr, cpagesize, page8);
     for (Ti = 0; Ti < MAX_PARALLEL_SCANS_PER_FRAG; Ti++) {
       if (TreleaseScanIndicator[Ti] == 1) {
@@ -5890,7 +5759,6 @@ void Dbacc::execSHRINKCHECK2(Signal* sig
     jam();
     fragrecptr.p->maxp = fragrecptr.p->maxp >> 1;
     fragrecptr.p->p = fragrecptr.p->maxp;
-    fragrecptr.p->lhdirbits--;
     fragrecptr.p->hashcheckbit--;
   } else {
     jam();
@@ -5908,17 +5776,9 @@ void Dbacc::execSHRINKCHECK2(Signal* sig
   /*       WE START BY FINDING THE NECESSARY INFORMATION OF THE BUCKET TO BE  */
   /*       REMOVED WHICH WILL SEND ITS ELEMENTS TO THE RECEIVING BUCKET.      */
   /*--------------------------------------------------------------------------*/
-  expDirRangePtr.i = fragrecptr.p->directory;
   cexcPageindex = ((fragrecptr.p->maxp + fragrecptr.p->p) + 1) & ((1 << fragrecptr.p->k) - 1);
   texpDirInd = ((fragrecptr.p->maxp + fragrecptr.p->p) + 1) >> fragrecptr.p->k;
-  texpDirRangeIndex = texpDirInd >> 8;
-  texpDirPageIndex = texpDirInd & 0xff;
-  ptrCheckGuard(expDirRangePtr, cdirrangesize, dirRange);
-  arrGuard(texpDirRangeIndex, 256);
-  expDirptr.i = expDirRangePtr.p->dirArray[texpDirRangeIndex];
-  ptrCheckGuard(expDirptr, cdirarraysize, directoryarray);
-  excPageptr.i = expDirptr.p->pagep[texpDirPageIndex];
-  fragrecptr.p->expSenderDirptr = expDirptr.i;
+  excPageptr.i = getPagePtr(fragrecptr.p->directory, texpDirInd);
   fragrecptr.p->expSenderIndex = cexcPageindex;
   fragrecptr.p->expSenderPageptr = excPageptr.i;
   fragrecptr.p->expSenderDirIndex = texpDirInd;
@@ -5926,13 +5786,8 @@ void Dbacc::execSHRINKCHECK2(Signal* sig
   /*       WE NOW PROCEED BY FINDING THE NECESSARY INFORMATION ABOUT THE      */
   /*       RECEIVING BUCKET.                                                  */
   /*--------------------------------------------------------------------------*/
-  expDirRangePtr.i = fragrecptr.p->directory;
   texpReceivedBucket = fragrecptr.p->p >> fragrecptr.p->k;
-  ptrCheckGuard(expDirRangePtr, cdirrangesize, dirRange);
-  arrGuard((texpReceivedBucket >> 8), 256);
-  expDirptr.i = expDirRangePtr.p->dirArray[texpReceivedBucket >> 8];
-  ptrCheckGuard(expDirptr, cdirarraysize, directoryarray);
-  fragrecptr.p->expReceivePageptr = expDirptr.p->pagep[texpReceivedBucket & 0xff];
+  fragrecptr.p->expReceivePageptr = getPagePtr(fragrecptr.p->directory, texpReceivedBucket);
   fragrecptr.p->expReceiveIndex = fragrecptr.p->p & ((1 << fragrecptr.p->k) - 1);
   fragrecptr.p->expReceiveForward = ZTRUE;
   if (excPageptr.i == RNIL) {
@@ -5945,7 +5800,7 @@ void Dbacc::execSHRINKCHECK2(Signal* sig
   /*--------------------------------------------------------------------------*/
   ptrCheckGuard(excPageptr, cpagesize, page8);
   cexcForward = ZTRUE;
-  cexcContainerptr = (cexcPageindex << ZSHIFT_PLUS) - (cexcPageindex << ZSHIFT_MINUS);
+  cexcContainerptr = mul_ZBUF_SIZE(cexcPageindex);
   cexcContainerptr = cexcContainerptr + ZHEAD_SIZE;
   arrGuard(cexcContainerptr, 2048);
   cexcContainerhead = excPageptr.p->word32[cexcContainerptr];
@@ -5979,7 +5834,7 @@ void Dbacc::execSHRINKCHECK2(Signal* sig
   }//if
   nextcontainerinfoExp(signal);
   do {
-    cexcContainerptr = (cexcPageindex << ZSHIFT_PLUS) - (cexcPageindex << ZSHIFT_MINUS);
+    cexcContainerptr = mul_ZBUF_SIZE(cexcPageindex);
     if (cexcForward == ZTRUE) {
       jam();
       cexcContainerptr = cexcContainerptr + ZHEAD_SIZE;
@@ -6043,24 +5898,29 @@ void Dbacc::endofshrinkbucketLab(Signal*
   fragrecptr.p->slack -= fragrecptr.p->maxloadfactor;
   if (fragrecptr.p->expSenderIndex == 0) {
     jam();
-    fragrecptr.p->dirsize--;
     if (fragrecptr.p->expSenderPageptr != RNIL) {
       jam();
       rpPageptr.i = fragrecptr.p->expSenderPageptr;
       ptrCheckGuard(rpPageptr, cpagesize, page8);
       releasePage(signal);
-      expDirptr.i = fragrecptr.p->expSenderDirptr;
-      ptrCheckGuard(expDirptr, cdirarraysize, directoryarray);
-      expDirptr.p->pagep[fragrecptr.p->expSenderDirIndex & 0xff] = RNIL;
+      unsetPagePtr(fragrecptr.p->directory, fragrecptr.p->expSenderDirIndex);
     }//if
     if (((((fragrecptr.p->p + fragrecptr.p->maxp) + 1) >> fragrecptr.p->k) & 0xff) == 0) {
       jam();
-      rdDirptr.i = fragrecptr.p->expSenderDirptr;
-      releaseDirectory(signal);
-      expDirRangePtr.i = fragrecptr.p->directory;
-      ptrCheckGuard(expDirRangePtr, cdirrangesize, dirRange);
-      arrGuard((fragrecptr.p->expSenderDirIndex >> 8), 256);
-      expDirRangePtr.p->dirArray[fragrecptr.p->expSenderDirIndex >> 8] = RNIL;
+      DynArr256 dir(directoryPool, fragrecptr.p->directory);
+      DynArr256::ReleaseIterator iter;
+      Uint32 relcode;
+#ifdef VM_TRACE
+      Uint32 count = 0;
+#endif
+      dir.init(iter);
+      while ((relcode = dir.trim(fragrecptr.p->expSenderDirIndex, iter)) != 0)
+      {
+#ifdef VM_TRACE
+        count++;
+        ndbrequire(count <= 256);
+#endif
+      }
     }//if
   }//if
   if (fragrecptr.p->slack < (1u << 31)) {
@@ -6215,12 +6075,7 @@ void Dbacc::nextcontainerinfoExp(Signal*
     /* NEXT CONTAINER IS IN AN OVERFLOW PAGE */
     arrGuard(cexcContainerptr + 1, 2048);
     tnciTmp = excPageptr.p->word32[cexcContainerptr + 1];
-    nciOverflowrangeptr.i = fragrecptr.p->overflowdir;
-    ptrCheckGuard(nciOverflowrangeptr, cdirrangesize, dirRange);
-    arrGuard((tnciTmp >> 8), 256);
-    nciOverflowDirptr.i = nciOverflowrangeptr.p->dirArray[tnciTmp >> 8];
-    ptrCheckGuard(nciOverflowDirptr, cdirarraysize, directoryarray);
-    excPageptr.i = nciOverflowDirptr.p->pagep[tnciTmp & 0xff];
+    excPageptr.i = getPagePtr(fragrecptr.p->overflowdir, tnciTmp);
     ptrCheckGuard(excPageptr, cpagesize, page8);
   }//if
 }//Dbacc::nextcontainerinfoExp()
@@ -6257,12 +6112,10 @@ void Dbacc::initFragAdd(Signal* signal,
   regFragPtr.p->maxloadfactor = maxLoadFactor;
   regFragPtr.p->slack = (regFragPtr.p->maxp + 1) * maxLoadFactor;
   regFragPtr.p->lhfragbits = lhFragBits;
-  regFragPtr.p->lhdirbits = 0;
   regFragPtr.p->hashcheckbit = 0; //lhFragBits;
   regFragPtr.p->localkeylen = req->localKeyLen;
   regFragPtr.p->nodetype = (req->reqInfo >> 4) & 0x3;
   regFragPtr.p->lastOverIndex = 0;
-  regFragPtr.p->dirsize = 1;
   regFragPtr.p->keyLength = req->keyLength;
   ndbrequire(req->keyLength != 0);
   regFragPtr.p->elementLength = ZELEM_HEAD_SIZE + regFragPtr.p->localkeylen;
@@ -6284,8 +6137,9 @@ void Dbacc::initFragAdd(Signal* signal,
 
 void Dbacc::initFragGeneral(FragmentrecPtr regFragPtr)
 {
-  regFragPtr.p->directory = RNIL;
-  regFragPtr.p->overflowdir = RNIL;
+  new (&regFragPtr.p->directory) DynArr256::Head();
+  new (&regFragPtr.p->overflowdir) DynArr256::Head();
+
   regFragPtr.p->firstOverflowRec = RNIL;
   regFragPtr.p->lastOverflowRec = RNIL;
   regFragPtr.p->lockOwnersList = RNIL;
@@ -6299,29 +6153,6 @@ void Dbacc::initFragGeneral(FragmentrecP
 }//Dbacc::initFragGeneral()
 
 
-void
-Dbacc::releaseLogicalPage(Fragmentrec * fragP, Uint32 logicalPageId){
-  Ptr<struct DirRange> dirRangePtr;
-  dirRangePtr.i = fragP->directory;
-  ptrCheckGuard(dirRangePtr, cdirrangesize, dirRange);
-
-  const Uint32 lp1 = logicalPageId >> 8;
-  const Uint32 lp2 = logicalPageId & 0xFF;
-  ndbrequire(lp1 < 256);
-
-  Ptr<struct Directoryarray> dirArrPtr;
-  dirArrPtr.i = dirRangePtr.p->dirArray[lp1];
-  ptrCheckGuard(dirArrPtr, cdirarraysize, directoryarray);
-
-  const Uint32 physicalPageId = dirArrPtr.p->pagep[lp2];
-  
-  rpPageptr.i = physicalPageId;
-  ptrCheckGuard(rpPageptr, cpagesize, page8);
-  releasePage(0);
-
-  dirArrPtr.p->pagep[lp2] = RNIL;
-}
-
 void Dbacc::execACC_SCANREQ(Signal* signal) 
 {
   jamEntry();
@@ -6464,9 +6295,6 @@ void Dbacc::execNEXT_SCANREQ(Signal* sig
 
 void Dbacc::checkNextBucketLab(Signal* signal) 
 {
-  DirRangePtr cscDirRangePtr;
-  DirectoryarrayPtr cscDirptr;
-  DirectoryarrayPtr tnsDirptr;
   Page8Ptr nsPageptr;
   Page8Ptr cscPageidptr;
   Page8Ptr gnsPageidptr;
@@ -6476,17 +6304,10 @@ void Dbacc::checkNextBucketLab(Signal* s
   Uint32 tnsIsLocked;
   Uint32 tnsTmp1;
   Uint32 tnsTmp2;
-  Uint32 tnsCopyIndex1;
-  Uint32 tnsCopyIndex2;
   Uint32 tnsCopyDir;
 
   tnsCopyDir = scanPtr.p->nextBucketIndex >> fragrecptr.p->k;
-  tnsCopyIndex1 = tnsCopyDir >> 8;
-  tnsCopyIndex2 = tnsCopyDir & 0xff;
-  arrGuard(tnsCopyIndex1, 256);
-  tnsDirptr.i = gnsDirRangePtr.p->dirArray[tnsCopyIndex1];
-  ptrCheckGuard(tnsDirptr, cdirarraysize, directoryarray);
-  tnsPageidptr.i = tnsDirptr.p->pagep[tnsCopyIndex2];
+  tnsPageidptr.i = getPagePtr(fragrecptr.p->directory, tnsCopyDir);
   ptrCheckGuard(tnsPageidptr, cpagesize, page8);
   gnsPageidptr.i = tnsPageidptr.i;
   gnsPageidptr.p = tnsPageidptr.p;
@@ -6561,15 +6382,8 @@ void Dbacc::checkNextBucketLab(Signal* s
         rsbPageidptr.p = gnsPageidptr.p;
       } else {
         jam();
-        cscDirRangePtr.i = fragrecptr.p->directory;
         tmpP = scanPtr.p->nextBucketIndex >> fragrecptr.p->k;
-        tmpP2 = tmpP >> 8;
-        tmpP = tmpP & 0xff;
-        ptrCheckGuard(cscDirRangePtr, cdirrangesize, dirRange);
-        arrGuard(tmpP2, 256);
-        cscDirptr.i = cscDirRangePtr.p->dirArray[tmpP2];
-        ptrCheckGuard(cscDirptr, cdirarraysize, directoryarray);
-        cscPageidptr.i = cscDirptr.p->pagep[tmpP];
+        cscPageidptr.i = getPagePtr(fragrecptr.p->directory, tmpP);
         ptrCheckGuard(cscPageidptr, cpagesize, page8);
         tmp1 = (1 << fragrecptr.p->k) - 1;
         trsbPageindex = scanPtr.p->nextBucketIndex & tmp1;
@@ -6696,8 +6510,6 @@ void Dbacc::checkNextFragmentLab(Signal*
 
 void Dbacc::initScanFragmentPart(Signal* signal)
 {
-  DirRangePtr cnfDirRangePtr;
-  DirectoryarrayPtr cnfDirptr;
   Page8Ptr cnfPageidptr;
   /* ----------------------------------------------------------------------- */
   // Set the active fragment part.
@@ -6714,11 +6526,7 @@ void Dbacc::initScanFragmentPart(Signal*
   scanPtr.p->startNoOfBuckets = fragrecptr.p->p + fragrecptr.p->maxp;
   scanPtr.p->minBucketIndexToRescan = 0xFFFFFFFF;
   scanPtr.p->maxBucketIndexToRescan = 0;
-  cnfDirRangePtr.i = fragrecptr.p->directory;
-  ptrCheckGuard(cnfDirRangePtr, cdirrangesize, dirRange);
-  cnfDirptr.i = cnfDirRangePtr.p->dirArray[0];
-  ptrCheckGuard(cnfDirptr, cdirarraysize, directoryarray);
-  cnfPageidptr.i = cnfDirptr.p->pagep[0];
+  cnfPageidptr.i = getPagePtr(fragrecptr.p->directory, 0);
   ptrCheckGuard(cnfPageidptr, cpagesize, page8);
   trsbPageindex = scanPtr.p->nextBucketIndex & ((1 << fragrecptr.p->k) - 1);
   rsbPageidptr.i = cnfPageidptr.i;
@@ -6939,8 +6747,6 @@ void Dbacc::execACC_CHECK_SCAN(Signal* s
 
   fragrecptr.i = scanPtr.p->activeLocalFrag;
   ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec);
-  gnsDirRangePtr.i = fragrecptr.p->directory;
-  ptrCheckGuard(gnsDirRangePtr, cdirrangesize, dirRange);
   checkNextBucketLab(signal);
   return;
 }//Dbacc::execACC_CHECK_SCAN()
@@ -6986,7 +6792,7 @@ void Dbacc::execACC_TO_REQ(Signal* signa
 /* --------------------------------------------------------------------------------- */
 void Dbacc::containerinfo(Signal* signal) 
 {
-  tciContainerptr = (tciPageindex << ZSHIFT_PLUS) - (tciPageindex << ZSHIFT_MINUS);
+  tciContainerptr = mul_ZBUF_SIZE(tciPageindex);
   if (tciIsforward == ZTRUE) {
     jam();
     tciContainerptr = tciContainerptr + ZHEAD_SIZE;
@@ -7125,12 +6931,7 @@ void Dbacc::nextcontainerinfo(Signal* si
     /* NEXT CONTAINER IS IN AN OVERFLOW PAGE */
     arrGuard(tnciContainerptr + 1, 2048);
     tnciTmp = nciPageidptr.p->word32[tnciContainerptr + 1];
-    nciOverflowrangeptr.i = fragrecptr.p->overflowdir;
-    ptrCheckGuard(nciOverflowrangeptr, cdirrangesize, dirRange);
-    arrGuard((tnciTmp >> 8), 256);
-    nciOverflowDirptr.i = nciOverflowrangeptr.p->dirArray[tnciTmp >> 8];
-    ptrCheckGuard(nciOverflowDirptr, cdirarraysize, directoryarray);
-    nciPageidptr.i = nciOverflowDirptr.p->pagep[tnciTmp & 0xff];
+    nciPageidptr.i = getPagePtr(fragrecptr.p->overflowdir, tnciTmp);
     ptrCheckGuard(nciPageidptr, cpagesize, page8);
   }//if
 }//Dbacc::nextcontainerinfo()
@@ -7873,26 +7674,6 @@ void Dbacc::putRecInFreeOverdir(Signal* 
 }//Dbacc::putRecInFreeOverdir()
 
 /* --------------------------------------------------------------------------------- */
-/* RELEASE_DIRECTORY                                                                 */
-/* --------------------------------------- ----------------------------------------- */
-void Dbacc::releaseDirectory(Signal* signal) 
-{
-  ptrCheckGuard(rdDirptr, cdirarraysize, directoryarray);
-  rdDirptr.p->pagep[0] = cfirstfreedir;
-  cfirstfreedir = rdDirptr.i;
-}//Dbacc::releaseDirectory()
-
-/* --------------------------------------------------------------------------------- */
-/* RELEASE_DIRRANGE                                                                  */
-/* --------------------------------------------------------------------------------- */
-void Dbacc::releaseDirrange(Signal* signal) 
-{
-  ptrCheckGuard(rdDirRangePtr, cdirrangesize, dirRange);
-  rdDirRangePtr.p->dirArray[0] = cfirstfreeDirrange;
-  cfirstfreeDirrange = rdDirRangePtr.i;
-}//Dbacc::releaseDirrange()
-
-/* --------------------------------------------------------------------------------- */
 /* RELEASE OP RECORD                                                                 */
 /*         PUT A FREE OPERATION IN A FREE LIST OF THE OPERATIONS                     */
 /* --------------------------------------------------------------------------------- */
@@ -7940,13 +7721,9 @@ void Dbacc::releaseOverflowRec(Signal* s
 /* --------------------------------------------------------------------------------- */
 void Dbacc::releaseOverpage(Signal* signal) 
 {
-  DirRangePtr ropOverflowrangeptr;
-  DirectoryarrayPtr ropOverflowDirptr;
   OverflowRecordPtr ropOverflowRecPtr;
   OverflowRecordPtr tuodOverflowRecPtr;
   Uint32 tropTmp;
-  Uint32 tropTmp1;
-  Uint32 tropTmp2;
 
   ropOverflowRecPtr.i = ropPageptr.p->word32[ZPOS_OVERFLOWREC];
   ndbrequire(ropOverflowRecPtr.i != RNIL);
@@ -7959,28 +7736,6 @@ void Dbacc::releaseOverpage(Signal* sign
     jam();
     return;	/* THERE IS ONLY ONE OVERFLOW PAGE */
   }//if
-#if kalle
-  logicalPage = 0;
-
-  i = fragrecptr.p->directory;
-  p = dirRange.getPtr(i);
-
-  i1 = logicalPage >> 8;
-  i2 = logicalPage & 0xFF;
-
-  ndbrequire(i1 < 256);
-  
-  i = p->dirArray[i1];
-  p = directoryarray.getPtr(i);
-
-  physicPageId = p->pagep[i2];
-  physicPageP = page8.getPtr(physicPageId);
-  
-  p->pagep[i2] = RNIL;
-  rpPageptr = { physicPageId, physicPageP };
-  releasePage(signal);
-  
-#endif
 
   /* ----------------------------------------------------------------------- */
   /* IT WAS OK TO RELEASE THE PAGE.                                          */
@@ -7992,14 +7747,7 @@ void Dbacc::releaseOverpage(Signal* sign
   priOverflowRecPtr = ropOverflowRecPtr;
   putRecInFreeOverdir(signal);
   tropTmp = ropPageptr.p->word32[ZPOS_PAGE_ID];
-  ropOverflowrangeptr.i = fragrecptr.p->overflowdir;
-  tropTmp1 = tropTmp >> 8;
-  tropTmp2 = tropTmp & 0xff;
-  ptrCheckGuard(ropOverflowrangeptr, cdirrangesize, dirRange);
-  arrGuard(tropTmp1, 256);
-  ropOverflowDirptr.i = ropOverflowrangeptr.p->dirArray[tropTmp1];
-  ptrCheckGuard(ropOverflowDirptr, cdirarraysize, directoryarray);
-  ropOverflowDirptr.p->pagep[tropTmp2] = RNIL;
+  unsetPagePtr(fragrecptr.p->overflowdir, tropTmp);
   rpPageptr = ropPageptr;
   releasePage(signal);
   if (ropOverflowRecPtr.p->dirindex != (fragrecptr.p->lastOverIndex - 1)) {
@@ -8010,23 +7758,12 @@ void Dbacc::releaseOverpage(Signal* sign
   /* THE LAST PAGE IN THE DIRECTORY WAS RELEASED IT IS NOW NECESSARY 
    * TO REMOVE ALL RELEASED OVERFLOW DIRECTORIES AT THE END OF THE LIST.   
    * ---------------------------------------------------------------------- */
-  do {
-    fragrecptr.p->lastOverIndex--;
-    if (tropTmp2 == 0) {
-      jam();
-      ndbrequire(tropTmp1 != 0);
-      ropOverflowrangeptr.p->dirArray[tropTmp1] = RNIL;
-      rdDirptr.i = ropOverflowDirptr.i;
-      releaseDirectory(signal);
-      tropTmp1--;
-      tropTmp2 = 255;
-    } else {
-      jam();
-      tropTmp2--;
-    }//if
-    ropOverflowDirptr.i = ropOverflowrangeptr.p->dirArray[tropTmp1];
-    ptrCheckGuard(ropOverflowDirptr, cdirarraysize, directoryarray);
-  } while (ropOverflowDirptr.p->pagep[tropTmp2] == RNIL);
+  DynArr256 dir(directoryPool, fragrecptr.p->overflowdir);
+  DynArr256::ReleaseIterator iter;
+  dir.init(iter);
+  Uint32 rc;
+  while ((rc = dir.trim(0, iter))!=0);
+  fragrecptr.p->lastOverIndex = iter.m_sz ? iter.m_pos + 1 : 0;
   /* ----------------------------------------------------------------------- */
   /* RELEASE ANY OVERFLOW RECORDS THAT ARE PART OF THE FREE INDEX LIST WHICH */
   /* DIRECTORY INDEX NOW HAS BEEN RELEASED.                                  */
@@ -8086,56 +7823,6 @@ void Dbacc::releasePage(Signal* signal) 
 }//Dbacc::releasePage()
 
 /* --------------------------------------------------------------------------------- */
-/* SEIZE_DIRECTORY                                                                   */
-/*          DESCRIPTION: A DIRECTORY BLOCK (ZDIRBLOCKSIZE NUMBERS OF DIRECTORY       */
-/*               RECORDS WILL BE ALLOCATED AND RETURNED.                             */
-/*               SIZE OF DIRECTORY ERROR_CODE, WILL BE RETURNED IF THERE IS NO ANY   */
-/*               FREE BLOCK                                                          */
-/* --------------------------------------------------------------------------------- */
-void Dbacc::seizeDirectory(Signal* signal) 
-{
-  Uint32 tsdyIndex;
-
-  if (cfirstfreedir == RNIL) {
-    jam();
-    if (cdirarraysize <= cdirmemory) {
-      jam();
-      tresult = ZDIRSIZE_ERROR;
-      return;
-    } else {
-      jam();
-      sdDirptr.i = cdirmemory;
-      ptrCheckGuard(sdDirptr, cdirarraysize, directoryarray);
-      cdirmemory = cdirmemory + 1;
-    }//if
-  } else {
-    jam();
-    sdDirptr.i = cfirstfreedir;
-    ptrCheckGuard(sdDirptr, cdirarraysize, directoryarray);
-    cfirstfreedir = sdDirptr.p->pagep[0];
-    sdDirptr.p->pagep[0] = RNIL;
-  }//if
-  for (tsdyIndex = 0; tsdyIndex <= 255; tsdyIndex++) {
-    sdDirptr.p->pagep[tsdyIndex] = RNIL;
-  }//for
-}//Dbacc::seizeDirectory()
-
-/* --------------------------------------------------------------------------------- */
-/* SEIZE_DIRRANGE                                                                    */
-/* --------------------------------------------------------------------------------- */
-void Dbacc::seizeDirrange(Signal* signal) 
-{
-  Uint32 tsdeIndex;
-
-  newDirRangePtr.i = cfirstfreeDirrange;
-  ptrCheckGuard(newDirRangePtr, cdirrangesize, dirRange);
-  cfirstfreeDirrange = newDirRangePtr.p->dirArray[0];
-  for (tsdeIndex = 0; tsdeIndex <= 255; tsdeIndex++) {
-    newDirRangePtr.p->dirArray[tsdeIndex] = RNIL;
-  }//for
-}//Dbacc::seizeDirrange()
-
-/* --------------------------------------------------------------------------------- */
 /* SEIZE    FRAGREC                                                                  */
 /* --------------------------------------------------------------------------------- */
 void Dbacc::seizeFragrec(Signal* signal) 

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2012-02-23 15:41:31 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2012-03-19 12:09:39 +0000
@@ -740,7 +740,7 @@ public:
       TF_EXEC_FLAG       = 4,
       TF_COMMIT_ACK_MARKER_RECEIVED = 8,
       TF_DEFERRED_CONSTRAINTS = 16, // check constraints in deferred fashion
-      TF_DEFERRED_TRIGGERS = 32, // trans has deferred triggers
+      TF_DEFERRED_UK_TRIGGERS = 32, // trans has deferred UK triggers
       TF_END = 0
     };
     Uint32 m_flags;
@@ -882,7 +882,7 @@ public:
       SOF_TRIGGER = 16,               // A trigger
       SOF_REORG_COPY = 32,
       SOF_REORG_DELETE = 64,
-      SOF_DEFERRED_TRIGGER = 128      // Op has deferred trigger
+      SOF_DEFERRED_UK_TRIGGER = 128   // Op has deferred trigger
     };
     
     static inline bool isIndexOp(Uint8 flags) {
@@ -1595,8 +1595,11 @@ private:
 			     TcConnectRecord* trigOp);
   void restoreTriggeringOpState(Signal* signal, 
 				TcConnectRecord* trigOp);
-  void trigger_op_finished(Signal* signal, ApiConnectRecordPtr,
-                           TcConnectRecord* triggeringOp);
+  void trigger_op_finished(Signal* signal,
+                           ApiConnectRecordPtr,
+                           Uint32 triggerPtrI,
+                           TcConnectRecord* triggeringOp,
+                           Uint32 returnCode);
   void continueTriggeringOp(Signal* signal, TcConnectRecord* trigOp);
 
   void executeTriggers(Signal* signal, ApiConnectRecordPtr* transPtr);

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2012-02-23 15:41:31 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2012-03-19 12:09:39 +0000
@@ -3537,7 +3537,7 @@ void Dbtc::attrinfoDihReceivedLab(Signal
       TcConnectRecordPtr opPtr;
       opPtr.i = trigOp;
       ptrCheckGuard(opPtr, ctcConnectFilesize, tcConnectRecord);
-      trigger_op_finished(signal, apiConnectptr, opPtr.p);
+      trigger_op_finished(signal, apiConnectptr, RNIL, opPtr.p, 0);
       return;
     }
     else
@@ -4291,7 +4291,7 @@ void Dbtc::execLQHKEYCONF(Signal* signal
   UintR Ttrans1 = lqhKeyConf->transId1;
   UintR Ttrans2 = lqhKeyConf->transId2;
   Uint32 noFired = LqhKeyConf::getFiredCount(lqhKeyConf->noFiredTriggers);
-  Uint32 deferred = LqhKeyConf::getDeferredBit(lqhKeyConf->noFiredTriggers);
+  Uint32 deferred = LqhKeyConf::getDeferredUKBit(lqhKeyConf->noFiredTriggers);
 
   if (TapiConnectptrIndex >= TapiConnectFilesize) {
     TCKEY_abort(signal, 29);
@@ -4348,9 +4348,9 @@ void Dbtc::execLQHKEYCONF(Signal* signal
   regTcPtr->lastLqhNodeId = refToNode(tlastLqhBlockref);
   regTcPtr->noFiredTriggers = noFired;
   regTcPtr->m_special_op_flags |= (deferred) ?
-    TcConnectRecord::SOF_DEFERRED_TRIGGER : 0;
+    TcConnectRecord::SOF_DEFERRED_UK_TRIGGER : 0;
   regApiPtr.p->m_flags |= (deferred) ?
-    ApiConnectRecord::TF_DEFERRED_TRIGGERS : 0;
+    ApiConnectRecord::TF_DEFERRED_UK_TRIGGERS : 0;
 
   UintR Ttckeyrec = (UintR)regApiPtr.p->tckeyrec;
   UintR TclientData = regTcPtr->clientData;
@@ -4516,30 +4516,20 @@ void Dbtc::execLQHKEYCONF(Signal* signal
 
   /**
    * And now decide what to do next
+   * 1) First check if there are fired triggers
+   * 2) Then check if it's a index-table read
+   * 3) Then check if op was created by trigger
+   * 4) Else it's a normal op
+   *
+   * - trigger op, can cause new trigger ops (cascade)
+   * - trigger op can be using uk
    */
-  if (regTcPtr->triggeringOperation != RNIL &&
-      !regApiPtr.p->isExecutingDeferredTriggers()) {
-    jam();
-    // This operation was created by a trigger execting operation
-    // Restart it if we have executed all it's triggers
-    TcConnectRecordPtr opPtr;
-
-    opPtr.i = regTcPtr->triggeringOperation;
-    ptrCheckGuard(opPtr, ctcConnectFilesize, localTcConnectRecord);
-    trigger_op_finished(signal, regApiPtr, opPtr.p);
-  } else if (noFired == 0) {
-    // This operation did not fire any triggers, finish operation
-    jam();
-    if (regTcPtr->isIndexOp(regTcPtr->m_special_op_flags)) {
-      jam();
-      setupIndexOpReturn(regApiPtr.p, regTcPtr);
-    }
-    lqhKeyConf_checkTransactionState(signal, regApiPtr);
-  } else {
+  if (noFired)
+  {
     // We have fired triggers
     jam();
     saveTriggeringOpState(signal, regTcPtr);
-    if (regTcPtr->noReceivedTriggers == noFired) 
+    if (regTcPtr->noReceivedTriggers == noFired)
     {
       // We have received all data
       jam();
@@ -4547,6 +4537,31 @@ void Dbtc::execLQHKEYCONF(Signal* signal
     }
     // else wait for more trigger data
   }
+  else if (regTcPtr->isIndexOp(regTcPtr->m_special_op_flags))
+  {
+    // This is a index-table read
+    jam();
+    setupIndexOpReturn(regApiPtr.p, regTcPtr);
+    lqhKeyConf_checkTransactionState(signal, regApiPtr);
+  }
+  else if (regTcPtr->triggeringOperation == RNIL)
+  {
+    // This is "normal" path
+    jam();
+    lqhKeyConf_checkTransactionState(signal, regApiPtr);
+  }
+  else
+  {
+    jam();
+    // This operation was created by a trigger execting operation
+    // Restart it if we have executed all it's triggers
+    TcConnectRecordPtr opPtr;
+
+    opPtr.i = regTcPtr->triggeringOperation;
+    ptrCheckGuard(opPtr, ctcConnectFilesize, localTcConnectRecord);
+    trigger_op_finished(signal, regApiPtr, regTcPtr->currentTriggerId,
+                        opPtr.p, 0);
+  }
 }//Dbtc::execLQHKEYCONF()
  
 void Dbtc::setupIndexOpReturn(ApiConnectRecord* regApiPtr,
@@ -4919,7 +4934,7 @@ void Dbtc::diverify010Lab(Signal* signal
     systemErrorLab(signal, __LINE__);
   }//if
 
-  if (tc_testbit(regApiPtr->m_flags, ApiConnectRecord::TF_DEFERRED_TRIGGERS))
+  if (tc_testbit(regApiPtr->m_flags, ApiConnectRecord::TF_DEFERRED_UK_TRIGGERS))
   {
     jam();
     /**
@@ -4927,7 +4942,7 @@ void Dbtc::diverify010Lab(Signal* signal
      *   transaction starts to commit
      */
     regApiPtr->pendingTriggers = 0;
-    tc_clearbit(regApiPtr->m_flags, ApiConnectRecord::TF_DEFERRED_TRIGGERS);
+    tc_clearbit(regApiPtr->m_flags, ApiConnectRecord::TF_DEFERRED_UK_TRIGGERS);
     sendFireTrigReq(signal, apiConnectptr, regApiPtr->firstTcConnect);
     return;
   }
@@ -5737,10 +5752,10 @@ Dbtc::sendFireTrigReq(Signal* signal,
 
     const Uint32 nextTcConnect = localTcConnectptr.p->nextTcConnect;
     Uint32 flags = localTcConnectptr.p->m_special_op_flags;
-    if (flags & TcConnectRecord::SOF_DEFERRED_TRIGGER)
+    if (flags & TcConnectRecord::SOF_DEFERRED_UK_TRIGGER)
     {
       jam();
-      tc_clearbit(flags, TcConnectRecord::SOF_DEFERRED_TRIGGER);
+      tc_clearbit(flags, TcConnectRecord::SOF_DEFERRED_UK_TRIGGER);
       ndbrequire(localTcConnectptr.p->tcConnectstate == OS_PREPARED);
       localTcConnectptr.p->tcConnectstate = OS_FIRE_TRIG_REQ;
       localTcConnectptr.p->m_special_op_flags = flags;
@@ -5894,13 +5909,13 @@ Dbtc::execFIRE_TRIG_CONF(Signal* signal)
   localTcConnectptr.p->tcConnectstate = OS_PREPARED;
 
   Uint32 noFired  = FireTrigConf::getFiredCount(conf->noFiredTriggers);
-  Uint32 deferred = FireTrigConf::getDeferredBit(conf->noFiredTriggers);
+  Uint32 deferreduk = FireTrigConf::getDeferredUKBit(conf->noFiredTriggers);
 
   regApiPtr.p->pendingTriggers += noFired;
-  regApiPtr.p->m_flags |= (deferred) ?
-    ApiConnectRecord::TF_DEFERRED_TRIGGERS : 0;
-  localTcConnectptr.p->m_special_op_flags |= (deferred) ?
-    TcConnectRecord::SOF_DEFERRED_TRIGGER : 0;
+  regApiPtr.p->m_flags |= (deferreduk) ?
+    ApiConnectRecord::TF_DEFERRED_UK_TRIGGERS : 0;
+  localTcConnectptr.p->m_special_op_flags |= (deferreduk) ?
+    TcConnectRecord::SOF_DEFERRED_UK_TRIGGER : 0;
 
   if (regApiPtr.p->pendingTriggers == 0)
   {
@@ -6349,7 +6364,7 @@ void Dbtc::execLQHKEYREF(Signal* signal)
         unlinkReadyTcCon(signal);
         releaseTcCon();
 
-        trigger_op_finished(signal, apiConnectptr, opPtr.p);
+        trigger_op_finished(signal, apiConnectptr, RNIL, opPtr.p, 0);
         return;
       }
       
@@ -15320,8 +15335,11 @@ void Dbtc::saveTriggeringOpState(Signal*
 }
 
 void
-Dbtc::trigger_op_finished(Signal* signal, ApiConnectRecordPtr regApiPtr,
-                          TcConnectRecord* triggeringOp)
+Dbtc::trigger_op_finished(Signal* signal,
+                          ApiConnectRecordPtr regApiPtr,
+                          Uint32 trigPtrI,
+                          TcConnectRecord* triggeringOp,
+                          Uint32 errCode)
 {
   if (!regApiPtr.p->isExecutingDeferredTriggers())
   {
@@ -15649,7 +15667,7 @@ void Dbtc::insertIntoIndexTable(Signal* 
     jam();
     ndbrequire(tc_testbit(regApiPtr->m_flags,
                           ApiConnectRecord::TF_DEFERRED_CONSTRAINTS));
-    trigger_op_finished(signal, *transPtr, opRecord);
+    trigger_op_finished(signal, *transPtr, RNIL, opRecord, 0);
     return;
   }
 
@@ -15685,7 +15703,7 @@ void Dbtc::insertIntoIndexTable(Signal* 
     {
       jam();
       releaseSection(keyIVal);
-      trigger_op_finished(signal, *transPtr, opRecord);
+      trigger_op_finished(signal, *transPtr, RNIL, opRecord, 0);
       return;
     }
     
@@ -15805,7 +15823,7 @@ void Dbtc::deleteFromIndexTable(Signal* 
     jam();
     ndbrequire(tc_testbit(regApiPtr->m_flags,
                           ApiConnectRecord::TF_DEFERRED_CONSTRAINTS));
-    trigger_op_finished(signal, *transPtr, opRecord);
+    trigger_op_finished(signal, *transPtr, RNIL, opRecord, 0);
     return;
   }
 
@@ -15830,7 +15848,7 @@ void Dbtc::deleteFromIndexTable(Signal* 
   {
     jam();
     releaseSection(keyIVal);
-    trigger_op_finished(signal, *transPtr, opRecord);
+    trigger_op_finished(signal, *transPtr, RNIL, opRecord, 0);
     return;
   }
 

=== modified file 'storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp'
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2012-02-23 15:41:31 +0000
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2012-03-19 12:09:39 +0000
@@ -3691,13 +3691,13 @@ Qmgr::execAPI_VERSION_REQ(Signal * signa
     conf->version = getNodeInfo(nodeId).m_version;
     conf->mysql_version = getNodeInfo(nodeId).m_mysql_version;
     struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId);
-    conf->inet_addr= in.s_addr;
+    conf->m_inet_addr= in.s_addr;
   }
   else
   {
     conf->version =  0;
     conf->mysql_version =  0;
-    conf->inet_addr= 0;
+    conf->m_inet_addr= 0;
   }
   conf->nodeId = nodeId;
 

=== modified file 'storage/ndb/src/kernel/blocks/record_types.hpp'
--- a/storage/ndb/src/kernel/blocks/record_types.hpp	2012-01-18 15:16:38 +0000
+++ b/storage/ndb/src/kernel/blocks/record_types.hpp	2012-03-13 15:18:24 +0000
@@ -94,6 +94,7 @@
 
 #define RT_DBTUP_PAGE              MAKE_TID( 1, RG_DATAMEM)
 #define RT_DBTUP_PAGE_MAP          MAKE_TID( 2, RG_DATAMEM)
+#define RT_DBACC_DIRECTORY         MAKE_TID( 3, RG_DATAMEM)
 
 #define RT_JOB_BUFFER              MAKE_TID( 1, RG_JOBBUFFER)
 

=== modified file 'storage/ndb/src/kernel/blocks/restore.cpp'
--- a/storage/ndb/src/kernel/blocks/restore.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/restore.cpp	2012-03-14 08:27:54 +0000
@@ -436,6 +436,7 @@ Restore::restore_next(Signal* signal, Fi
     Uint32 left= file_ptr.p->m_bytes_left;
     if(left < 8)
     {
+      jam();
       /**
        * Not enought bytes to read header
        */
@@ -448,18 +449,22 @@ Restore::restore_next(Signal* signal, Fi
     Uint32 pos= file_ptr.p->m_current_page_pos;
     if(status & File::READING_RECORDS)
     {
+      jam();
       /**
        * We are reading records
        */
       len= ntohl(* (page_ptr.p->data + pos)) + 1;
+      ndbrequire(len < GLOBAL_PAGE_SIZE_WORDS);
     }
     else
     {
+      jam();
       /**
        * Section length is in 2 word
        */
       if(pos + 1 == GLOBAL_PAGE_SIZE_WORDS)
       {
+        jam();
 	/**
 	 * But that's stored on next page...
 	 *   and since we have atleast 8 bytes left in buffer
@@ -473,18 +478,22 @@ Restore::restore_next(Signal* signal, Fi
       }
       else
       {
+        jam();
 	len= ntohl(* (page_ptr.p->data + pos + 1));
       }
     }
 
     if(file_ptr.p->m_status & File::FIRST_READ)
     {
+      jam();
       len= 3;
       file_ptr.p->m_status &= ~(Uint32)File::FIRST_READ;
     }
     
     if(4 * len > left)
     {
+      jam();
+
       /**
        * Not enought bytes to read "record"
        */
@@ -505,6 +514,7 @@ Restore::restore_next(Signal* signal, Fi
 
     if(pos + len >= GLOBAL_PAGE_SIZE_WORDS)
     {
+      jam();
       /**
        * But it's split over pages
        */
@@ -519,13 +529,73 @@ Restore::restore_next(Signal* signal, Fi
       file_ptr.p->m_current_page_pos = (pos + len) - GLOBAL_PAGE_SIZE_WORDS;
       file_ptr.p->m_current_page_index = 
 	(file_ptr.p->m_current_page_index + 1) % page_count;
-      
-      Uint32 first = (GLOBAL_PAGE_SIZE_WORDS - pos);
-      // wl4391_todo removing valgrind overlap warning for now
-      memmove(page_ptr.p, page_ptr.p->data+pos, 4 * first);
-      memcpy(page_ptr.p->data+first, next_page_ptr.p, 4 * (len - first));
-      data= page_ptr.p->data;
-    } 
+
+      if (len <= GLOBAL_PAGE_SIZE_WORDS)
+      {
+        jam();
+        Uint32 first = (GLOBAL_PAGE_SIZE_WORDS - pos);
+        // wl4391_todo removing valgrind overlap warning for now
+        memmove(page_ptr.p, page_ptr.p->data+pos, 4 * first);
+        memcpy(page_ptr.p->data+first, next_page_ptr.p, 4 * (len - first));
+        data= page_ptr.p->data;
+      }
+      else
+      {
+        jam();
+        /**
+         * A table definition can be larger than one page...
+         * when that happens copy it out to side buffer
+         *
+         * First copy part belonging to page_ptr
+         * Then copy full middle pages (moving forward in page-list)
+         * Last copy last part
+         */
+        Uint32 save = len;
+        assert(len <= NDB_ARRAY_SIZE(m_table_buf));
+        Uint32 * dst = m_table_buf;
+
+        /**
+         * First
+         */
+        Uint32 first = (GLOBAL_PAGE_SIZE_WORDS - pos);
+        memcpy(dst, page_ptr.p->data+pos, 4 * first);
+        len -= first;
+        dst += first;
+
+        /**
+         * Middle
+         */
+        while (len > GLOBAL_PAGE_SIZE_WORDS)
+        {
+          jam();
+          memcpy(dst, next_page_ptr.p, 4 * GLOBAL_PAGE_SIZE_WORDS);
+          len -= GLOBAL_PAGE_SIZE_WORDS;
+          dst += GLOBAL_PAGE_SIZE_WORDS;
+
+          {
+            LocalDataBuffer<15> pages(m_databuffer_pool, file_ptr.p->m_pages);
+            Uint32 next_page = (file_ptr.p->m_current_page_index + 1) % page_count;
+            pages.position(it, next_page % page_count);
+            m_global_page_pool.getPtr(next_page_ptr, * it.data);
+
+            file_ptr.p->m_current_page_ptr_i = next_page_ptr.i;
+            file_ptr.p->m_current_page_index = next_page;
+          }
+        }
+
+        /**
+         * last
+         */
+        memcpy(dst, next_page_ptr.p, 4 * len);
+        file_ptr.p->m_current_page_pos = len;
+
+        /**
+         * Set pointer and len
+         */
+        len = save;
+        data = m_table_buf;
+      }
+    }
     else
     {
       file_ptr.p->m_current_page_pos = pos + len;

=== modified file 'storage/ndb/src/kernel/blocks/restore.hpp'
--- a/storage/ndb/src/kernel/blocks/restore.hpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/kernel/blocks/restore.hpp	2012-03-14 10:31:02 +0000
@@ -159,6 +159,7 @@ private:
   ArrayPool<File> m_file_pool;
   
   List::DataBufferPool m_databuffer_pool;
+  Uint32 m_table_buf[MAX_WORDS_META_FILE];
 };
 
 NdbOut& operator << (NdbOut&, const Restore::Column&);

=== modified file 'storage/ndb/src/kernel/vm/Configuration.cpp'
--- a/storage/ndb/src/kernel/vm/Configuration.cpp	2012-01-30 15:12:41 +0000
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp	2012-03-13 15:18:24 +0000
@@ -840,13 +840,6 @@ Configuration::calcSizeAlt(ConfigValues 
      * Acc Size Alt values
      */
     // Can keep 65536 pages (= 0.5 GByte)
-    cfg.put(CFG_ACC_DIR_RANGE, 
-	    2 * NO_OF_FRAG_PER_NODE * noOfAccTables* noOfReplicas); 
-    
-    cfg.put(CFG_ACC_DIR_ARRAY,
-	    (noOfIndexPages >> 8) + 
-	    2 * NO_OF_FRAG_PER_NODE * noOfAccTables* noOfReplicas);
-    
     cfg.put(CFG_ACC_FRAGMENT,
 	    NO_OF_FRAG_PER_NODE * noOfAccTables* noOfReplicas);
     

=== modified file 'storage/ndb/src/kernel/vm/DynArr256.cpp'
--- a/storage/ndb/src/kernel/vm/DynArr256.cpp	2012-02-07 19:40:05 +0000
+++ b/storage/ndb/src/kernel/vm/DynArr256.cpp	2012-03-13 15:18:24 +0000
@@ -33,6 +33,7 @@ struct DA256Free
 {
   Uint32 m_magic;
   Uint32 m_next_free;
+  Uint32 m_prev_free;
 };
 
 struct DA256Node
@@ -46,8 +47,43 @@ struct DA256Page
   struct DA256Node m_nodes[30];
 
   bool get(Uint32 node, Uint32 idx, Uint32 type_id, Uint32*& val_ptr) const;
+  bool is_empty() const;
+  bool is_full() const;
+  Uint32 first_free() const;
+  Uint32 last_free() const;
 };
 
+inline
+bool DA256Page::is_empty() const
+{
+  return !(0x7fff & (m_header[0].m_magic | m_header[1].m_magic));
+}
+
+inline
+bool DA256Page::is_full() const
+{
+  return !(0x7fff & ~(m_header[0].m_magic & m_header[1].m_magic));
+}
+
+inline
+Uint32 DA256Page::first_free() const
+{
+  Uint32 node = BitmaskImpl::ctz(~m_header[0].m_magic | 0x8000);
+  if (node == 15)
+    node = 15 + BitmaskImpl::ctz(~m_header[1].m_magic | 0x8000);
+  return node;
+}
+
+inline
+Uint32 DA256Page::last_free() const
+{
+  Uint32 node = 29 - BitmaskImpl::clz((~m_header[1].m_magic << 17) | 0x10000);
+  if (node == 14)
+    node = 14 - BitmaskImpl::clz((~m_header[0].m_magic << 17) | 0x10000);
+  return node;
+}
+
+
 #undef require
 #define require(x) require_exit_or_core_with_printer((x), 0, ndbout_printer)
 //#define DA256_USE_PX
@@ -68,8 +104,11 @@ struct DA256Page
 #endif
 Uint32 verbose = 0;
 Uint32 allocatedpages = 0;
+Uint32 releasedpages = 0;
+Uint32 maxallocatedpages = 0;
 Uint32 allocatednodes = 0;
 Uint32 releasednodes = 0;
+Uint32 maxallocatednodes = 0;
 #endif
 
 static
@@ -94,6 +133,7 @@ DynArr256Pool::DynArr256Pool()
 {
   m_type_id = RNIL;
   m_first_free = RNIL;
+  m_last_free = RNIL;
   m_memroot = 0;
 }
 
@@ -163,6 +203,9 @@ DynArr256::get(Uint32 pos) const
     return 0;
   }
   
+#ifdef VM_TRACE
+  require((m_head.m_sz > 0) && (pos <= m_head.m_high_pos));
+#endif
 #ifdef DA256_USE_PX
   Uint32 px[4] = { (pos >> 24) & 255, 
 		   (pos >> 16) & 255, 
@@ -251,6 +294,11 @@ DynArr256::set(Uint32 pos)
     ptrI = * retVal;
   } 
   
+#ifdef VM_TRACE
+  if (pos > m_head.m_high_pos)
+    m_head.m_high_pos = pos;
+#endif
+
   return retVal;
   
 err:
@@ -296,16 +344,14 @@ initpage(DA256Page* p, Uint32 page_no, U
   {
     free = (DA256Free*)(p->m_nodes+i);
     free->m_magic = type_id;
-    free->m_next_free = (page_no << DA256_BITS) + (i + 1);
+    free->m_next_free = RNIL;
+    free->m_prev_free = RNIL;
 #ifdef DA256_EXTRA_SAFE
     DA256Node* node = p->m_nodes+i;
     for (j = 0; j<17; j++)
       node->m_lines[j].m_magic = type_id;
 #endif
   }
-  
-  free = (DA256Free*)(p->m_nodes+29);
-  free->m_next_free = RNIL;
 }
 
 bool
@@ -370,9 +416,12 @@ DynArr256::init(ReleaseIterator &iter)
  * 0 - done
  * 1 - data
  * 2 - no data
+ *
+ * if ptrVal is NULL, truncate work in trim mode and will stop
+ * (return 0) as soon value is not RNIL
  */
 Uint32
-DynArr256::truncate(Uint32 keep_pos, ReleaseIterator& iter, Uint32* ptrVal)
+DynArr256::truncate(Uint32 trunc_pos, ReleaseIterator& iter, Uint32* ptrVal)
 {
   Uint32 type_id = (~m_pool.m_type_id) & 0xFFFF;
   DA256Page * memroot = m_pool.m_memroot;
@@ -380,7 +429,7 @@ DynArr256::truncate(Uint32 keep_pos, Rel
   for (;;)
   {
     if (iter.m_sz == 0 ||
-        iter.m_pos < keep_pos ||
+        iter.m_pos < trunc_pos ||
         m_head.m_sz == 0)
     {
       return 0;
@@ -391,7 +440,8 @@ DynArr256::truncate(Uint32 keep_pos, Rel
     Uint32 page_no = ptrI >> DA256_BITS;
     Uint32 page_idx = (ptrI & DA256_MASK) ;
     DA256Page* page = memroot + page_no;
-    Uint32 node_index = (iter.m_pos >> (8 * (m_head.m_sz - iter.m_sz))) & 255;
+    Uint32 node_addr = (iter.m_pos >> (8 * (m_head.m_sz - iter.m_sz)));
+    Uint32 node_index = node_addr & 255;
     bool is_value = (iter.m_sz == m_head.m_sz);
 
     if (unlikely(! page->get(page_idx, node_index, type_id, refPtr)))
@@ -399,10 +449,17 @@ DynArr256::truncate(Uint32 keep_pos, Rel
       require(false);
     }
     assert(refPtr != NULL);
-    *ptrVal = *refPtr;
+    if (ptrVal != NULL)
+    {
+      *ptrVal = *refPtr;
+    }
+    else if (is_value && *refPtr != RNIL)
+    {
+      return 0;
+    }
 
     if (iter.m_sz == 1 &&
-        (iter.m_pos >> (8 * (m_head.m_sz - iter.m_sz))) == 0)
+        node_addr == 0)
     {
       assert(iter.m_ptr_i[iter.m_sz] == m_head.m_ptr_i);
       assert(iter.m_ptr_i[iter.m_sz + 1] == RNIL);
@@ -410,10 +467,10 @@ DynArr256::truncate(Uint32 keep_pos, Rel
       m_pool.release(m_head.m_ptr_i);
       m_head.m_sz --;
       m_head.m_ptr_i = iter.m_ptr_i[iter.m_sz];
-      return is_value ? 1 : 2;
+      if (is_value)
+        return 1;
     }
-
-    if (is_value || iter.m_ptr_i[iter.m_sz + 1] == *refPtr)
+    else if (is_value || iter.m_ptr_i[iter.m_sz + 1] == *refPtr)
     { // sz--
       Uint32 ptrI = *refPtr;
       if (!is_value)
@@ -438,7 +495,11 @@ DynArr256::truncate(Uint32 keep_pos, Rel
         assert((iter.m_pos & ~(0xffffffff << (8 * (m_head.m_sz - iter.m_sz)))) == 0);
         iter.m_pos --;
       }
-      if (is_value)
+#ifdef VM_TRACE
+      if (iter.m_pos < m_head.m_high_pos)
+        m_head.m_high_pos = iter.m_pos;
+#endif
+      if (is_value && ptrVal != NULL)
         return 1;
     }
     else
@@ -502,6 +563,8 @@ seizenode(DA256Page* page, Uint32 idx, U
 
 #ifdef UNIT_TEST
   allocatednodes++;
+  if (allocatednodes - releasednodes > maxallocatednodes)
+    maxallocatednodes = allocatednodes - releasednodes;
 #endif
   return true;
 }
@@ -574,28 +637,45 @@ DynArr256Pool::seize()
       initpage(page, page_no, type_id);
 #ifdef UNIT_TEST
       allocatedpages++;
+      if (allocatedpages - releasedpages > maxallocatedpages)
+        maxallocatedpages = allocatedpages - releasedpages;
 #endif
     }
     else
     {
       return RNIL;
     }
-    ff = (page_no << DA256_BITS);
+    m_last_free = m_first_free = ff = page_no;
   }
   else
   {
-    page = memroot + (ff >> DA256_BITS);
+    page = memroot + ff;
   }
   
-  Uint32 idx = ff & DA256_MASK;
+  Uint32 idx = page->first_free();
   DA256Free * ptr = (DA256Free*)(page->m_nodes + idx);
   if (likely(ptr->m_magic == type_id))
   {
-    Uint32 next = ptr->m_next_free;
+    Uint32 last_free = page->last_free();
+    Uint32 next_page = ((DA256Free*)(page->m_nodes + last_free))->m_next_free;
     if (likely(seizenode(page, idx, type_id)))
     {
-      m_first_free = next;    
-      return ff;
+      if (page->is_full())
+      {
+        assert(m_first_free == ff);
+        m_first_free = next_page;
+        if (m_first_free == RNIL)
+        {
+          assert(m_last_free == ff);
+          m_last_free = RNIL;
+        }
+        else
+        {
+          page = memroot + next_page;
+          ((DA256Free*)(page->m_nodes + page->last_free()))->m_prev_free = RNIL;
+        }
+      }
+      return (ff << DA256_BITS) | idx;
     }
   }
   
@@ -613,15 +693,61 @@ DynArr256Pool::release(Uint32 ptrI)
   Uint32 page_idx = ptrI & DA256_MASK;
   DA256Page * memroot = m_memroot;
   DA256Page * page = memroot + page_no;
-  
   DA256Free * ptr = (DA256Free*)(page->m_nodes + page_idx);
+
+  Guard2 g(m_mutex);
+  Uint32 last_free = page->last_free();
   if (likely(releasenode(page, page_idx, type_id)))
   {
     ptr->m_magic = type_id;
-    Guard2 g(m_mutex);
-    Uint32 ff = m_first_free;
-    ptr->m_next_free = ff;
-    m_first_free = ptrI;
+    if (last_free > 29)
+    { // Add last to page free list
+      Uint32 lf = m_last_free;
+      ptr->m_prev_free = lf;
+      ptr->m_next_free = RNIL;
+      m_last_free = page_no;
+      if (m_first_free == RNIL)
+        m_first_free = page_no;
+
+      if (lf != RNIL)
+      {
+        page = memroot + lf;
+        DA256Free* pptr = (DA256Free*)(page->m_nodes + page->last_free());
+        pptr->m_next_free = page_no;
+      }
+    }
+    else if (page->is_empty())
+    {
+      // TODO msundell: release_page
+      // unlink from free page list
+      Uint32 nextpage = ((DA256Free*)(page->m_nodes + last_free))->m_next_free;
+      Uint32 prevpage = ((DA256Free*)(page->m_nodes + last_free))->m_prev_free;
+      m_ctx.release_page(type_id, page_no);
+#ifdef UNIT_TEST
+      releasedpages ++;
+#endif
+      if (nextpage != RNIL)
+      {
+        page = memroot + nextpage;
+        ((DA256Free*)(page->m_nodes + page->last_free()))->m_prev_free = prevpage;
+      }
+      if (prevpage != RNIL)
+      {
+        page = memroot + prevpage;
+        ((DA256Free*)(page->m_nodes + page->last_free()))->m_next_free = nextpage;
+      }
+      if (m_first_free == page_no)
+      {
+        m_first_free = nextpage;
+      }
+      if (m_last_free == page_no)
+        m_last_free = prevpage;
+    }
+    else if (page_idx > last_free)
+    { // last free node in page tracks free page list links
+      ptr->m_next_free = ((DA256Free*)(page->m_nodes + last_free))->m_next_free;
+      ptr->m_prev_free = ((DA256Free*)(page->m_nodes + last_free))->m_prev_free;
+    }
     return;
   }
   require(false);
@@ -631,6 +757,36 @@ DynArr256Pool::release(Uint32 ptrI)
 
 static
 bool
+release(DynArr256& arr)
+{
+  DynArr256::ReleaseIterator iter;
+  arr.init(iter);
+  Uint32 val;
+  Uint32 cnt=0;
+  Uint64 start;
+  if (verbose > 2)
+    ndbout_c("allocatedpages: %d (max %d) releasedpages: %d allocatednodes: %d (max %d) releasednodes: %d",
+           allocatedpages, maxallocatedpages,
+           releasedpages,
+           allocatednodes, maxallocatednodes,
+           releasednodes);
+  start = my_micro_time();
+  while (arr.release(iter, &val))
+    cnt++;
+  start = my_micro_time() - start;
+  if (verbose > 1)
+    ndbout_c("allocatedpages: %d (max %d) releasedpages: %d allocatednodes: %d (max %d) releasednodes: %d (%llu us)"
+             " releasecnt: %d",
+             allocatedpages, maxallocatedpages,
+             releasedpages,
+             allocatednodes, maxallocatednodes,
+             releasednodes,
+             start, cnt);
+  return true;
+}
+
+static
+bool
 simple(DynArr256 & arr, int argc, char* argv[])
 {
   if (verbose) ndbout_c("argc: %d", argc);
@@ -863,16 +1019,15 @@ write(DynArr256& arr, int argc, char ** 
     {
       Uint32 idx = ((rand() & (~seqmask)) + ((i + seq) & seqmask)) % maxidx;
       Uint32 *ptr = arr.set(idx);
+      if (ptr == NULL) break; /* out of memory */
       *ptr = i;
     }
     start = my_micro_time() - start;
     float uspg = (float)start; uspg /= cnt;
     if (verbose)
       ndbout_c("Elapsed %lldus -> %f us/set", start, uspg);
-    DynArr256::ReleaseIterator iter;
-    arr.init(iter);
-    Uint32 val;
-    while(arr.release(iter, &val));
+    if (!release(arr))
+      return false;
   }
   return true;
 }
@@ -923,6 +1078,12 @@ main(int argc, char** argv)
 #else
   verbose = 0;
 #endif
+  while (argc > 1 && strcmp(argv[1], "-v") == 0)
+  {
+    verbose++;
+    argc--;
+    argv++;
+  }
 
   Pool_context pc = test_context(10000 /* pages */);
 
@@ -983,20 +1144,18 @@ main(int argc, char** argv)
   }
 #endif
 
-  DynArr256::ReleaseIterator iter;
-  arr.init(iter);
-  Uint32 cnt = 0, val;
-  while (arr.release(iter, &val)) cnt++;
-  
+  release(arr);
   if (verbose)
-    ndbout_c("allocatedpages: %d allocatednodes: %d releasednodes: %d"
-	   " releasecnt: %d",
-	   allocatedpages, 
-	   allocatednodes,
-	   releasednodes,
-	   cnt);
+    ndbout_c("allocatedpages: %d (max %d) releasedpages: %d allocatednodes: %d (max %d) releasednodes: %d",
+           allocatedpages, maxallocatedpages,
+           releasedpages,
+           allocatednodes, maxallocatednodes,
+           releasednodes);
+
 #ifdef TAP_TEST
-  ok(allocatednodes == releasednodes, "release");
+  ok(allocatednodes == releasednodes &&
+     allocatedpages == releasedpages,
+     "release");
   return exit_status();
 #else
   return 0;

=== modified file 'storage/ndb/src/kernel/vm/DynArr256.hpp'
--- a/storage/ndb/src/kernel/vm/DynArr256.hpp	2012-02-07 19:40:05 +0000
+++ b/storage/ndb/src/kernel/vm/DynArr256.hpp	2012-03-13 15:18:24 +0000
@@ -37,6 +37,7 @@ public:
 protected:
   Uint32 m_type_id;
   Uint32 m_first_free;
+  Uint32 m_last_free;
   Pool_context m_ctx;
   struct DA256Page* m_memroot;
   NdbMutex * m_mutex;
@@ -51,10 +52,17 @@ class DynArr256
 public:
   struct Head
   {
+#ifdef VM_TRACE
+    Head() { m_ptr_i = RNIL; m_sz = 0; m_high_pos = 0; }
+#else
     Head() { m_ptr_i = RNIL; m_sz = 0;}
+#endif
     
     Uint32 m_ptr_i;
     Uint32 m_sz;
+#ifdef VM_TRACE
+    Uint32 m_high_pos;
+#endif
 
     bool isEmpty() const { return m_sz == 0;}
   };
@@ -79,7 +87,8 @@ public:
    *        2 - nodata
    */
   Uint32 release(ReleaseIterator&, Uint32* retptr);
-  Uint32 truncate(Uint32 keep_pos, ReleaseIterator&, Uint32* retptr);
+  Uint32 trim(Uint32 trim_pos, ReleaseIterator&);
+  Uint32 truncate(Uint32 trunc_pos, ReleaseIterator&, Uint32* retptr);
 protected:
   Head & m_head;
   DynArr256Pool & m_pool;
@@ -94,4 +103,10 @@ Uint32 DynArr256::release(ReleaseIterato
   return truncate(0, iter, retptr);
 }
 
+inline
+Uint32 DynArr256::trim(Uint32 pos, ReleaseIterator& iter)
+{
+  return truncate(pos, iter, NULL);
+}
+
 #endif

=== modified file 'storage/ndb/src/kernel/vm/mt_thr_config.cpp'
--- a/storage/ndb/src/kernel/vm/mt_thr_config.cpp	2012-01-30 16:31:29 +0000
+++ b/storage/ndb/src/kernel/vm/mt_thr_config.cpp	2012-03-12 09:57:10 +0000
@@ -125,6 +125,73 @@ THRConfig::add(T_Type t)
   m_threads[t].push_back(tmp);
 }
 
+static
+void
+computeThreadConfig(Uint32 MaxNoOfExecutionThreads,
+                    Uint32 & tcthreads,
+                    Uint32 & lqhthreads,
+                    Uint32 & sendthreads,
+                    Uint32 & recvthreads)
+{
+  assert(MaxNoOfExecutionThreads >= 9);
+  static const struct entry
+  {
+    Uint32 M;
+    Uint32 lqh;
+    Uint32 tc;
+    Uint32 send;
+    Uint32 recv;
+  } table[] = {
+    { 9, 4, 2, 0, 1 },
+    { 10, 4, 2, 1, 1 },
+    { 11, 4, 3, 1, 1 },
+    { 12, 4, 3, 1, 2 },
+    { 13, 4, 3, 2, 2 },
+    { 14, 4, 4, 2, 2 },
+    { 15, 4, 5, 2, 2 },
+    { 16, 8, 3, 1, 2 },
+    { 17, 8, 4, 1, 2 },
+    { 18, 8, 4, 2, 2 },
+    { 19, 8, 5, 2, 2 },
+    { 20, 8, 5, 2, 3 },
+    { 21, 8, 5, 3, 3 },
+    { 22, 8, 6, 3, 3 },
+    { 23, 8, 7, 3, 3 },
+    { 24, 12, 5, 2, 3 },
+    { 25, 12, 6, 2, 3 },
+    { 26, 12, 6, 3, 3 },
+    { 27, 12, 7, 3, 3 },
+    { 28, 12, 7, 3, 4 },
+    { 29, 12, 8, 3, 4 },
+    { 30, 12, 8, 4, 4 },
+    { 31, 12, 9, 4, 4 },
+    { 32, 16, 8, 3, 3 },
+    { 33, 16, 8, 3, 4 },
+    { 34, 16, 8, 4, 4 },
+    { 35, 16, 9, 4, 4 },
+    { 36, 16, 10, 4, 4 },
+    { 37, 16, 10, 4, 5 },
+    { 38, 16, 11, 4, 5 },
+    { 39, 16, 11, 5, 5 },
+    { 40, 16, 12, 5, 5 },
+    { 41, 16, 12, 5, 6 },
+    { 42, 16, 13, 5, 6 },
+    { 43, 16, 13, 6, 6 },
+    { 44, 16, 14, 6, 6 }
+  };
+
+  Uint32 P = MaxNoOfExecutionThreads - 9;
+  if (P >= NDB_ARRAY_SIZE(table))
+  {
+    P = NDB_ARRAY_SIZE(table) - 1;
+  }
+
+  lqhthreads = table[P].lqh;
+  tcthreads = table[P].tc;
+  sendthreads = table[P].send;
+  recvthreads = table[P].recv;
+}
+
 int
 THRConfig::do_parse(unsigned MaxNoOfExecutionThreads,
                     unsigned __ndbmt_lqh_threads,
@@ -159,8 +226,16 @@ THRConfig::do_parse(unsigned MaxNoOfExec
   case 6:
     lqhthreads = 2; // TC + receiver + SUMA + 2 * LQH
     break;
-  default:
+  case 7:
+  case 8:
     lqhthreads = 4; // TC + receiver + SUMA + 4 * LQH
+    break;
+  default:
+    computeThreadConfig(MaxNoOfExecutionThreads,
+                        tcthreads,
+                        lqhthreads,
+                        sendthreads,
+                        recvthreads);
   }
 
   if (__ndbmt_lqh_threads)
@@ -1211,7 +1286,186 @@ TAPTEST(mt_thr_config)
     }
   }
 
+  for (Uint32 i = 9; i < 48; i++)
+  {
+    Uint32 t,l,s,r;
+    computeThreadConfig(i, t, l, s, r);
+    printf("MaxNoOfExecutionThreads: %u lqh: %u tc: %u send: %u recv: %u main: 1 rep: 1 => sum: %u\n",
+           i, l, t, s, r,
+           2 + l + t + s + r);
+  }
+
   return 1;
 }
 
 #endif
+
+#if 0
+
+/**
+ * This c-program was written by mikael ronstrom to
+ *  produce good distribution of threads, given MaxNoOfExecutionThreads
+ *
+ * Good is based on his experience experimenting/benchmarking
+ */
+#include <stdio.h>
+
+#define Uint32 unsigned int
+#define TC_THREAD_INDEX 0
+#define SEND_THREAD_INDEX 1
+#define RECV_THREAD_INDEX 2
+#define LQH_THREAD_INDEX 3
+#define MAIN_THREAD_INDEX 4
+#define REP_THREAD_INDEX 5
+
+#define NUM_CHANGE_INDEXES 3
+#define NUM_INDEXES 6
+
+static double mult_factor[NUM_CHANGE_INDEXES];
+
+static void
+set_changeable_thread(Uint32 num_threads[NUM_INDEXES],
+                      double float_num_threads[NUM_CHANGE_INDEXES],
+                      Uint32 index)
+{
+  num_threads[index] = (Uint32)(float_num_threads[index]);
+  float_num_threads[index] -= num_threads[index];
+}
+
+static Uint32
+calculate_total(Uint32 num_threads[NUM_INDEXES])
+{
+  Uint32 total = 0;
+  Uint32 i;
+  for (i = 0; i < NUM_INDEXES; i++)
+  {
+    total += num_threads[i];
+  }
+  return total;
+}
+
+static Uint32
+find_min_index(double float_num_threads[NUM_CHANGE_INDEXES])
+{
+  Uint32 min_index = 0;
+  Uint32 i;
+  double min = float_num_threads[0];
+
+  for (i = 1; i < NUM_CHANGE_INDEXES; i++)
+  {
+    if (min > float_num_threads[i])
+    {
+      min = float_num_threads[i];
+      min_index = i;
+    }
+  }
+  return min_index;
+}
+
+static Uint32
+find_max_index(double float_num_threads[NUM_CHANGE_INDEXES])
+{
+  Uint32 max_index = 0;
+  Uint32 i;
+  double max = float_num_threads[0];
+
+  for (i = 1; i < NUM_CHANGE_INDEXES; i++)
+  {
+    if (max < float_num_threads[i])
+    {
+      max = float_num_threads[i];
+      max_index = i;
+    }
+  }
+  return max_index;
+}
+
+static void
+add_thread(Uint32 num_threads[NUM_INDEXES],
+           double float_num_threads[NUM_CHANGE_INDEXES])
+{
+  Uint32 i;
+  Uint32 max_index = find_max_index(float_num_threads);
+  num_threads[max_index]++;
+  float_num_threads[max_index] -= (double)1;
+  for (i = 0; i < NUM_CHANGE_INDEXES; i++)
+    float_num_threads[i] += mult_factor[i];
+}
+
+static void
+remove_thread(Uint32 num_threads[NUM_INDEXES],
+              double float_num_threads[NUM_CHANGE_INDEXES])
+{
+  Uint32 i;
+  Uint32 min_index = find_min_index(float_num_threads);
+  num_threads[min_index]--;
+  float_num_threads[min_index] += (double)1;
+  for (i = 0; i < NUM_CHANGE_INDEXES; i++)
+    float_num_threads[i] -= mult_factor[i];
+}
+
+static void
+define_num_threads_per_type(Uint32 max_no_exec_threads,
+                            Uint32 num_threads[NUM_INDEXES])
+{
+  Uint32 total_threads;
+  Uint32 num_lqh_threads;
+  Uint32 i;
+  double float_num_threads[NUM_CHANGE_INDEXES];
+
+  /* Baseline to start calculations at */
+  num_threads[MAIN_THREAD_INDEX] = 1; /* Fixed */
+  num_threads[REP_THREAD_INDEX] = 1; /* Fixed */
+  num_lqh_threads = (max_no_exec_threads / 8) * 4;
+  if (num_lqh_threads > 16)
+    num_lqh_threads = 16;
+  num_threads[LQH_THREAD_INDEX] = num_lqh_threads;
+
+  /**
+   * Rest of calculations are about calculating number of tc threads,
+   * send threads and receive threads based on this input.
+   * We do this by calculating a floating point number and using this to
+   * select the next thread group to have one more added/removed.
+   */
+  mult_factor[TC_THREAD_INDEX] = 0.465;
+  mult_factor[SEND_THREAD_INDEX] = 0.19;
+  mult_factor[RECV_THREAD_INDEX] = 0.215;
+  for (i = 0; i < NUM_CHANGE_INDEXES; i++)
+    float_num_threads[i] = 0.5 + (mult_factor[i] * num_lqh_threads);
+
+  set_changeable_thread(num_threads, float_num_threads, TC_THREAD_INDEX);
+  set_changeable_thread(num_threads, float_num_threads, SEND_THREAD_INDEX);
+  set_changeable_thread(num_threads, float_num_threads, RECV_THREAD_INDEX);
+
+  total_threads = calculate_total(num_threads);
+
+  while (total_threads != max_no_exec_threads)
+  {
+    if (total_threads < max_no_exec_threads)
+      add_thread(num_threads, float_num_threads);
+    else
+      remove_thread(num_threads, float_num_threads);
+    total_threads = calculate_total(num_threads);
+  }
+}
+
+int main(int argc, char *argv)
+{
+  Uint32 num_threads[NUM_INDEXES];
+  Uint32 i;
+
+  printf("MaxNoOfExecutionThreads,LQH,TC,send,recv\n");
+  for (i = 9; i < 45; i++)
+  {
+    define_num_threads_per_type(i, num_threads);
+    printf("{ %u, %u, %u, %u, %u },\n",
+           i,
+           num_threads[LQH_THREAD_INDEX],
+           num_threads[TC_THREAD_INDEX],
+           num_threads[SEND_THREAD_INDEX],
+           num_threads[RECV_THREAD_INDEX]);
+  }
+  return 0;
+}
+
+#endif

=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2012-02-02 21:00:28 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2012-03-12 09:57:10 +0000
@@ -1751,7 +1751,16 @@ const ConfigInfo::ParamInfo ConfigInfo::
     ConfigInfo::CI_INT,
     "0",
     "2",
+#if NDB_VERSION_D < NDB_MAKE_VERSION(7,2,0)
     "8"
+#else
+    /**
+     * NOTE: The actual maximum number of threads is 50...
+     *   but that config is so weird so it's only possible to get
+     *   by using ThreadConfig
+     */
+    "36"
+#endif
   },
 
   {

=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2012-03-05 12:51:16 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2012-03-19 12:09:39 +0000
@@ -1056,7 +1056,7 @@ MgmtSrvr::sendVersionReq(int v_nodeId,
       if (version < NDBD_SPLIT_VERSION)
 	mysql_version = 0;
       struct in_addr in;
-      in.s_addr= conf->inet_addr;
+      in.s_addr= conf->m_inet_addr;
       *address= inet_ntoa(in);
 
       return 0;

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2011-11-10 20:35:28 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2012-03-19 12:09:39 +0000
@@ -3448,6 +3448,7 @@ NdbDictInterface::compChangeMask(const N
     {
       const NdbColumnImpl *col= impl.m_columns[i];
       if(!col->m_dynamic || !col->m_nullable ||
+         !col->m_defaultValue.empty() ||
          col->m_storageType == NDB_STORAGETYPE_DISK ||
          col->m_pk ||
          col->m_distributionKey ||

=== modified file 'storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt	2012-03-05 07:24:11 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt	2012-03-15 07:24:54 +0000
@@ -17,9 +17,4 @@ ADD_SUBDIRECTORY(myapi)
 ADD_SUBDIRECTORY(myjapi)
 ADD_SUBDIRECTORY(unload)
 
-# ndb71@win32: compile issues with including <NdbTap.hpp>
-#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include/util
-#		${CMAKE_SOURCE_DIR}/unittest/mytap)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/unittest/mytap)
-
 ADD_EXECUTABLE(jtie_unit_tests-t jtie_unit_tests-t.cpp)

=== modified file 'storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp'
--- a/storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp	2012-03-05 04:19:09 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp	2012-03-14 19:13:20 +0000
@@ -14,20 +14,9 @@
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */
-/*
- * jtie_unit_tests-t.cpp
- */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-// ndb71@win32: unresolved compile errors ('VOID' : undeclared identifier)
-// in C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\dbghelp.h(931)
-// when including <NdbTap.hpp>; hence, using directly:
-#include <tap.h>
-#include <tap.c>
+#include <ndb_global.h>
+#include <util/NdbTap.hpp>
 
 // platform-specific functions and settings
 #ifdef _WIN32

=== modified file 'storage/ndb/src/ndbjtie/test/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/test/CMakeLists.txt	2012-03-05 07:24:11 +0000
+++ b/storage/ndb/src/ndbjtie/test/CMakeLists.txt	2012-03-15 07:24:54 +0000
@@ -31,11 +31,6 @@ CREATE_JAR(ndbjtie-test ${JAVA_SOURCES}
   CLASSPATH ${CLASSPATH}
   DEPENDENCIES ndbjtie.jar jtie.jar jtie-test-myjapi.jar)
 
-# ndb71@win32: compile issues with including <NdbTap.hpp>
-#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include/util
-#		${CMAKE_SOURCE_DIR}/unittest/mytap)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/unittest/mytap)
-
 ADD_EXECUTABLE(ndbjtie_unit_tests-t ndbjtie_unit_tests-t.cpp)
 
 IF(WIN32)

=== modified file 'storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp'
--- a/storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp	2012-03-05 04:19:09 +0000
+++ b/storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp	2012-03-14 19:13:20 +0000
@@ -14,20 +14,9 @@
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */
-/*
- * ndbjtie_unit_tests-t.cpp
- */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-// ndb71@win32: unresolved compile errors ('VOID' : undeclared identifier)
-// in C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\dbghelp.h(931)
-// when including <NdbTap.hpp>; hence, using directly:
-#include <tap.h>
-#include <tap.c>
+#include <ndb_global.h>
+#include <util/NdbTap.hpp>
 
 // platform-specific functions and settings
 #ifdef _WIN32

=== modified file 'storage/ndb/test/ndbapi/bench/asyncGenerator.cpp'
--- a/storage/ndb/test/ndbapi/bench/asyncGenerator.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/asyncGenerator.cpp	2012-03-14 10:31:02 +0000
@@ -27,6 +27,8 @@
 #include <NdbOut.hpp>
 #include <NdbSleep.h>
 
+void getRandomSubscriberNumber(SubscriberNumber number);
+
 /***************************************************************
 * L O C A L   C O N S T A N T S                                *
 ***************************************************************/
@@ -39,7 +41,6 @@
 * L O C A L   F U N C T I O N S                                *
 ***************************************************************/
 
-static void getRandomSubscriberNumber(SubscriberNumber number);
 static void getRandomServerId(ServerId *serverId);
 static void getRandomChangedBy(ChangedBy changedBy);
 //static void getRandomChangedTime(ChangedTime changedTime);
@@ -89,11 +90,13 @@ static unsigned maxsize = 0;
 ****************************************************************
 ***************************************************************/
 
-static void getRandomSubscriberNumber(SubscriberNumber number)
+extern int subscriberCount;
+
+void getRandomSubscriberNumber(SubscriberNumber number)
 {
    uint32 tmp;
    char sbuf[SUBSCRIBER_NUMBER_LENGTH + 1];
-   tmp = myRandom48(NO_OF_SUBSCRIBERS);
+   tmp = myRandom48(subscriberCount);
    sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_LENGTH, tmp);
    memcpy(number, sbuf, SUBSCRIBER_NUMBER_LENGTH);
 }

=== modified file 'storage/ndb/test/ndbapi/bench/dbPopulate.cpp'
--- a/storage/ndb/test/ndbapi/bench/dbPopulate.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/dbPopulate.cpp	2012-03-14 10:31:02 +0000
@@ -238,9 +238,11 @@ static void populateGroups(UserHandle *u
 ****************************************************************
 ***************************************************************/
 
+extern int subscriberCount;
+
 void dbPopulate(UserHandle *uh)
 {
    populate("servers", NO_OF_SERVERS, populateServers, uh);
-   populate("subscribers", NO_OF_SUBSCRIBERS, populateSubscribers, uh);
+   populate("subscribers", subscriberCount, populateSubscribers, uh);
    populate("groups", NO_OF_GROUPS, populateGroups, uh);
 }

=== modified file 'storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp'
--- a/storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp	2011-01-30 20:56:00 +0000
+++ b/storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp	2012-03-14 07:27:43 +0000
@@ -39,6 +39,8 @@ static int   minEventSendPoll;
 static int   forceSendPoll;
 static bool  useNdbRecord;
 static bool  useCombUpd;
+int          subscriberCount;
+static bool  robustMode;
 
 static ThreadData *data;
 static Ndb_cluster_connection *g_cluster_connection= 0;
@@ -60,7 +62,7 @@ static void usage(const char *prog)
 
    ndbout_c(
            "Usage: %s [-proc <num>] [-warm <num>] [-time <num>] [ -p <num>]" 
-	   "[-t <num> ] [ -e <num> ] [ -f <num>] [ -ndbrecord ]\n"
+	   "[-t <num> ] [ -e <num> ] [ -f <num>] [ -ndbrecord ] [ -s <num>]\n"
            "  -proc <num>    Specifies that <num> is the number of\n"
            "                 threads. The default is 1.\n"
            "  -time <num>    Specifies that the test will run for <num> sec.\n"
@@ -78,8 +80,10 @@ static void usage(const char *prog)
            "  -ndbrecord     Use NdbRecord Api.\n"
            "                 Default is to use old Api\n"
            "  -combupdread   Use update pre-read operation where possible\n"
-           "                 Default is to use separate read+update ops\n",
-           progname);
+           "                 Default is to use separate read+update ops\n"
+           "  -s <num>       Number of subscribers to operate on, default is %u.\n"
+           "  -r             Whether to be robust to key errors\n",
+           progname, NO_OF_SUBSCRIBERS);
 }
 
 static
@@ -97,6 +101,8 @@ parse_args(int argc, const char **argv)
    forceSendPoll    = 0;
    useNdbRecord     = false;
    useCombUpd       = false;
+   subscriberCount  = NO_OF_SUBSCRIBERS;
+   robustMode       = false;
 
    i = 1;
    while (i < argc){
@@ -176,6 +182,20 @@ parse_args(int argc, const char **argv)
        useCombUpd= true;
        i++;
      }
+     else if (strcmp("-s", argv[i]) == 0) {
+       if (i + 1 >= argc) {
+         return 1;
+       }
+       if (sscanf(argv[i+1], "%u", &subscriberCount) == -1) {
+         ndbout_c("-s flag requires a positive argument.");
+         return 1;
+       }
+       i+=2;
+     }
+     else if (strcmp("-r", argv[i]) == 0) {
+       robustMode= true;
+       i++;
+     }
      else {
        return 1;
      }
@@ -548,6 +568,7 @@ NDB_COMMAND(DbAsyncGenerator, "DbAsyncGe
       data[tid].runState              = Runnable;
       data[tid].ndbRecordSharedData   = ndbRecordSharedDataPtr;
       data[tid].useCombinedUpdate     = useCombUpd;
+      data[tid].robustMode            = robustMode;
     }
     sprintf(threadName, "AsyncThread[%d]", i);
     pThread = NdbThread_Create(threadRoutine, 

=== modified file 'storage/ndb/test/ndbapi/bench/mainPopulate.cpp'
--- a/storage/ndb/test/ndbapi/bench/mainPopulate.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/mainPopulate.cpp	2012-03-14 10:31:02 +0000
@@ -26,23 +26,18 @@
 #include <random.h>
 #include <NDBT.hpp>
 
-#ifdef	__cplusplus
-extern "C" {
-#endif
 int useTableLogging;
-#ifdef	__cplusplus
-}
-#endif
-
+int subscriberCount;
 
 static 
 void usage(const char *prog)
 {
   
   ndbout_c(
-	   "Usage: %s [-l]\n"
-	   "  -l                  Use logging and checkpointing on tables\n",
-	   prog);
+	   "Usage: %s [-l][-s <count>]\n"
+	   "  -l                  Use logging and checkpointing on tables\n"
+           "  -s <count>          Number of subscribers to populate, default %u\n",
+	   prog, NO_OF_SUBSCRIBERS);
   
   exit(1);
 }
@@ -54,11 +49,23 @@ NDB_COMMAND(DbCreate, "DbCreate", "DbCre
   UserHandle *uh;
   
   useTableLogging = 0;
-  
+  subscriberCount = NO_OF_SUBSCRIBERS;
+
   for(i = 1; i<argc; i++){
     if(strcmp(argv[i], "-l") == 0){
       useTableLogging = 1;
-    } else {
+    }
+    else if (strcmp(argv[i], "-s") == 0)
+    {
+      if ((i + 1 >= argc) ||
+          (sscanf(argv[i+1], "%u", &subscriberCount) == -1))
+      {
+        usage(argv[0]);
+        return 0;
+      }
+      i++;
+    }
+    else {
       usage(argv[0]);
       return 0;
     }
@@ -66,6 +73,8 @@ NDB_COMMAND(DbCreate, "DbCreate", "DbCre
 
   ndbout_c("Using %s tables",
 	   useTableLogging ? "logging" : "temporary");
+  ndbout_c("Populating %u subscribers",
+           subscriberCount);
   
   myRandom48Init(0x3e6f);
   

=== modified file 'storage/ndb/test/ndbapi/bench/ndb_error.hpp'
--- a/storage/ndb/test/ndbapi/bench/ndb_error.hpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/ndb_error.hpp	2012-03-12 15:16:41 +0000
@@ -45,6 +45,23 @@ CHECK_ALLOWED_ERROR(const char * str, 
   ndbout << str << " " << error << endl
 	 << buf;
   showTime();
+
+  if (td->robustMode)
+  {
+    if ((error.code == 626) || /* NoDataFound */
+        (error.code == 630))   /* Tuple already existed */
+    {
+      /* Problem with a specific tuple, try a different one to
+       * avoid getting stuck
+       */
+      ThreadData* nctd = (ThreadData*) td;
+      getRandomSubscriberNumber(nctd->transactionData.number);
+      ndbout << "Problem with subscriber, changing to "
+             << td->transactionData.number
+             << endl;
+      return;
+    }
+  }
   
   switch(error.classification) { 
   case NdbError::TimeoutExpired:  

=== modified file 'storage/ndb/test/ndbapi/bench/testData.h'
--- a/storage/ndb/test/ndbapi/bench/testData.h	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/testData.h	2012-03-12 16:23:57 +0000
@@ -156,6 +156,7 @@ typedef struct {
   class Ndb           * pNDB;
   NdbRecordSharedData*  ndbRecordSharedData;
   bool                  useCombinedUpdate;
+  bool                  robustMode;
 } ThreadData;
 
 /***************************************************************

=== modified file 'storage/ndb/test/ndbapi/bench/userInterface.cpp'
--- a/storage/ndb/test/ndbapi/bench/userInterface.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/userInterface.cpp	2012-03-14 10:31:02 +0000
@@ -129,15 +129,7 @@ userDbCommit(UserHandle *uh){
  * TRUE - Normal table
  * FALSE - Table w.o. checkpoing and logging
  */
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
 extern int useTableLogging;
-#ifdef	__cplusplus
-}
-#endif
-
 
 int
 create_table_server(Ndb * pNdb){

=== modified file 'storage/ndb/test/ndbapi/bench/userInterface.h'
--- a/storage/ndb/test/ndbapi/bench/userInterface.h	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/bench/userInterface.h	2012-03-12 16:23:57 +0000
@@ -57,6 +57,8 @@ extern "C" {
   extern Ndb   *asyncDbConnect(int parallellism);
   extern void    asyncDbDisconnect(Ndb* pNDB);
 
+  extern void getRandomSubscriberNumber(SubscriberNumber number);
+
   extern void start_T1(Ndb * uh, ThreadData * data, int async);
   extern void start_T2(Ndb * uh, ThreadData * data, int async);
   extern void start_T3(Ndb * uh, ThreadData * data, int async);

=== modified file 'storage/ndb/test/ndbapi/testIndex.cpp'
--- a/storage/ndb/test/ndbapi/testIndex.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/ndbapi/testIndex.cpp	2012-03-19 12:09:39 +0000
@@ -61,6 +61,27 @@ public:
   Vector<Attrib*> attriblist;
 };
 
+/**
+ * TODO expose in ndbapi
+ */
+static
+bool
+isIndexable(const NdbDictionary::Column* col)
+{
+  if (col == 0)
+    return false;
+
+  switch(col->getType())
+  {
+  case NDB_TYPE_BIT:
+  case NDB_TYPE_BLOB:
+  case NDB_TYPE_TEXT:
+    return false;
+  default:
+    return true;
+  }
+}
+
 void AttribList::buildAttribList(const NdbDictionary::Table* pTab){
   attriblist.clear();
 
@@ -139,6 +160,29 @@ void AttribList::buildAttribList(const N
   }
 #endif
 
+  /**
+   * Trim away combinations that contain non indexable columns
+   */
+  Vector<Attrib*> tmp;
+  for (Uint32 ii = 0; ii < attriblist.size(); ii++)
+  {
+    Attrib* attr = attriblist[ii];
+    for (int j = 0; j < attr->numAttribs; j++)
+    {
+      if (!isIndexable(pTab->getColumn(attr->attribs[j])))
+      {
+        delete attr;
+        goto skip;
+      }
+    }
+
+    tmp.push_back(attr);
+skip:
+    (void)1;
+  }
+
+  attriblist.clear();
+  attriblist = tmp;
 }
 
 char idxName[255];

=== modified file 'storage/ndb/test/src/NDBT_Tables.cpp'
--- a/storage/ndb/test/src/NDBT_Tables.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/test/src/NDBT_Tables.cpp	2012-03-14 10:31:02 +0000
@@ -174,7 +174,307 @@ NDBT_Attribute T6Attribs[] = {
   NDBT_Attribute("ATTR19", NdbDictionary::Column::Unsigned),
   NDBT_Attribute("ATTR20", NdbDictionary::Column::Unsigned),
   NDBT_Attribute("ATTR21", NdbDictionary::Column::Char, 4, false, true, 0, MM, true),
-  NDBT_Attribute("ATTR22", NdbDictionary::Column::Varbinary, 255, false, false, 0, MM, true)
+  NDBT_Attribute("ATTR22", NdbDictionary::Column::Varbinary, 255, false, false, 0, MM, true),
+  NDBT_Attribute("BIT000", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT001", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT002", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT003", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT004", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT005", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT006", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT007", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT008", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT009", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT010", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT011", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT012", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT013", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT014", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT015", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT016", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT017", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT018", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT019", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT020", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT021", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT022", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT023", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT024", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT025", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT026", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT027", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT028", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT029", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT030", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT031", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT032", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT033", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT034", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT035", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT036", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT037", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT038", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT039", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT040", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT041", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT042", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT043", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT044", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT045", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT046", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT047", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT048", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT049", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT050", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT051", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT052", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT053", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT054", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT055", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT056", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT057", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT058", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT059", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT060", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT061", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT062", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT063", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT064", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT065", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT066", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT067", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT068", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT069", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT070", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT071", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT072", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT073", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT074", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT075", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT076", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT077", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT078", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT079", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT080", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT081", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT082", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT083", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT084", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT085", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT086", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT087", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT088", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT089", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT090", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT091", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT092", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT093", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT094", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT095", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT096", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT097", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT098", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT099", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT100", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT101", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT102", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT103", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT104", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT105", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT106", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT107", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT108", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT109", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT110", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT111", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT112", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT113", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT114", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT115", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT116", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT117", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT118", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT119", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT120", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT121", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT122", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT123", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT124", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT125", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT126", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT127", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT128", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT129", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT130", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT131", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT132", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT133", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT134", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT135", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT136", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT137", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT138", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT139", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT140", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT141", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT142", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT143", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT144", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT145", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT146", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT147", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT148", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT149", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT150", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT151", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT152", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT153", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT154", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT155", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT156", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT157", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT158", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT159", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT160", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT161", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT162", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT163", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT164", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT165", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT166", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT167", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT168", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT169", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT170", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT171", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT172", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT173", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT174", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT175", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT176", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT177", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT178", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT179", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT180", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT181", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT182", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT183", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT184", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT185", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT186", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT187", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT188", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT189", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT190", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT191", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT192", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT193", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT194", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT195", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT196", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT197", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT198", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT199", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT200", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT201", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT202", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT203", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT204", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT205", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT206", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT207", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT208", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT209", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT210", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT211", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT212", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT213", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT214", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT215", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT216", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT217", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT218", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT219", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT220", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT221", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT222", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT223", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT224", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT225", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT226", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT227", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT228", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT229", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT230", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT231", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT232", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT233", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT234", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT235", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT236", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT237", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT238", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT239", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT240", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT241", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT242", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT243", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT244", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT245", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT246", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT247", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT248", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT249", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT250", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT251", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT252", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT253", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT254", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT255", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT256", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT257", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT258", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT259", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT260", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT261", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT262", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT263", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT264", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT265", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT266", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT267", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT268", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT269", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT270", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT271", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT272", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT273", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT274", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT275", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT276", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT277", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT278", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT279", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT280", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT281", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT282", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT283", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT284", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT285", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT286", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT287", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT288", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT289", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT290", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT291", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT292", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT293", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT294", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT295", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT296", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT297", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true),
+  NDBT_Attribute("BIT298", NdbDictionary::Column::Bit, 1, false, true, 0, MM, true),
+  NDBT_Attribute("BIT299", NdbDictionary::Column::Bit, 1, false, false, 0, MM, true)
 };
 
 static

=== modified file 'support-files/CMakeLists.txt'
--- a/support-files/CMakeLists.txt	2010-12-17 23:03:23 +0000
+++ b/support-files/CMakeLists.txt	2012-03-16 08:07:11 +0000
@@ -70,7 +70,14 @@ IF(UNIX)
   INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
   CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
   CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY)
-  CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY)
+  
+  SET(SPECFILENAME "mysql.${VERSION}.spec")
+  IF("${VERSION}" MATCHES "-ndb-")
+    STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
+    SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
+  ENDIF()
+  CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY)
+  
   CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
 
   SET(bindir ${prefix}/${INSTALL_BINDIR})

=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh	2012-02-13 21:10:43 +0000
+++ b/support-files/mysql.spec.sh	2012-03-16 08:07:11 +0000
@@ -24,7 +24,7 @@
 %define mysql_vendor_2          Sun Microsystems, Inc.
 %define mysql_vendor            Oracle and/or its affiliates
 
-%define mysql_version   @VERSION@
+%define mysql_version   @NDBVERSION@
 
 %define mysqld_user     mysql
 %define mysqld_group    mysql
@@ -238,18 +238,18 @@
 # Main spec file section
 ##############################################################################
 
-Name:           MySQL%{product_suffix}
-Summary:        MySQL: a very fast and reliable SQL database server
+Name:           MySQL-Cluster%{product_suffix}
+Summary:        MySQL Cluster: a very fast and reliable SQL database server
 Group:          Applications/Databases
 Version:        @MYSQL_RPM_VERSION@
 Release:        %{release}%{?distro_releasetag:.%{distro_releasetag}}
 Distribution:   %{distro_description}
 License:        Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
-Source:         http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
+Source:         %{src_dir}.tar.gz
 URL:            http://www.mysql.com/
 Packager:       MySQL Release Engineering <mysql-build@stripped>
 Vendor:         %{mysql_vendor}
-Provides:       msqlormysql MySQL-server mysql
+Conflicts:      msqlormysql MySQL-server mysql
 BuildRequires:  %{distro_buildreq}
 
 # Think about what you use here since the first step is to
@@ -279,16 +279,17 @@ documentation and the manual for more in
 # Sub package definition
 ##############################################################################
 
-%package -n MySQL-server%{product_suffix}
-Summary:	MySQL: a very fast and reliable SQL database server
-Group:		Applications/Databases
-Requires:	%{distro_requires}
-Provides:	msqlormysql mysql MySQL mysql-server MySQL-server
-Obsoletes:	mysql MySQL mysql-server MySQL-server
-Obsoletes:	MySQL-server-classic MySQL-server-community MySQL-server-enterprise
-Obsoletes:	MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
+%package -n MySQL-Cluster-server%{product_suffix}
+Summary:        MySQL: a very fast and reliable SQL database server
+Group:          Applications/Databases
+Requires:       %{distro_requires}
+Provides:       MySQL-Cluster-server
+Obsoletes:      MySQL-Cluster-server
+Obsoletes:      MySQL-Cluster-management MySQL-Cluster-storage
+Obsoletes:      MySQL-Cluster-extra MySQL-Cluster-tools
+Conflicts:      MySQL mysql mysql-server MySQL-server
 
-%description -n MySQL-server%{product_suffix}
+%description -n MySQL-Cluster-server%{product_suffix}
 The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
 and robust SQL (Structured Query Language) database server. MySQL Server
 is intended for mission-critical, heavy-load production systems as well
@@ -310,81 +311,67 @@ This package includes the MySQL server b
 to run and administer a MySQL server.
 
 If you want to access and work with the database, you have to install
-package "MySQL-client%{product_suffix}" as well!
+package "MySQL-Cluster-client%{product_suffix}" as well!
 
 # ----------------------------------------------------------------------------
-%package -n MySQL-client%{product_suffix}
-Summary:	MySQL - Client
-Group:		Applications/Databases
-Provides:	mysql-client MySQL-client
-Obsoletes:	mysql-client MySQL-client
-Obsoletes:	MySQL-client-classic MySQL-client-community MySQL-client-enterprise
-Obsoletes:	MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
+%package -n MySQL-Cluster-client%{product_suffix}
+Summary:        MySQL Cluster - Client
+Group:          Applications/Databases
+Provides:       MySQL-Cluster-client
+Obsoletes:      MySQL-Cluster-client
 
-%description -n MySQL-client%{product_suffix}
+%description -n MySQL-Cluster-client%{product_suffix}
 This package contains the standard MySQL clients and administration tools.
 
 For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
 
 # ----------------------------------------------------------------------------
-%package -n MySQL-test%{product_suffix}
-Summary:	MySQL - Test suite
-Group:		Applications/Databases
-Requires:	MySQL-client perl
-Provides:	mysql-test MySQL-test
-Obsoletes:	mysql-test MySQL-test
-Obsoletes:	mysql-bench MySQL-bench
-Obsoletes:	MySQL-test-classic MySQL-test-community MySQL-test-enterprise
-Obsoletes:	MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
-AutoReqProv:	no
+%package -n MySQL-Cluster-test%{product_suffix}
+Requires:       MySQL-Cluster-client%{product_suffix} perl
+Summary:        MySQL Cluster - Test suite
+Group:          Applications/Databases
+Provides:       MySQL-Cluster-test
+Obsoletes:      MySQL-Cluster-test
+AutoReqProv:    no
 
-%description -n MySQL-test%{product_suffix}
+%description -n MySQL-Cluster-test%{product_suffix}
 This package contains the MySQL regression test suite.
 
 For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
 
 # ----------------------------------------------------------------------------
-%package -n MySQL-devel%{product_suffix}
-Summary:	MySQL - Development header files and libraries
-Group:		Applications/Databases
-Provides:	mysql-devel MySQL-devel
-Obsoletes:	mysql-devel MySQL-devel
-Obsoletes:	MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
-Obsoletes:	MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
+%package -n MySQL-Cluster-devel%{product_suffix}
+Summary:        MySQL Cluster - Development header files and libraries
+Group:          Applications/Databases
+Provides:       MySQL-Cluster-devel
+Obsoletes:      MySQL-Cluster-devel
 
-%description -n MySQL-devel%{product_suffix}
+%description -n MySQL-Cluster-devel%{product_suffix}
 This package contains the development header files and libraries necessary
 to develop MySQL client applications.
 
 For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
 
 # ----------------------------------------------------------------------------
-%package -n MySQL-shared%{product_suffix}
-Summary:	MySQL - Shared libraries
-Group:		Applications/Databases
-Provides:	mysql-shared MySQL-shared
-Obsoletes:	mysql-shared MySQL-shared-standard MySQL-shared-pro
-Obsoletes:	MySQL-shared-pro-cert MySQL-shared-pro-gpl
-Obsoletes:	MySQL-shared-pro-gpl-cert MySQL-shared
-Obsoletes:	MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
-Obsoletes:	MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
+%package -n MySQL-Cluster-shared%{product_suffix}
+Summary:        MySQL Cluster - Shared libraries
+Group:          Applications/Databases
+Provides:       MySQL-Cluster-shared
+Obsoletes:      MySQL-Cluster-shared
 
-%description -n MySQL-shared%{product_suffix}
+%description -n MySQL-Cluster-shared%{product_suffix}
 This package contains the shared libraries (*.so*) which certain languages
 and applications need to dynamically load and use MySQL.
 
 # ----------------------------------------------------------------------------
-%package -n MySQL-embedded%{product_suffix}
-Summary:	MySQL - Embedded library
-Group:		Applications/Databases
-Requires:	MySQL-devel
-Provides:	mysql-embedded MySQL-embedded
-Obsoletes:	mysql-embedded MySQL-embedded
-Obsoletes:	MySQL-embedded-pro
-Obsoletes:	MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
-Obsoletes:	MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
+%package -n MySQL-Cluster-embedded%{product_suffix}
+Summary:        MySQL Cluster - embedded library
+Group:          Applications/Databases
+Requires:       MySQL-Cluster-devel%{product_suffix}
+Provides:       MySQL-Cluster-embedded
+Obsoletes:      MySQL-Cluster-embedded
 
-%description -n MySQL-embedded%{product_suffix}
+%description -n MySQL-Cluster-embedded%{product_suffix}
 This package contains the MySQL server as an embedded library.
 
 The embedded MySQL server library makes it possible to run a full-featured
@@ -556,7 +543,7 @@ install -m 644 "%{malloc_lib_source}" \
 #  Post processing actions, i.e. when installed
 ##############################################################################
 
-%pre -n MySQL-server%{product_suffix}
+%pre -n MySQL-Cluster-server%{product_suffix}
 # This is the code running at the beginning of a RPM upgrade action,
 # before replacing the old files with the new ones.
 
@@ -581,7 +568,7 @@ fi
 # Check if we can safely upgrade.  An upgrade is only safe if it's from one
 # of our RPMs in the same version family.
 
-installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
+installed=`rpm -q --whatprovides MySQL-Cluster-server 2> /dev/null`
 if [ $? -eq 0 -a -n "$installed" ]; then
   vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
   version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
@@ -637,7 +624,7 @@ A manual upgrade is required.
 
   You may choose to use 'rpm --nodeps -ev <package-name>' to remove
   the package which contains the mysqlclient shared library.  The
-  library will be reinstalled by the MySQL-shared-compat package.
+  library will be reinstalled by the MySQL-Cluster-shared-compat package.
 - Install the new MySQL packages supplied by $myvendor
 - Ensure that the MySQL server is started
 - Run the 'mysql_upgrade' program
@@ -724,7 +711,7 @@ if [ -x %{_sysconfdir}/init.d/mysql ] ; 
         sleep 5
 fi
 
-%post -n MySQL-server%{product_suffix}
+%post -n MySQL-Cluster-server%{product_suffix}
 # This is the code running at the end of a RPM install or upgrade action,
 # after the (new) files have been written.
 
@@ -878,7 +865,7 @@ mv -f  $STATUS_FILE ${STATUS_FILE}-LAST 
 #scheduled service packs and more.  Visit www.mysql.com/enterprise for more
 #information."
 
-%preun -n MySQL-server%{product_suffix}
+%preun -n MySQL-Cluster-server%{product_suffix}
 
 # Which '$1' does this refer to?  Fedora docs have info:
 # " ... a count of the number of versions of the package that are installed.
@@ -907,7 +894,7 @@ fi
 # We do not remove the mysql user since it may still own a lot of
 # database files.
 
-%triggerpostun -n MySQL-server%{product_suffix} --MySQL-server-community
+%triggerpostun -n MySQL-Cluster-server%{product_suffix} -- MySQL-Cluster-server
 
 # Setup: We renamed this package, so any existing "server-community"
 #   package will be removed when this "server" is installed.
@@ -962,9 +949,9 @@ if [ "$SERVER_TO_START" = "true" ] ; the
 	fi
 fi
 
-echo "Trigger 'postun --community' finished at `date`"        >> $STATUS_HISTORY
-echo                                             >> $STATUS_HISTORY
-echo "====="                                     >> $STATUS_HISTORY
+echo "Trigger 'postun -- MySQL-Server-cluster' finished at `date`" >> $STATUS_HISTORY
+echo                                                               >> $STATUS_HISTORY
+echo "====="                                                       >> $STATUS_HISTORY
 
 
 # ----------------------------------------------------------------------
@@ -978,7 +965,7 @@ echo "====="                            
 #  Files section
 ##############################################################################
 
-%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files
+%files -n MySQL-Cluster-server%{product_suffix} -f release/support-files/plugins.files
 %defattr(-,root,root,0755)
 
 %if %{defined license_files_server}
@@ -1015,6 +1002,27 @@ echo "====="                            
 %doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
 %doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
 %doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_config.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_cpcd.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_delete_all.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_desc.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_error_reporter.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_mgm.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_backup_file.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_schema_file.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_sys_file.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_restore.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_select_all.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_select_count.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_show_tables.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_size.pl.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_waiter.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndbd_redo_log_reader.1*
+%doc %attr(644, root, man) %{_mandir}/man8/ndb_mgmd.8*
+%doc %attr(644, root, man) %{_mandir}/man8/ndbd.8*
+%doc %attr(644, root, man) %{_mandir}/man8/ndbmtd.8*
 %doc %attr(644, root, man) %{_mandir}/man1/perror.1*
 %doc %attr(644, root, man) %{_mandir}/man1/replace.1*
 %doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
@@ -1043,27 +1051,63 @@ echo "====="                            
 %attr(755, root, root) %{_bindir}/mysqldumpslow
 %attr(755, root, root) %{_bindir}/mysqlhotcopy
 %attr(755, root, root) %{_bindir}/mysqltest
+%attr(755, root, root) %{_bindir}/ndb_error_reporter
+%attr(755, root, root) %{_bindir}/ndb_size.pl
+%attr(755, root, root) %{_bindir}/ndbinfo_select_all
 %attr(755, root, root) %{_bindir}/perror
 %attr(755, root, root) %{_bindir}/replace
 %attr(755, root, root) %{_bindir}/resolve_stack_dump
 %attr(755, root, root) %{_bindir}/resolveip
 
+%attr(755, root, root) %{_bindir}/ndb_config
+%attr(755, root, root) %{_bindir}/ndb_delete_all
+%attr(755, root, root) %{_bindir}/ndb_desc
+%attr(755, root, root) %{_bindir}/ndb_drop_index
+%attr(755, root, root) %{_bindir}/ndb_drop_table
+%attr(755, root, root) %{_bindir}/ndb_index_stat
+%attr(755, root, root) %{_bindir}/ndb_mgm
+%attr(755, root, root) %{_bindir}/ndb_print_backup_file
+%attr(755, root, root) %{_bindir}/ndb_print_file
+%attr(755, root, root) %{_bindir}/ndb_print_schema_file
+%attr(755, root, root) %{_bindir}/ndb_print_sys_file
+%attr(755, root, root) %{_bindir}/ndb_redo_log_reader
+%attr(755, root, root) %{_bindir}/ndb_restore
+%attr(755, root, root) %{_bindir}/ndb_select_all
+%attr(755, root, root) %{_bindir}/ndb_select_count
+%attr(755, root, root) %{_bindir}/ndb_show_tables
+%attr(755, root, root) %{_bindir}/ndb_waiter
+
+%if %(test "@MEMCACHED_ROOT_DIR@" '!=' "MEMCACHED_ROOT_DIR-NOTFOUND" && echo 1 || echo 0)
+%attr(755, root, root) %{_sbindir}/memcached
+%endif
 %attr(755, root, root) %{_sbindir}/mysqld
 %attr(755, root, root) %{_sbindir}/mysqld-debug
+%attr(755, root, root) %{_sbindir}/ndbd
+%attr(755, root, root) %{_sbindir}/ndb_mgmd
+%attr(755, root, root) %{_sbindir}/ndbmtd
 %attr(755, root, root) %{_sbindir}/rcmysql
+
 %attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
 
 %if %{WITH_TCMALLOC}
 %attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
 %endif
 
+%attr(755, root, root) %{_libdir}/mysql/libndbclient_static.a
+
+%attr(755, root, root) %{_libdir}/libndbclient.so
+%attr(755, root, root) %{_libdir}/libndbclient.so.6.0.0
+%if %(test "@MEMCACHED_ROOT_DIR@" '!=' "MEMCACHED_ROOT_DIR-NOTFOUND" && echo 1 || echo 0)
+%attr(755, root, root) %{_libdir}/ndb_engine.so
+%endif
+
 %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
 %attr(755, root, root) %{_sysconfdir}/init.d/mysql
 
 %attr(755, root, root) %{_datadir}/mysql/
 
 # ----------------------------------------------------------------------------
-%files -n MySQL-client%{product_suffix}
+%files -n MySQL-Cluster-client%{product_suffix}
 
 %defattr(-, root, root, 0755)
 %attr(755, root, root) %{_bindir}/msql2mysql
@@ -1095,7 +1139,7 @@ echo "====="                            
 %doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1*
 
 # ----------------------------------------------------------------------------
-%files -n MySQL-devel%{product_suffix} -f optional-files-devel
+%files -n MySQL-Cluster-devel%{product_suffix} -f optional-files-devel
 %defattr(-, root, root, 0755)
 %doc %attr(644, root, man) %{_mandir}/man1/comp_err.1*
 %doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
@@ -1109,19 +1153,19 @@ echo "====="                            
 %{_libdir}/mysql/libmysqlservices.a
 
 # ----------------------------------------------------------------------------
-%files -n MySQL-shared%{product_suffix}
+%files -n MySQL-Cluster-shared%{product_suffix}
 %defattr(-, root, root, 0755)
 # Shared libraries (omit for architectures that don't support them)
 %{_libdir}/libmysql*.so*
 
-%post -n MySQL-shared%{product_suffix}
+%post -n MySQL-Cluster-shared%{product_suffix}
 /sbin/ldconfig
 
-%postun -n MySQL-shared%{product_suffix}
+%postun -n MySQL-Cluster-shared%{product_suffix}
 /sbin/ldconfig
 
 # ----------------------------------------------------------------------------
-%files -n MySQL-test%{product_suffix}
+%files -n MySQL-Cluster-test%{product_suffix}
 %defattr(-, root, root, 0755)
 %attr(-, root, root) %{_datadir}/mysql-test
 %attr(755, root, root) %{_bindir}/mysql_client_test
@@ -1134,7 +1178,7 @@ echo "====="                            
 %doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
 
 # ----------------------------------------------------------------------------
-%files -n MySQL-embedded%{product_suffix}
+%files -n MySQL-Cluster-embedded%{product_suffix}
 %defattr(-, root, root, 0755)
 %attr(755, root, root) %{_bindir}/mysql_embedded
 %attr(644, root, root) %{_libdir}/mysql/libmysqld.a
@@ -1146,20 +1190,30 @@ echo "====="                            
 # merging BK trees)
 ##############################################################################
 %changelog
+* Thu Jan 19 2012 Bjorn Munch <bjorn.munch@stripped>
+
+- Reinstate embedded, undoing the previous change
+
+* Fri Nov 25 2011 Jonathan Perkin <jonathan.perkin@stripped>
+
+- Remove embedded product and files, for now it is disabled.
+
+* Thu Nov 24 2011 Jonathan Perkin <jonathan.perkin@stripped>
+
+- More additional Cluster files.
+
+* Thu Sep 29 2011 Jonathan Perkin <jonathan.perkin@stripped>
+
+- Bring over the most important bits from the previous Cluster spec files.
+
 * Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@stripped>
 
 - Fix duplicate mentioning of "mysql_plugin" and its manual page,
   it is better to keep alphabetic order in the files list (merging!).
-  
-* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@stripped>
 
-- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
-  the RPMs of any configuration (of the current or the preceding release series)
-  by the new ones. This is done by not using the implicitly generated capabilities
-  (which include the configuration name) and relying on more generic ones which
-  just list the function ("server", "client", ...).
-  The implicit generation cannot be prevented, so all these capabilities must be
-  explicitly listed in "Obsoletes:"
+* Tue Sep 27 2011 Daniel Fischer <daniel.fischer@stripped>
+
+- Add Cluster files.
 
 * Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@stripped>
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3838 to 3853) magnus.blaudd20 Mar