3685 Jonas Oreland 2010-09-28 [merge]
ndb - merge 70-main into 70-llcp
removed:
storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp
storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp
storage/ndb/test/tools/transproxy.cpp
renamed:
mysql-test/include/ndb_desc_print.inc => mysql-test/suite/ndb/include/ndb_desc_print.inc
mysql-test/include/ndb_execute_count.inc => mysql-test/suite/ndb/include/ndb_execute_count.inc
mysql-test/include/ndb_init_execute_count.inc => mysql-test/suite/ndb/include/ndb_init_execute_count.inc
mysql-test/include/ndb_init_scan_counts.inc => mysql-test/suite/ndb/include/ndb_init_scan_counts.inc
mysql-test/include/ndb_scan_counts.inc => mysql-test/suite/ndb/include/ndb_scan_counts.inc
modified:
.bzr-mysql/default.conf
include/config-win.h
mysql-test/suite/ndb/t/ndb_bulk_delete.test
mysql-test/suite/ndb/t/ndb_native_default_support.test
mysql-test/suite/ndb/t/ndb_partition_hash.test
mysql-test/suite/ndb/t/ndb_partition_key.test
mysql-test/suite/ndb/t/ndb_partition_list.test
mysql-test/suite/ndb/t/ndb_partition_range.test
mysql-test/suite/ndb/t/ndb_read_multi_range.test
mysql-test/suite/ndb/t/ndb_sql_allow_batching.test
mysql-test/suite/ndb/t/ndb_update_no_read.test
storage/ndb/include/portlib/NdbDir.hpp
storage/ndb/include/portlib/NdbMem.h
storage/ndb/include/portlib/NdbThread.h
storage/ndb/include/util/NdbAutoPtr.hpp
storage/ndb/include/util/NdbTap.hpp
storage/ndb/include/util/azlib.h
storage/ndb/src/common/portlib/NdbDir.cpp
storage/ndb/src/common/util/azio.c
storage/ndb/src/cw/cpcd/main.cpp
storage/ndb/src/kernel/angel.cpp
storage/ndb/src/kernel/blocks/CMakeLists.txt
storage/ndb/src/kernel/blocks/Makefile.am
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp
storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp
storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp
storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp
storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.hpp
storage/ndb/src/kernel/ndbd.cpp
storage/ndb/src/mgmclient/CommandInterpreter.cpp
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
storage/ndb/src/mgmsrv/main.cpp
storage/ndb/test/ndbapi/testIndex.cpp
storage/ndb/test/ndbapi/testIndexStat.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/run-test/files.cpp
storage/ndb/test/src/NdbBackup.cpp
storage/ndb/test/tools/CMakeLists.txt
storage/ndb/test/tools/Makefile.am
storage/ndb/tools/restore/consumer_restore.cpp
3684 Jonas Oreland 2010-09-23 [merge]
ndb - merge 70-main
added:
mysql-test/suite/ndb/bug56185.ini
storage/ndb/include/util/SparseBitmask.hpp
storage/ndb/src/common/util/SparseBitmask.cpp
storage/ndb/src/common/util/parse_mask.hpp
storage/ndb/src/kernel/vm/ArenaPool.cpp
storage/ndb/src/kernel/vm/ArenaPool.hpp
modified:
CMakeLists.txt
client/mysqldump.c
configure.in
include/sha1.h
mysql-test/Makefile.am
mysql-test/collections/default.experimental
mysql-test/mysql-test-run.pl
mysql-test/r/mysqldump.result
mysql-test/suite/funcs_1/t/disabled.def
mysql-test/suite/ndb/ndb_config_mycnf1.cnf
mysql-test/suite/ndb/r/ndb_config.result
mysql-test/suite/ndb/r/ndb_database.result
mysql-test/suite/ndb/r/ndb_partition_range.result
mysql-test/suite/ndb/t/ndb_config.test
mysql-test/suite/ndb/t/ndb_database.test
mysql-test/suite/ndb/t/ndb_partition_range.test
mysql-test/suite/ndb/t/test_mgmd.cnf
mysql-test/suite/ndb_binlog/r/ndb_binlog_multi.result
mysql-test/suite/ndb_binlog/t/ndb_binlog_multi.test
mysql-test/t/mysqldump.test
mysys/sha1.c
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.h
sql/ha_ndbcluster_binlog.cc
sql/handler.cc
sql/handler.h
sql/mysql_priv.h
sql/sql_partition.cc
sql/sql_show.cc
sql/sql_table.cc
sql/sql_yacc.yy
sql/table.cc
sql/unireg.cc
storage/ndb/include/kernel/AttributeList.hpp
storage/ndb/include/kernel/BlockNumbers.h
storage/ndb/include/kernel/GlobalSignalNumbers.h
storage/ndb/include/kernel/signaldata/BackupSignalData.hpp
storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp
storage/ndb/include/kernel/signaldata/ConfigChange.hpp
storage/ndb/include/kernel/signaldata/CreateEvnt.hpp
storage/ndb/include/kernel/signaldata/DiGetNodes.hpp
storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp
storage/ndb/include/kernel/signaldata/StopMe.hpp
storage/ndb/include/kernel/signaldata/SumaImpl.hpp
storage/ndb/include/mgmapi/mgmapi.h
storage/ndb/include/mgmapi/ndbd_exit_codes.h
storage/ndb/include/ndb_global.h
storage/ndb/include/ndb_version.h.in
storage/ndb/include/ndbapi/NdbDictionary.hpp
storage/ndb/include/portlib/NdbCondition.h
storage/ndb/include/portlib/NdbDir.hpp
storage/ndb/include/portlib/NdbSleep.h
storage/ndb/include/util/BaseString.hpp
storage/ndb/include/util/Bitmask.hpp
storage/ndb/include/util/HashMap.hpp
storage/ndb/include/util/NdbSqlUtil.hpp
storage/ndb/include/util/NdbTap.hpp
storage/ndb/include/util/ndb_opts.h
storage/ndb/ndb_configure.m4
storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
storage/ndb/src/common/portlib/NdbCondition.c
storage/ndb/src/common/portlib/NdbDir.cpp
storage/ndb/src/common/util/BaseString.cpp
storage/ndb/src/common/util/Bitmask.cpp
storage/ndb/src/common/util/CMakeLists.txt
storage/ndb/src/common/util/Makefile.am
storage/ndb/src/common/util/NdbSqlUtil.cpp
storage/ndb/src/common/util/ndb_init.cpp
storage/ndb/src/common/util/ndb_opts.c
storage/ndb/src/cw/cpcd/main.cpp
storage/ndb/src/kernel/angel.cpp
storage/ndb/src/kernel/angel.hpp
storage/ndb/src/kernel/blocks/ERROR_codes.txt
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp
storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp
storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp
storage/ndb/src/kernel/blocks/suma/Suma.cpp
storage/ndb/src/kernel/blocks/suma/Suma.hpp
storage/ndb/src/kernel/blocks/suma/SumaInit.cpp
storage/ndb/src/kernel/error/ErrorReporter.cpp
storage/ndb/src/kernel/error/ndbd_exit_codes.c
storage/ndb/src/kernel/main.cpp
storage/ndb/src/kernel/ndbd.cpp
storage/ndb/src/kernel/vm/CMakeLists.txt
storage/ndb/src/kernel/vm/Configuration.cpp
storage/ndb/src/kernel/vm/Configuration.hpp
storage/ndb/src/kernel/vm/Makefile.am
storage/ndb/src/kernel/vm/Pool.hpp
storage/ndb/src/kernel/vm/RWPool.hpp
storage/ndb/src/kernel/vm/SafeCounter.hpp
storage/ndb/src/kernel/vm/WOPool.hpp
storage/ndb/src/kernel/vm/mt.cpp
storage/ndb/src/mgmapi/LocalConfig.cpp
storage/ndb/src/mgmapi/LocalConfig.hpp
storage/ndb/src/mgmapi/mgmapi.cpp
storage/ndb/src/mgmapi/mgmapi_internal.h
storage/ndb/src/mgmapi/ndb_logevent.cpp
storage/ndb/src/mgmclient/CommandInterpreter.cpp
storage/ndb/src/mgmclient/main.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/mgmsrv/ConfigInfo.hpp
storage/ndb/src/mgmsrv/ConfigManager.cpp
storage/ndb/src/mgmsrv/ConfigManager.hpp
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
storage/ndb/src/mgmsrv/Services.cpp
storage/ndb/src/mgmsrv/main.cpp
storage/ndb/src/mgmsrv/testConfig.cpp
storage/ndb/src/ndbapi/DictCache.cpp
storage/ndb/src/ndbapi/DictCache.hpp
storage/ndb/src/ndbapi/Ndb.cpp
storage/ndb/src/ndbapi/NdbDictionary.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
storage/ndb/src/ndbapi/Ndbif.cpp
storage/ndb/src/ndbapi/TransporterFacade.hpp
storage/ndb/test/include/NdbRestarter.hpp
storage/ndb/test/ndbapi/testBasic.cpp
storage/ndb/test/ndbapi/testBitfield.cpp
storage/ndb/test/ndbapi/testDict.cpp
storage/ndb/test/ndbapi/testMgmd.cpp
storage/ndb/test/ndbapi/testOIBasic.cpp
storage/ndb/test/ndbapi/testRestartGci.cpp
storage/ndb/test/ndbapi/testScan.cpp
storage/ndb/test/ndbapi/testSystemRestart.cpp
storage/ndb/test/ndbapi/test_event.cpp
storage/ndb/test/run-test/atrt.hpp
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/run-test/files.cpp
storage/ndb/test/src/NDBT_Test.cpp
storage/ndb/test/src/NdbRestarter.cpp
storage/ndb/tools/delete_all.cpp
storage/ndb/tools/desc.cpp
storage/ndb/tools/drop_index.cpp
storage/ndb/tools/drop_tab.cpp
storage/ndb/tools/listTables.cpp
storage/ndb/tools/ndb_config.cpp
storage/ndb/tools/restore/restore_main.cpp
storage/ndb/tools/select_all.cpp
storage/ndb/tools/select_count.cpp
storage/ndb/tools/waiter.cpp
support-files/compiler_warnings.supp
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf 2010-06-16 20:49:05 +0000
+++ b/.bzr-mysql/default.conf 2010-09-28 11:29:26 +0000
@@ -1,4 +1,4 @@
[MYSQL]
post_commit_to = commits@stripped
post_push_to = commits@stripped
-tree_name = mysql-5.1-telco-7.0
+tree_name = mysql-5.1-telco-7.0-llcp
=== modified file 'include/config-win.h'
--- a/include/config-win.h 2010-08-18 14:29:33 +0000
+++ b/include/config-win.h 2010-09-23 09:36:19 +0000
@@ -433,11 +433,6 @@ inline ulonglong double2ulonglong(double
#define HAVE_UCA_COLLATIONS 1
#define HAVE_BOOL 1
-/* Windows doesn't define ENOTSUP, define it as the same as Solaris */
-#ifndef ENOTSUP
-#define ENOTSUP 48
-#endif
-
#if _MSC_VER >= 1400 /* strtok_s is like strtok_r, but is new */
#define HAVE_STRTOK_R
#define strtok_r(A, B, C) strtok_s((A), (B), (C))
=== renamed file 'mysql-test/include/ndb_desc_print.inc' => 'mysql-test/suite/ndb/include/ndb_desc_print.inc'
=== renamed file 'mysql-test/include/ndb_execute_count.inc' => 'mysql-test/suite/ndb/include/ndb_execute_count.inc'
=== renamed file 'mysql-test/include/ndb_init_execute_count.inc' => 'mysql-test/suite/ndb/include/ndb_init_execute_count.inc'
=== renamed file 'mysql-test/include/ndb_init_scan_counts.inc' => 'mysql-test/suite/ndb/include/ndb_init_scan_counts.inc'
=== renamed file 'mysql-test/include/ndb_scan_counts.inc' => 'mysql-test/suite/ndb/include/ndb_scan_counts.inc'
=== modified file 'mysql-test/suite/ndb/t/ndb_bulk_delete.test'
--- a/mysql-test/suite/ndb/t/ndb_bulk_delete.test 2008-09-24 14:44:11 +0000
+++ b/mysql-test/suite/ndb/t/ndb_bulk_delete.test 2010-09-22 11:36:01 +0000
@@ -29,9 +29,9 @@ insert into t1 select a+128 from t1;
--echo # 0 - delete the rows (without bulk update this is 5 + 1 for execute no commit)
--echo # 1 - delete the row + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
delete from t1 where a in (1,7, 90, 100, 130);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# Test delete with non existant pk
# Bug 37153
@@ -42,9 +42,9 @@ delete from t1 where a in (1,7, 90, 100,
--echo # 1 - commit
--echo # affected = 0
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
delete from t1 where a=1000;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
--echo # expected result 1 roundtrips
--echo # 0 - info call
@@ -53,9 +53,9 @@ delete from t1 where a=1000;
--echo # 1 - commit
--echo # affected = 0
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
delete from t1 where a in (1000, 1001, 1002, 1003, 1004);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# cleanup
=== modified file 'mysql-test/suite/ndb/t/ndb_native_default_support.test'
--- a/mysql-test/suite/ndb/t/ndb_native_default_support.test 2010-08-19 13:35:45 +0000
+++ b/mysql-test/suite/ndb/t/ndb_native_default_support.test 2010-09-22 15:27:31 +0000
@@ -151,9 +151,9 @@ DROP TABLE IF EXISTS t1, bit1;
--sorted_result
SHOW TABLES;
--let ndb_desc_opts= -d mysqltest t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
--let ndb_desc_opts= -d mysqltest bit1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
SELECT pk,BIN(b1),BIN(b2),BIN(b3),BIN(b4),BIN(b5) FROM bit1 ORDER BY pk;
--replace_column 12 CURRENT_TIMESTAMP
SELECT i, j, f, d, d2, ch, vch, HEX(b), HEX(vb), HEX(blob1), text1, timestamp_c, ch2 FROM t1 ORDER BY i;
@@ -200,10 +200,10 @@ DROP DATABASE mysqltest;
# Show that restored tables have no native defaults
--let ndb_desc_opts= -d test t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
--let ndb_desc_opts= -d test bit1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
USE test;
--sorted_result
@@ -225,7 +225,7 @@ SHOW CREATE TABLE t1;
# Show that the defaults are now native
--let ndb_desc_opts= -d test t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
--disable_warnings
INSERT INTO t1 VALUES();
@@ -252,12 +252,12 @@ SELECT pk,BIN(b1),BIN(b2),BIN(b3),BIN(b4
#--echo * Alter table restoring from 6.3 backup to new table with native default support
#--echo ********************************************************************************
#--let ndb_desc_opts= -d test t1
-#--source include/ndb_desc_print.inc
+#--source suite/ndb/include/ndb_desc_print.inc
#
#ALTER TABLE t1 CHANGE COLUMN j j INT DEFAULT 6;
#
#--let ndb_desc_opts= -d test t1
-#--source include/ndb_desc_print.inc
+#--source suite/ndb/include/ndb_desc_print.inc
--disable_warnings
INSERT INTO t1(i, ch) VALUES(99, "native default support");
@@ -288,7 +288,7 @@ SELECT * FROM t2 ORDER BY i;
ALTER TABLE t2 MODIFY COLUMN j INT DEFAULT 666;
--let ndb_desc_opts= -d test t2
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO t2 VALUES();
SELECT * FROM t2 ORDER BY i;
@@ -306,7 +306,7 @@ DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (a int primary key, b int default 12, c char not null) engine=ndb;
--let ndb_desc_opts= -d test t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
DROP TABLE t1;
@@ -324,7 +324,7 @@ CREATE TABLE t1 (a int primary key,
h enum('Pig','Lion') not null,
i char(2) default '66') engine=ndb;
--let ndb_desc_opts= -d test t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
DROP TABLE t1;
@@ -339,7 +339,7 @@ CREATE TABLE t1 (a int primary key,
SHOW CREATE TABLE t1;
--let ndb_desc_opts= -d test t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
DROP TABLE t1;
@@ -353,7 +353,7 @@ CREATE TABLE variant (a int primary key,
b timestamp) engine =ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 2 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -364,7 +364,7 @@ CREATE TABLE variant (a int primary key,
b timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP) engine =ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 2 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -375,7 +375,7 @@ CREATE TABLE variant (a int primary key,
b timestamp DEFAULT CURRENT_TIMESTAMP) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 2 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -387,7 +387,7 @@ CREATE TABLE variant (a int primary key,
c int) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a,c) VALUES (1,1);
SELECT * from variant;
UPDATE variant SET c=2;
@@ -400,7 +400,7 @@ CREATE TABLE variant (a int primary key,
b timestamp DEFAULT 0) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
SELECT * from variant;
DROP TABLE variant;
@@ -410,7 +410,7 @@ CREATE TABLE variant (a int primary key,
b timestamp DEFAULT 19770623000001) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
SELECT * from variant;
DROP TABLE variant;
@@ -421,7 +421,7 @@ CREATE TABLE variant (a int primary key,
c timestamp DEFAULT CURRENT_TIMESTAMP) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 3 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -433,7 +433,7 @@ CREATE TABLE variant (a int primary key,
c timestamp ON UPDATE CURRENT_TIMESTAMP) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
SELECT * from variant;
UPDATE variant SET b=20100603000001;
@@ -447,7 +447,7 @@ CREATE TABLE variant (a int primary key,
c timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 3 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -458,7 +458,7 @@ CREATE TABLE variant (a int primary key,
b timestamp NULL) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
SELECT * from variant;
DROP TABLE variant;
@@ -468,7 +468,7 @@ CREATE TABLE variant (a int primary key,
b timestamp NULL DEFAULT 0) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
SELECT * from variant;
DROP TABLE variant;
@@ -478,7 +478,7 @@ CREATE TABLE variant (a int primary key,
b timestamp NULL DEFAULT 19770623000001) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
SELECT * from variant;
DROP TABLE variant;
@@ -488,7 +488,7 @@ CREATE TABLE variant (a int primary key,
b timestamp NULL DEFAULT CURRENT_TIMESTAMP) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 2 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -500,7 +500,7 @@ CREATE TABLE variant (a int primary key,
c int) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a,c) VALUES (1,1);
SELECT * from variant;
UPDATE variant SET c=2;
@@ -513,7 +513,7 @@ CREATE TABLE variant (a int primary key,
b timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP) engine = ndb;
SHOW CREATE TABLE variant;
--let ndb_desc_opts= -d test variant
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
INSERT INTO variant (a) VALUES (1);
--replace_column 2 CURRENT_TIMESTAMP
SELECT * from variant;
@@ -567,7 +567,7 @@ CREATE TABLE bit1 (
SHOW CREATE TABLE t1;
--let ndb_desc_opts= -d test t1
---source include/ndb_desc_print.inc
+--source suite/ndb/include/ndb_desc_print.inc
--exec $NDB_RESTORE --no-defaults -b 1 -n 1 -r --promote-attribute --exclude-missing-columns $MYSQL_TEST_DIR/std_data/ndb_backup_before_native_default >> $NDB_TOOLS_OUTPUT
--exec $NDB_RESTORE --no-defaults -b 1 -n 2 -r --promote-attribute --exclude-missing-columns $MYSQL_TEST_DIR/std_data/ndb_backup_before_native_default >> $NDB_TOOLS_OUTPUT
=== modified file 'mysql-test/suite/ndb/t/ndb_partition_hash.test'
--- a/mysql-test/suite/ndb/t/ndb_partition_hash.test 2009-04-08 17:41:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_partition_hash.test 2010-09-22 12:12:14 +0000
@@ -41,18 +41,18 @@ insert into t1 values (1,0,0,0,0),(1,0,0
insert into t1 values (2,0,0,0,0),(4,0,0,0,0),(4,0,0,1,0);
insert into t1 values (0,1,1,4,0),(0,1,1,5,0); # Only rows affected.
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
UPDATE t1 force index (primary) SET ol_tmp = 1
WHERE ol_o_id = 0 AND ol_d_id = 1 AND ol_w_id = 1;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
SELECT * FROM t1 WHERE ol_w_id = 1 AND ol_d_id = 1 AND ol_o_id = 0;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
SELECT SUM(ol_number) FROM t1 WHERE ol_o_id = 0 AND ol_w_id = 1 AND ol_d_id = 1;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_partition_key.test'
--- a/mysql-test/suite/ndb/t/ndb_partition_key.test 2009-07-13 13:22:46 +0000
+++ b/mysql-test/suite/ndb/t/ndb_partition_key.test 2010-09-22 12:12:14 +0000
@@ -262,25 +262,25 @@ insert into nott1 values (1,2,6);
insert into nott1 values (2,22,7);
--echo All partitions scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from nott1 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from nott1 where a=0 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from nott1 where a=4 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo MRR scan on one partition
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from nott1 where a=0 and (( b > 0 and b < 3) or
( b > 5 and b < 10) or
( b > 22 and b < 50)) order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
drop table nott1;
=== modified file 'mysql-test/suite/ndb/t/ndb_partition_list.test'
--- a/mysql-test/suite/ndb/t/ndb_partition_list.test 2009-05-16 08:26:43 +0000
+++ b/mysql-test/suite/ndb/t/ndb_partition_list.test 2010-09-22 12:12:14 +0000
@@ -61,23 +61,23 @@ insert into t1 values (4, 1, 7);
insert into t1 values (4, 2, 8);
--echo All partitions scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a=0 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a=4 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo MRR single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a in (0, 2) order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_partition_range.test'
--- a/mysql-test/suite/ndb/t/ndb_partition_range.test 2010-09-16 10:53:40 +0000
+++ b/mysql-test/suite/ndb/t/ndb_partition_range.test 2010-09-22 12:12:14 +0000
@@ -294,28 +294,28 @@ insert into t1 values (4, 1, 7);
insert into t1 values (4, 2, 8);
--echo All partitions scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a=0 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a=4 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo Single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a<3 order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
--echo MRR single partition scan
---source include/ndb_init_scan_counts.inc
+--source suite/ndb/include/ndb_init_scan_counts.inc
select * from t1 where a in (0, 2) order by c;
---source include/ndb_scan_counts.inc
+--source suite/ndb/include/ndb_scan_counts.inc
drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_read_multi_range.test'
--- a/mysql-test/suite/ndb/t/ndb_read_multi_range.test 2009-02-03 13:35:56 +0000
+++ b/mysql-test/suite/ndb/t/ndb_read_multi_range.test 2010-09-22 11:36:01 +0000
@@ -14,98 +14,98 @@ create table t1 (
c int not null,
index(b), unique index using hash(c)
) engine = ndb;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
insert into t1 values
(1,2,1),(2,3,2),(3,4,3),(4,5,4),
(5,2,12),(6,3,11),(7,4,10),(8,5,9),
(9,2,8),(10,3,7),(11,4,6),(12,5,5);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# batch on primary key
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where a in (2,8,12);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
# batch on ordered index
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where b in (1,2,5);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
# batch on unique hash index
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where c in (2,8,12);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
# batch mixed
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where a in (2,8) or (a > 11) or (a <= 1);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
# batch on primary key, missing values
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where a in (33,8,12);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where a in (2,33,8,12,34);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
# batch on ordered index, missing values
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where b in (1,33,5);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where b in (1,33,5) order by a;
---source include/ndb_execute_count.inc
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where b in (45,1,33,5,44);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where b in (45,22) order by a;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# batch on unique hash index, missing values
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where c in (2,8,33);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1 where c in (13,2,8,33,12);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a;
drop table r1;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where a in (33,8,12) order by a;
---source include/ndb_execute_count.inc
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where a in (33,34,35) order by a;
---source include/ndb_execute_count.inc
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where a in (2,8) or (a > 11) or (a <= 1) order by a;
---source include/ndb_execute_count.inc
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where b in (6,7) or (b <= 5) or (b >= 10) order by b,a;
---source include/ndb_execute_count.inc
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
select * from t1 where c in (13,2,8,33,12) order by c,a;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
drop table t1;
#
@@ -121,7 +121,7 @@ create table t1 (
primary key (a,b,c,d), index (d)
) engine = ndb;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
insert into t1 values
(1,2,1,1,1),(2,3,2,3,1),(3,4,3,1,1),(4,5,4,7,1),
(5,2,12,12,1),(6,3,11,1,1),(7,4,10,3,1),(8,5,9,5,1),
@@ -130,13 +130,13 @@ insert into t1 values
(1,2,1,3,1),
(1,2,1,4,1),
(1,2,1,5,1);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# batch on primary key
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
create table r1 as select * from t1
where a=1 and b=2 and c=1 and d in (1,4,3,2);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from r1 order by a,b,c,d;
drop table r1;
=== modified file 'mysql-test/suite/ndb/t/ndb_sql_allow_batching.test'
--- a/mysql-test/suite/ndb/t/ndb_sql_allow_batching.test 2008-05-08 08:39:40 +0000
+++ b/mysql-test/suite/ndb/t/ndb_sql_allow_batching.test 2010-09-22 11:36:01 +0000
@@ -13,36 +13,36 @@ create table t2 (a int key, b int) engin
insert into t1 values (0,0),(1,1),(2,2);
insert into t2 select * from t1;
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
set transaction_allow_batching=1;
update t1 set b=0 where a=2;
commit;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 order by a;
--echo
--echo With batching only 1 roundtrip
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
set transaction_allow_batching=1;
insert into t1 values (10,10);
insert into t2 values (10,10);
commit;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 order by a;
--echo
--echo Without batching only 3 roundtrips
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
set transaction_allow_batching=0;
insert into t1 values (11,11);
insert into t2 values (11,11);
commit;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 order by a;
# cleanup
=== modified file 'mysql-test/suite/ndb/t/ndb_update_no_read.test'
--- a/mysql-test/suite/ndb/t/ndb_update_no_read.test 2008-12-05 09:46:39 +0000
+++ b/mysql-test/suite/ndb/t/ndb_update_no_read.test 2010-09-22 11:36:01 +0000
@@ -34,9 +34,9 @@ insert into t1 values (1,10,1),(2,9,1),(
--echo # 0 - update the row (deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 111, b = 20 where a = 1;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where a = 1 order by a;
@@ -47,9 +47,9 @@ select * from t1 where a = 1 order by a;
--echo # 0 - delete the row (deferred to commit)
--echo # 1 - delete + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
delete from t1 where a = 1;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where a = 1 order by a;
@@ -60,9 +60,9 @@ select * from t1 where a = 1 order by a;
--echo # 0 - update the row (deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 1111 where b = 2;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where b = 2 order by a;
@@ -73,9 +73,9 @@ select * from t1 where b = 2 order by a;
--echo # 0 - update the row (deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 12, b = 19 where b = 2;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where b = 2 order by a;
@@ -86,9 +86,9 @@ select * from t1 where b = 2 order by a;
--echo # 0 - delete the row (deferred to commit)
--echo # 1 - delete and commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
delete from t1 where b = 19;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where b = 19 order by a;
@@ -99,9 +99,9 @@ select * from t1 where b = 19 order by a
--echo # 0 - update the rows (deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 22 where a = 10 or a >= 10;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 order by a;
@@ -112,9 +112,9 @@ select * from t1 order by a;
--echo # 0 - update the rows (2 if no bulk update + 1 deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 23 where a in (8,10);
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 order by a;
@@ -125,9 +125,9 @@ select * from t1 order by a;
--echo # 0 - update the rows (executed during read)
--echo # 1 - commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 23 where a in (7,8) or a >= 10;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 order by a;
@@ -141,11 +141,11 @@ select * from t1 order by a;
--echo # 0 - update the rows (deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 11 where a = 3 or b = 7;
### Disable this test, as it's unpredictable...
### cause scan can get one or two batches...
-#--source include/ndb_execute_count.inc
+#--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where a = 3 or b = 7 order by a;
@@ -158,9 +158,9 @@ select * from t1 where a = 3 or b = 7 or
--echo # 1 - insert the row (pk update)
--echo # 1 - commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set a = 13, b = 20 where a = 3;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where a = 13 order by a;
@@ -173,9 +173,9 @@ select * from t1 where a = 13 order by a
--echo # 1 - insert the row (pk update)
--echo # 1 - commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set a = 12, b = 19 where b = 7;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where b = 19 order by a;
@@ -188,9 +188,9 @@ select * from t1 where b = 7 order by a;
--echo # 0 - update the rows (deferred to commit)
--echo # 1 - update + commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set c = 12, b = 29 where a = 5 and b = 6;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where b = 19 order by a;
@@ -201,9 +201,9 @@ select * from t1 where b = 19 order by a
--echo # 0 - delete the rows (no row found)
--echo # 1 - commit the transaction
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
delete from t1 where b = 6 and c = 12;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
select * from t1 where b = 6 order by a;
@@ -227,9 +227,9 @@ insert into t1 values (1, '1'), (2, '2')
--echo # 1 - update+commit the row
--echo # Rows matched=changed=affected=1
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set b='two' where a=2;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# Autocommit, unsuccessful update
@@ -241,9 +241,9 @@ update t1 set b='two' where a=2;
--echo # 1 - update+commit the row
--echo # Rows matched=changed=affected=0
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set b='lots' where a=2000;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# Autocommit, successful update + warning
--echo
@@ -255,9 +255,9 @@ update t1 set b='lots' where a=2000;
--echo # Rows matched=changed=affected=1
--echo # 1 warning
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set b='one plus one' where a=2;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# Autocommit, unsuccessful update + warning
@@ -271,10 +271,10 @@ update t1 set b='one plus one' where a=2
--echo # 1 warning
--echo
--disable_warnings # Workaround to bug#39663
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
update t1 set b='two thousand' where a=2000;
show warnings; # Workaround to bug#39663
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
--enable_warnings # Workaround to bug#39663
@@ -287,11 +287,11 @@ show warnings; # Workaround to bug#39663
--echo # 1 - commit
--echo # Rows matched=changed=affected=1
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
update t1 set b='two' where a=2;
commit;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# No autocommit, unsuccessful update
@@ -303,11 +303,11 @@ commit;
--echo # 1 - commit
--echo # Rows matched=changed=affected=0
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
update t1 set b='lots' where a=2000;
commit;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# No autocommit, successful update + warning
@@ -320,11 +320,11 @@ commit;
--echo # Rows matched=changed=affected=1
--echo 1 warning
--echo
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
update t1 set b='one plus one' where a=2;
commit;
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
# No autocommit, unsuccessful update + warning
@@ -338,12 +338,12 @@ commit;
--echo # 1 warning
--echo
--disable_warnings # Workaround to bug#39663
---source include/ndb_init_execute_count.inc
+--source suite/ndb/include/ndb_init_execute_count.inc
begin;
update t1 set b='two thousand' where a=2000;
commit;
show warnings; # Workaround to bug#39663
---source include/ndb_execute_count.inc
+--source suite/ndb/include/ndb_execute_count.inc
--enable_warnings # Workaround to bug#39663
drop table t1;
=== modified file 'storage/ndb/include/portlib/NdbDir.hpp'
--- a/storage/ndb/include/portlib/NdbDir.hpp 2010-08-23 11:20:11 +0000
+++ b/storage/ndb/include/portlib/NdbDir.hpp 2010-09-23 09:02:47 +0000
@@ -72,13 +72,18 @@ public:
/*
Create directory
+ path - path to directory to create
+ mode - mode for the directory to create
+ ignore_existing - don't print or return error if directory
+ already exist
*/
static bool create(const char *path,
- mode_t mode = u_rwx());
+ mode_t mode = u_rwx(),
+ bool ignore_existing = false);
/*
Remove directory recursively
- dir - path to directory that should be removed
+ path - path to directory that should be removed
only_contents - only remove the contents of the directory
*/
@@ -89,6 +94,11 @@ public:
*/
static bool remove(const char* path);
+ /*
+ Change working directory
+ */
+ static int chdir(const char* path);
+
};
#endif
=== modified file 'storage/ndb/include/portlib/NdbMem.h'
--- a/storage/ndb/include/portlib/NdbMem.h 2009-05-27 12:11:46 +0000
+++ b/storage/ndb/include/portlib/NdbMem.h 2010-08-18 08:19:43 +0000
@@ -76,31 +76,6 @@ int NdbMem_MemLockAll(int);
*/
int NdbMem_MemUnlockAll(void);
-#ifndef HAVE_POSIX_MEMALIGN
-#ifdef HAVE_MEMALIGN /* Solaris 10 has memalign but not posix_memalign */
-static inline int posix_memalign(void **memptr, size_t alignment, size_t size)
-{
- *memptr= memalign(alignment,size);
- if(!*memptr)
- return ENOMEM;
- return 0;
-}
-#else /* But Darwin 7.9.0 doesn't have posix_memalign OR memalign */
-static inline int posix_memalign(void **memptr, size_t alignment, size_t size)
-{
- (void)memptr;
- (void)alignment;
- (void)size;
- return ENOTSUP; /* POSIX says we can return EINVAL or ENOMEM...
- but we cheat here and do ENOTSUP so that code
- elsewhere can work out if it can fall back to
- plain malloc() or not as we cannot reasonably do aligned
- memory allocation and free without leaking memory
- */
-}
-#endif
-#endif
-
#ifdef __cplusplus
}
#endif
=== modified file 'storage/ndb/include/portlib/NdbThread.h'
--- a/storage/ndb/include/portlib/NdbThread.h 2010-02-04 15:18:17 +0000
+++ b/storage/ndb/include/portlib/NdbThread.h 2010-08-17 10:55:34 +0000
@@ -25,7 +25,6 @@
extern "C" {
#endif
-#define THREAD_CONTAINER_SIZE 128
typedef enum NDB_THREAD_PRIO_ENUM {
NDB_THREAD_PRIO_HIGHEST,
NDB_THREAD_PRIO_HIGH,
=== modified file 'storage/ndb/include/util/NdbAutoPtr.hpp'
--- a/storage/ndb/include/util/NdbAutoPtr.hpp 2009-05-26 18:53:34 +0000
+++ b/storage/ndb/include/util/NdbAutoPtr.hpp 2010-08-17 11:54:21 +0000
@@ -20,7 +20,6 @@
#define __NDB_AUTO_PTR_HPP
#include <ndb_global.h>
-#include <my_sys.h>
template<typename T>
class NdbAutoPtr {
@@ -49,13 +48,4 @@ public:
~NdbAutoObjArrayPtr() { if (m_obj) delete[] m_obj;}
};
-template<typename T>
-class My_auto_ptr {
- T * m_obj;
-public:
- My_auto_ptr(T * obj = 0){ m_obj = obj;}
- void reset(T * obj = 0) { if (m_obj) my_free(m_obj,MYF(0)); m_obj = obj; }
- ~My_auto_ptr() { if (m_obj) my_free(m_obj,MYF(0));}
-};
-
#endif
=== modified file 'storage/ndb/include/util/NdbTap.hpp'
--- a/storage/ndb/include/util/NdbTap.hpp 2010-09-22 13:28:20 +0000
+++ b/storage/ndb/include/util/NdbTap.hpp 2010-09-23 11:57:39 +0000
@@ -38,7 +38,17 @@ int main(int argc, const char** argv){
int name##_test()
/* tap.c needs my_print_stacktrace */
-#undef DONT_DEFINE_VOID // stacktrace.c turns off VOID redefinition if needed
+#ifdef DONT_DEFINE_VOID
+// stacktrace.c turns off VOID redefinition if needed
+#undef DONT_DEFINE_VOID
+#endif
+
+#ifdef HAVE_gcov
+// __gcov_flush need C linkage
+extern "C" void __gcov_flush(void);
+#endif
+
#include <../../../mysys/stacktrace.c>
+
#endif
=== modified file 'storage/ndb/include/util/azlib.h'
--- a/storage/ndb/include/util/azlib.h 2007-11-15 00:29:48 +0000
+++ b/storage/ndb/include/util/azlib.h 2010-08-17 12:17:24 +0000
@@ -35,9 +35,6 @@
#include <zlib.h>
-#include "../../../../mysys/mysys_priv.h"
-#include <my_dir.h>
-
#ifdef __cplusplus
extern "C" {
#endif
=== modified file 'storage/ndb/src/common/portlib/NdbDir.cpp'
--- a/storage/ndb/src/common/portlib/NdbDir.cpp 2010-08-26 06:45:37 +0000
+++ b/storage/ndb/src/common/portlib/NdbDir.cpp 2010-09-23 09:10:53 +0000
@@ -199,11 +199,15 @@ mode_t NdbDir::o_x(void) { return IF_WIN
bool
-NdbDir::create(const char *dir, mode_t mode)
+NdbDir::create(const char *dir, mode_t mode, bool ignore_existing)
{
#ifdef _WIN32
if (CreateDirectory(dir, NULL) == 0)
{
+ if (ignore_existing &&
+ GetLastError() == ERROR_ALREADY_EXISTS)
+ return true;
+
fprintf(stderr,
"Failed to create directory '%s', error: %d",
dir, GetLastError());
@@ -212,6 +216,9 @@ NdbDir::create(const char *dir, mode_t m
#else
if (mkdir(dir, mode) != 0)
{
+ if (ignore_existing && errno == EEXIST)
+ return true;
+
fprintf(stderr,
"Failed to create directory '%s', error: %d",
dir, errno);
@@ -347,6 +354,16 @@ loop:
return true;
}
+#ifdef _WIN32
+#include <direct.h> // chdir
+#endif
+
+int
+NdbDir::chdir(const char* path)
+{
+ return ::chdir(path);
+}
+
#ifdef TEST_NDBDIR
#include <NdbTap.hpp>
@@ -428,8 +445,8 @@ TAPTEST(DirIterator)
CHECK(NdbDir::remove_recursive(path));
CHECK(gone(path));
- // Remove non exisiting directory
- fprintf(stderr, "Checking that proper error is returned when "
+ // Remove non existing directory
+ fprintf(stderr, "Checking that proper error is returned when "
"opening non existing directory\n");
CHECK(!NdbDir::remove_recursive(path));
CHECK(gone(path));
@@ -439,7 +456,7 @@ TAPTEST(DirIterator)
CHECK(NdbDir::remove_recursive(path, true));
CHECK(!gone(path));
- // Remoe also the empty dir
+ // Remove also the empty dir
CHECK(NdbDir::remove_recursive(path));
CHECK(gone(path));
@@ -454,6 +471,31 @@ TAPTEST(DirIterator)
CHECK(NdbDir::remove_recursive(path));
CHECK(gone(path));
+ // Create already existing directory
+ CHECK(NdbDir::create(path, NdbDir::u_rwx()));
+ CHECK(!gone(path));
+ CHECK(NdbDir::create(path, NdbDir::u_rwx(), true /* ignore existing!! */));
+ CHECK(!gone(path));
+ CHECK(NdbDir::remove_recursive(path));
+ CHECK(gone(path));
+
+ printf("Testing NdbDir::chdir...\n");
+ // Try chdir to the non existing dir, should fail
+ CHECK(NdbDir::chdir(path) != 0);
+
+ // Build dir tree
+ build_tree(path);
+
+ // Try chdir to the now existing dir, should work
+ CHECK(NdbDir::chdir(path) == 0);
+
+ // Try chdir to the root of tmpdir, should work
+ CHECK(NdbDir::chdir(tempdir.path()) == 0);
+
+ // Remove the dir tree again to leave clean
+ CHECK(NdbDir::remove_recursive(path));
+ CHECK(gone(path));
+
return 1; // OK
}
#endif
=== modified file 'storage/ndb/src/common/util/azio.c'
--- a/storage/ndb/src/common/util/azio.c 2010-03-16 15:56:18 +0000
+++ b/storage/ndb/src/common/util/azio.c 2010-08-18 13:09:14 +0000
@@ -16,11 +16,7 @@
*
*/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <NdbMem.h>
+#include <ndb_global.h>
/**
* This is a casual hack to do static memory allocation
@@ -32,7 +28,9 @@
#include "../../../../zlib/inflate.h"
#include "../../../../zlib/deflate.h"
-#include "azlib.h"
+#include <util/azlib.h>
+
+#include <my_sys.h>
#ifdef HAVE_VALGRIND
#include <valgrind/memcheck.h>
@@ -109,6 +107,34 @@ void az_free(voidpf opaque, voidpf addre
VALGRIND_MAKE_MEM_NOACCESS(r->mem,r->size);
}
+#ifdef _WIN32
+/* Windows doesn't define ENOTSUP, define it same as Solaris */
+#define ENOTSUP 48
+#endif
+
+#ifndef HAVE_POSIX_MEMALIGN
+static inline int posix_memalign(void **memptr, size_t alignment, size_t size)
+{
+#ifdef HAVE_MEMALIGN
+ /* Solaris 10 has memalign but not posix_memalign */
+ *memptr = memalign(alignment,size);
+ if(!*memptr)
+ return ENOMEM;
+ return 0;
+#else
+ /* But Darwin 7.9.0 doesn't have posix_memalign OR memalign */
+ (void)memptr;
+ (void)alignment;
+ (void)size;
+ return ENOTSUP; /* POSIX says we can return EINVAL or ENOMEM...
+ but we cheat here and do ENOTSUP so that code
+ elsewhere can work out if it can fall back to
+ plain malloc() or not as we cannot reasonably do aligned
+ memory allocation and free without leaking memory
+ */
+#endif
+}
+#endif
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing. The mode parameter
=== modified file 'storage/ndb/src/cw/cpcd/main.cpp'
--- a/storage/ndb/src/cw/cpcd/main.cpp 2010-08-23 08:46:34 +0000
+++ b/storage/ndb/src/cw/cpcd/main.cpp 2010-09-23 07:31:51 +0000
@@ -140,10 +140,10 @@ int main(int argc, char** argv){
}
if(strlen(work_dir) > 0){
- int err;
logger.debug("Changing dir to '%s'", work_dir);
- if((err = my_setwd(work_dir, MYF(0))) != 0){
- logger.error("Cannot change directory to '%s', terminating!", work_dir);
+ if(NdbDir::chdir(work_dir) != 0){
+ logger.error("Cannot change directory to '%s', error: %d, terminating!",
+ work_dir, errno);
exit(1);
}
}
=== modified file 'storage/ndb/src/kernel/angel.cpp'
--- a/storage/ndb/src/kernel/angel.cpp 2010-09-22 13:28:20 +0000
+++ b/storage/ndb/src/kernel/angel.cpp 2010-09-23 07:31:51 +0000
@@ -24,6 +24,7 @@
#include <NdbAutoPtr.hpp>
#include <portlib/ndb_daemon.h>
#include <portlib/NdbSleep.h>
+#include <portlib/NdbDir.hpp>
#include <ConfigRetriever.hpp>
@@ -453,7 +454,12 @@ configure(const ndb_mgm_configuration* c
NdbConfig_SetPath(datadir);
- my_setwd(NdbConfig_get_path(0), MYF(0));
+ if (NdbDir::chdir(NdbConfig_get_path(NULL)) != 0)
+ {
+ g_eventLogger->warning("Cannot change directory to '%s', error: %d",
+ NdbConfig_get_path(NULL), errno);
+ // Ignore error
+ }
return true;
}
=== modified file 'storage/ndb/src/kernel/blocks/CMakeLists.txt'
--- a/storage/ndb/src/kernel/blocks/CMakeLists.txt 2010-02-18 10:45:20 +0000
+++ b/storage/ndb/src/kernel/blocks/CMakeLists.txt 2010-08-17 12:25:20 +0000
@@ -43,7 +43,7 @@ ADD_LIBRARY(ndbblocks STATIC
ndbfs/Win32AsyncFile.cpp ndbfs/AsyncFile.cpp
ndbfs/Ndbfs.cpp
ndbfs/VoidFs.cpp
- ndbfs/Filename.cpp ndbfs/CircularIndex.cpp
+ ndbfs/Filename.cpp
ndbcntr/NdbcntrInit.cpp ndbcntr/NdbcntrSysTable.cpp ndbcntr/NdbcntrMain.cpp
qmgr/QmgrInit.cpp qmgr/QmgrMain.cpp
trix/Trix.cpp
=== modified file 'storage/ndb/src/kernel/blocks/Makefile.am'
--- a/storage/ndb/src/kernel/blocks/Makefile.am 2010-08-06 08:19:19 +0000
+++ b/storage/ndb/src/kernel/blocks/Makefile.am 2010-09-23 09:36:19 +0000
@@ -46,7 +46,7 @@ libblocks_a_SOURCES = tsman.cpp lgman.cp
ndbfs/PosixAsyncFile.cpp ndbfs/AsyncFile.cpp \
ndbfs/Ndbfs.cpp \
ndbfs/VoidFs.cpp \
- ndbfs/Filename.cpp ndbfs/CircularIndex.cpp \
+ ndbfs/Filename.cpp \
ndbcntr/NdbcntrInit.cpp ndbcntr/NdbcntrSysTable.cpp ndbcntr/NdbcntrMain.cpp \
qmgr/QmgrInit.cpp qmgr/QmgrMain.cpp \
trix/Trix.cpp \
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2010-09-23 07:06:54 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2010-09-28 11:29:26 +0000
@@ -17985,8 +17985,18 @@ void Dblqh::readFileInInvalidate(Signal*
logPartPtr.p->logPartNo, logFilePtr.p->fileNo, stepNext);
}
+ if (stepNext == 0)
+ {
+ jam();
+ // Contact NDBFS. Real time break.
+ readSinglePage(signal, logPartPtr.p->invalidatePageNo);
+ lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
+ return;
+ }
+
if (stepNext == 1)
{
+ jam();
logPartPtr.p->invalidatePageNo++;
if (logPartPtr.p->invalidatePageNo == (clogFileSize * ZPAGES_IN_MBYTE))
{
@@ -21432,7 +21442,7 @@ void Dblqh::writeNextLog(Signal* signal)
logFilePtr.p->nextLogFile != logPartPtr.p->firstLogfile)
{
jam();
- srand(time(0));
+ srand((int)time(0));
Uint32 wait = 3 + (rand() % 5);
suspendFile(signal, logFilePtr, /* forever */ 0);
@@ -22421,7 +22431,7 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
return;
}
- for(Uint32 i = 0; i<4; i++)
+ for(Uint32 i = 0; i<clogPartFileSize; i++)
{
logPartPtr.i = i;
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2010-09-07 09:54:47 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2010-09-24 18:19:07 +0000
@@ -1669,7 +1669,7 @@ public:
* index node. TUX reads and writes the node directly via pointer.
*/
int tuxAllocNode(EmulatedJamBuffer*, Uint32 fragPtrI, Uint32& pageId, Uint32& pageOffset, Uint32*& node);
- void tuxFreeNode(Signal* signal, Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node);
+ void tuxFreeNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node);
void tuxGetNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32*& node);
/*
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp 2010-09-03 05:35:51 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp 2010-09-24 18:19:07 +0000
@@ -75,10 +75,8 @@ Dbtup::tuxAllocNode(EmulatedJamBuffer *
return 0;
}
-#if 0
void
-Dbtup::tuxFreeNode(Signal* signal,
- Uint32 fragPtrI,
+Dbtup::tuxFreeNode(Uint32 fragPtrI,
Uint32 pageId,
Uint32 pageOffset,
Uint32* node)
@@ -90,15 +88,19 @@ Dbtup::tuxFreeNode(Signal* signal,
TablerecPtr tablePtr;
tablePtr.i= fragPtr.p->fragTableId;
ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
+
+ Local_key key;
+ key.m_page_no = pageId;
+ key.m_page_idx = pageOffset;
PagePtr pagePtr;
- pagePtr.i= pageId;
- ptrCheckGuard(pagePtr, cnoOfPage, cpage);
+ Tuple_header* ptr = (Tuple_header*)get_ptr(&pagePtr, &key, tablePtr.p);
+
Uint32 attrDescIndex= tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
Uint32 attrDataOffset= AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr);
- ndbrequire(node == &pagePtr.p->pageWord[pageOffset] + attrDataOffset);
- freeTh(fragPtr.p, tablePtr.p, signal, pagePtr.p, pageOffset);
+ ndbrequire(node == (Uint32*)ptr + attrDataOffset);
+
+ free_fix_rec(fragPtr.p, tablePtr.p, &key, (Fix_page*)pagePtr.p);
}
-#endif
void
Dbtup::tuxGetNode(Uint32 fragPtrI,
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2010-08-20 11:10:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2010-09-24 18:19:07 +0000
@@ -492,7 +492,7 @@ private:
Uint16 m_numAttrs;
bool m_storeNullKey;
TreeHead m_tree;
- TupLoc m_freeLoc; // list of free index nodes
+ TupLoc m_freeLoc; // one free node for next op
DLList<ScanOp> m_scanList; // current scans on this fragment
Uint32 m_tupIndexFragPtrI;
Uint32 m_tupTableFragPtrI;
@@ -604,9 +604,11 @@ private:
* DbtuxNode.cpp
*/
int allocNode(TuxCtx&, NodeHandle& node);
+ void freeNode(NodeHandle& node);
void selectNode(NodeHandle& node, TupLoc loc);
void insertNode(NodeHandle& node);
void deleteNode(NodeHandle& node);
+ void freePreallocatedNode(Frag& frag);
void setNodePref(struct TuxCtx &, NodeHandle& node);
// node operations
void nodePushUp(TuxCtx&, NodeHandle& node, unsigned pos, const TreeEnt& ent, Uint32 scanList);
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp 2010-01-12 08:25:40 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp 2010-09-24 18:19:07 +0000
@@ -141,8 +141,6 @@ Dbtux::mt_buildIndexFragment(mt_BuildInd
{
break;
}
- // link to freelist
- node.setLink(0, frag.m_freeLoc);
frag.m_freeLoc = node.m_loc;
ndbrequire(frag.m_freeLoc != NullTupLoc);
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp 2009-12-14 10:58:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp 2010-09-24 11:06:19 +0000
@@ -146,8 +146,6 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
jam();
break;
}
- // link to freelist
- node.setLink(0, frag.m_freeLoc);
frag.m_freeLoc = node.m_loc;
ndbrequire(frag.m_freeLoc != NullTupLoc);
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp 2009-12-14 22:14:34 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp 2010-09-24 18:19:07 +0000
@@ -54,6 +54,24 @@ Dbtux::allocNode(TuxCtx& ctx, NodeHandle
}
/*
+ * Free index node in TUP
+ */
+void
+Dbtux::freeNode(NodeHandle& node)
+{
+ Frag& frag = node.m_frag;
+ Uint32 pageId = node.m_loc.getPageId();
+ Uint32 pageOffset = node.m_loc.getPageOffset();
+ Uint32* node32 = reinterpret_cast<Uint32*>(node.m_node);
+ c_tup->tuxFreeNode(frag.m_tupIndexFragPtrI,
+ pageId, pageOffset, node32);
+ jamEntry();
+ // invalidate the handle
+ node.m_loc = NullTupLoc;
+ node.m_node = 0;
+}
+
+/*
* Set handle to point to existing node.
*/
void
@@ -77,9 +95,9 @@ void
Dbtux::insertNode(NodeHandle& node)
{
Frag& frag = node.m_frag;
- // unlink from freelist
+ // use up pre-allocated node
selectNode(node, frag.m_freeLoc);
- frag.m_freeLoc = node.getLink(0);
+ frag.m_freeLoc = NullTupLoc;
new (node.m_node) TreeNode();
#ifdef VM_TRACE
TreeHead& tree = frag.m_tree;
@@ -90,19 +108,44 @@ Dbtux::insertNode(NodeHandle& node)
}
/*
- * Delete existing node. Simply put it on the freelist.
+ * Delete existing node. Make it the pre-allocated free node if there
+ * is none. Otherwise return it to fragment's free list.
*/
void
Dbtux::deleteNode(NodeHandle& node)
{
Frag& frag = node.m_frag;
ndbrequire(node.getOccup() == 0);
- // link to freelist
- node.setLink(0, frag.m_freeLoc);
- frag.m_freeLoc = node.m_loc;
- // invalidate the handle
- node.m_loc = NullTupLoc;
- node.m_node = 0;
+ if (frag.m_freeLoc == NullTupLoc)
+ {
+ jam();
+ frag.m_freeLoc = node.m_loc;
+ // invalidate the handle
+ node.m_loc = NullTupLoc;
+ node.m_node = 0;
+ }
+ else
+ {
+ jam();
+ freeNode(node);
+ }
+}
+
+/*
+ * Free the pre-allocated node, called when tree is empty. This avoids
+ * leaving any used pages in DataMemory.
+ */
+void
+Dbtux::freePreallocatedNode(Frag& frag)
+{
+ if (frag.m_freeLoc != NullTupLoc)
+ {
+ jam();
+ NodeHandle node(frag);
+ selectNode(node, frag.m_freeLoc);
+ freeNode(node);
+ frag.m_freeLoc = NullTupLoc;
+ }
}
/*
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp 2009-12-14 22:14:34 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp 2010-09-24 18:19:07 +0000
@@ -328,6 +328,8 @@ Dbtux::treeRemoveNode(Frag& frag, NodeHa
}
// tree is now empty
tree.m_root = NullTupLoc;
+ // free even the pre-allocated node
+ freePreallocatedNode(frag);
}
/*
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp 2010-09-20 13:09:18 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp 2010-09-23 09:36:19 +0000
@@ -14,19 +14,15 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
-#include <my_sys.h>
-#include <my_pthread.h>
#include "AsyncIoThread.hpp"
#include "AsyncFile.hpp"
#include <ErrorHandlingMacros.hpp>
#include <kernel_types.h>
-#include <ndbd_malloc.hpp>
#include <NdbThread.h>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsOpenReq.hpp>
#include <signaldata/FsReadWriteReq.hpp>
-#include <Configuration.hpp>
#include "Ndbfs.hpp"
#include <NdbSleep.h>
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp 2010-09-20 13:09:18 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp 2010-09-23 09:36:19 +0000
@@ -17,7 +17,6 @@
#define AsyncIoThread_H
#include <kernel_types.h>
-#include <Pool.hpp>
#include "MemoryChannel.hpp"
#include <signaldata/BuildIndxImpl.hpp>
=== removed file 'storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp 2009-05-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp 1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
-/*
- Copyright (C) 2003 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
-*/
-
-#include "CircularIndex.hpp"
-
-
-
=== removed file 'storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp 2009-05-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp 1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
-/*
- Copyright (C) 2003 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
-*/
-
-#ifndef CircularIndex_H
-#define CircularIndex_H
-
-//===========================================================================
-//
-// .DESCRIPTION
-// Building block for circular buffers. It increment as a normal index.
-// untill it it becomes the maximum size then it becomes zero.
-//
-// .TYPICAL USE:
-// to implement a circular buffer.
-//
-// .EXAMPLE:
-// See MemoryChannel.C
-//===========================================================================
-
-///////////////////////////////////////////////////////////////////////////////
-// CircularIndex( int start= 0,int size=256 );
-// Constuctor
-// Parameters:
-// start: where to start to index
-// size : range of the index, will be from 0 to size-1
-///////////////////////////////////////////////////////////////////////////////
-// operator int ();
-// returns the index
-///////////////////////////////////////////////////////////////////////////////
-// void operator ++ ();
-// increments the index with one, of size is reached it is set to zero
-///////////////////////////////////////////////////////////////////////////////
-// friend int full( const CircularIndex& write, const CircularIndex& read );
-// Taken the write index and the read index from a buffer it is calculated
-// if the buffer is full
-// Parameters:
-// write: index used a write index for the buffer
-// read : index used a read index for the buffer
-// return
-// 0 : not full
-// 1 : full
-///////////////////////////////////////////////////////////////////////////////
-// friend int empty( const CircularIndex& write, const CircularIndex& read );
-// Taken the write index and the read index from a buffer it is calculated
-// if the buffer is empty
-// Parameters:
-// write: index used a write index for the buffer
-// read : index used a read index for the buffer
-// return
-// 0 : not empty
-// 1 : empty
-///////////////////////////////////////////////////////////////////////////////
-
-class CircularIndex
-{
-public:
- inline CircularIndex( int start= 0,int size=256 );
- operator int () const;
- CircularIndex& operator ++ ();
- friend int full( const CircularIndex& write, const CircularIndex& read );
- friend int empty( const CircularIndex& write, const CircularIndex& read );
-private:
- int theSize;
- int theIndex;
-};
-
-inline CircularIndex::operator int () const
-{
- return theIndex;
-}
-
-inline CircularIndex& CircularIndex::operator ++ ()
-{
- ++theIndex;
- if( theIndex >= theSize ){
- theIndex= 0;
- }
- return *this;
-}
-
-
-inline int full( const CircularIndex& write, const CircularIndex& read )
-{
- int readTmp= read.theIndex;
-
- if( read.theIndex < write.theIndex )
- readTmp += read.theSize;
-
- return ( readTmp - write.theIndex) == 1;
-}
-
-inline int empty( const CircularIndex& write, const CircularIndex& read )
-{
- return read.theIndex == write.theIndex;
-}
-
-
-inline CircularIndex::CircularIndex( int start,int size ):
- theSize(size),
- theIndex(start)
-{
-}
-#endif
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp 2009-08-21 10:39:15 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp 2010-08-17 12:25:20 +0000
@@ -18,8 +18,6 @@
#include <ndb_global.h>
-#include <NdbOut.hpp>
-
#include "Filename.hpp"
#include "ErrorHandlingMacros.hpp"
#include "RefConvert.hpp"
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp 2009-11-30 11:53:55 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp 2010-08-17 12:25:20 +0000
@@ -67,8 +67,6 @@
// T : item from the channel or zero if channel is empty.
//
-#include "ErrorHandlingMacros.hpp"
-#include "CircularIndex.hpp"
#include "NdbMutex.h"
#include "NdbCondition.h"
#include <NdbOut.hpp>
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp 2010-09-20 13:09:18 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp 2010-09-23 09:36:19 +0000
@@ -27,8 +27,6 @@
#include "PosixAsyncFile.hpp"
#endif
-#include "Filename.hpp"
-
#include <signaldata/FsOpenReq.hpp>
#include <signaldata/FsCloseReq.hpp>
#include <signaldata/FsReadWriteReq.hpp>
@@ -42,7 +40,6 @@
#include <RefConvert.hpp>
#include <portlib/NdbDir.hpp>
-#include <NdbSleep.h>
#include <NdbOut.hpp>
#include <Configuration.hpp>
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp 2010-08-17 09:54:53 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp 2010-09-24 15:10:46 +0000
@@ -42,6 +42,8 @@
#include <sys/uio.h>
#include <dirent.h>
+#include <sys/stat.h>
+
PosixAsyncFile::PosixAsyncFile(SimulatedBlock& fs) :
AsyncFile(fs),
theFd(-1),
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp 2010-09-20 13:09:18 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp 2010-09-23 09:36:19 +0000
@@ -16,12 +16,9 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <limits.h>
-#include <errno.h>
-
#include "Ndbfs.hpp"
+
#include "AsyncFile.hpp"
-#include "Filename.hpp"
#include <signaldata/FsOpenReq.hpp>
#include <signaldata/FsCloseReq.hpp>
@@ -34,8 +31,6 @@
#include <signaldata/DumpStateOrd.hpp>
#include <RefConvert.hpp>
-#include <NdbSleep.h>
-#include <NdbOut.hpp>
#include <Configuration.hpp>
VoidFs::VoidFs(Block_context & ctx) :
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp 2010-03-10 07:43:06 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.cpp 2010-08-17 12:25:20 +0000
@@ -17,15 +17,9 @@
*/
#include <ndb_global.h>
-#include <my_sys.h>
-#include <my_pthread.h>
#include "Win32AsyncFile.hpp"
-#include <ErrorHandlingMacros.hpp>
-#include <kernel_types.h>
-#include <ndbd_malloc.hpp>
-#include <NdbThread.h>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsOpenReq.hpp>
#include <signaldata/FsReadWriteReq.hpp>
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.hpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Win32AsyncFile.hpp 2010-08-17 12:25:20 +0000
@@ -25,8 +25,6 @@
#include <kernel_types.h>
#include "AsyncFile.hpp"
-#include "MemoryChannel.hpp"
-#include "Filename.hpp"
class Win32AsyncFile : public AsyncFile
{
=== modified file 'storage/ndb/src/kernel/ndbd.cpp'
--- a/storage/ndb/src/kernel/ndbd.cpp 2010-09-22 09:19:56 +0000
+++ b/storage/ndb/src/kernel/ndbd.cpp 2010-09-23 09:22:40 +0000
@@ -18,6 +18,7 @@
#include <NdbEnv.h>
#include <NdbConfig.h>
#include <NdbSleep.h>
+#include <portlib/NdbDir.hpp>
#include <NdbAutoPtr.hpp>
#include "vm/SimBlockList.hpp"
@@ -591,7 +592,12 @@ ndbd_run(bool foreground, int report_fd,
theConfig->fetch_configuration(connect_str, force_nodeid, bind_address,
allocated_nodeid);
- my_setwd(NdbConfig_get_path(0), MYF(0));
+ if (NdbDir::chdir(NdbConfig_get_path(NULL)) != 0)
+ {
+ g_eventLogger->warning("Cannot change directory to '%s', error: %d",
+ NdbConfig_get_path(NULL), errno);
+ // Ignore error
+ }
if (get_multithreaded_config(globalEmulatorData))
ndbd_exit(-1);
=== modified file 'storage/ndb/src/mgmclient/CommandInterpreter.cpp'
--- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp 2010-08-16 13:51:31 +0000
+++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp 2010-08-17 11:56:12 +0000
@@ -84,7 +84,7 @@ private:
* @return: true if correct syntax, otherwise false
*/
bool parseBlockSpecification(const char* allAfterLog,
- Vector<const char*>& blocks);
+ Vector<BaseString>& blocks);
/**
* A bunch of execute functions: Executes one of the commands
@@ -1131,12 +1131,19 @@ CommandInterpreter::execute_impl(const c
m_error= 0;
if(_line == NULL) {
+ ndbout_c("ERROR: Internal error at %s:%d.", __FILE__, __LINE__);
m_error = -1;
- DBUG_RETURN(false);
+ DBUG_RETURN(false); // Terminate gracefully
}
- char* line = my_strdup(_line,MYF(MY_WME));
- My_auto_ptr<char> ptr(line);
+ char* line = strdup(_line);
+ if (line == NULL)
+ {
+ ndbout_c("ERROR: Memory allocation error at %s:%d.", __FILE__, __LINE__);
+ m_error = -1;
+ DBUG_RETURN(false); // Terminate gracefully
+ }
+ NdbAutoPtr<char> ap(line);
int do_continue;
do {
@@ -1157,6 +1164,7 @@ CommandInterpreter::execute_impl(const c
}
}
} while (do_continue);
+
// if there is anything in the line proceed
Vector<BaseString> command_list;
split_args(line, command_list);
@@ -1468,7 +1476,7 @@ CommandInterpreter::executeForAll(const
//*****************************************************************************
bool
CommandInterpreter::parseBlockSpecification(const char* allAfterLog,
- Vector<const char*>& blocks)
+ Vector<BaseString>& blocks)
{
// Parse: [BLOCK = {ALL|<blockName>+}]
@@ -1477,8 +1485,14 @@ CommandInterpreter::parseBlockSpecificat
}
// Copy allAfterLog since strtok will modify it
- char* newAllAfterLog = my_strdup(allAfterLog,MYF(MY_WME));
- My_auto_ptr<char> ap1(newAllAfterLog);
+ char* newAllAfterLog = strdup(allAfterLog);
+ if (newAllAfterLog == NULL)
+ {
+ ndbout_c("ERROR: Memory allocation error at %s:%d.", __FILE__, __LINE__);
+ return false; // Error parsing
+ }
+
+ NdbAutoPtr<char> ap1(newAllAfterLog);
char* firstTokenAfterLog = strtok(newAllAfterLog, " ");
for (unsigned int i = 0; i < strlen(firstTokenAfterLog); ++i) {
firstTokenAfterLog[i] = toupper(firstTokenAfterLog[i]);
@@ -1509,7 +1523,7 @@ CommandInterpreter::parseBlockSpecificat
all = true;
}
while (blockName != NULL) {
- blocks.push_back(strdup(blockName));
+ blocks.push_back(blockName);
blockName = strtok(NULL, " ");
}
@@ -1852,15 +1866,22 @@ CommandInterpreter::executeClusterLog(ch
int i;
if (emptyString(parameters))
{
- ndbout << "Missing argument." << endl;
+ ndbout_c("ERROR: Missing argument(s).");
m_error = -1;
DBUG_VOID_RETURN;
}
enum ndb_mgm_event_severity severity = NDB_MGM_EVENT_SEVERITY_ALL;
- char * tmpString = my_strdup(parameters,MYF(MY_WME));
- My_auto_ptr<char> ap1(tmpString);
+ char * tmpString = strdup(parameters);
+ if (tmpString == NULL)
+ {
+ ndbout_c("ERROR: Memory allocation error at %s:%d.", __FILE__, __LINE__);
+ m_error = -1;
+ DBUG_VOID_RETURN;
+ }
+
+ NdbAutoPtr<char> ap1(tmpString);
char * tmpPtr = 0;
char * item = strtok_r(tmpString, " ", &tmpPtr);
int enable;
@@ -2627,31 +2648,28 @@ CommandInterpreter::executeLogLevel(int
int CommandInterpreter::executeError(int processId,
const char* parameters, bool /* all */)
{
- int retval = 0;
- if (emptyString(parameters)) {
- ndbout << "Missing error number." << endl;
+ if (emptyString(parameters))
+ {
+ ndbout_c("ERROR: Missing error number.");
return -1;
}
- // Copy parameters since strtok will modify it
- char* newpar = my_strdup(parameters,MYF(MY_WME));
- My_auto_ptr<char> ap1(newpar);
- char* firstParameter = strtok(newpar, " ");
+ Vector<BaseString> args;
+ split_args(parameters, args);
- int errorNo;
- if (! convert(firstParameter, errorNo)) {
- ndbout << "Expected an integer." << endl;
+ if (args.size() >= 2)
+ {
+ ndbout << "ERROR: Too many arguments." << endl;
return -1;
}
- char* allAfterFirstParameter = strtok(NULL, "\0");
- if (! emptyString(allAfterFirstParameter)) {
- ndbout << "Nothing expected after error number." << endl;
+ int errorNo;
+ if (! convert(args[0].c_str(), errorNo)) {
+ ndbout << "ERROR: Expected an integer." << endl;
return -1;
}
- retval = ndb_mgm_insert_error(m_mgmsrv, processId, errorNo, NULL);
- return retval;
+ return ndb_mgm_insert_error(m_mgmsrv, processId, errorNo, NULL);
}
//*****************************************************************************
@@ -2662,28 +2680,19 @@ CommandInterpreter::executeLog(int proce
const char* parameters, bool all)
{
struct ndb_mgm_reply reply;
- Vector<const char *> blocks;
+ Vector<BaseString> blocks;
if (! parseBlockSpecification(parameters, blocks)) {
return -1;
}
- int len=1;
- Uint32 i;
- for(i=0; i<blocks.size(); i++) {
- len += strlen(blocks[i]) + 1;
- }
- char * blockNames = (char*)my_malloc(len,MYF(MY_WME));
- My_auto_ptr<char> ap1(blockNames);
-
- blockNames[0] = 0;
- for(i=0; i<blocks.size(); i++) {
- strcat(blockNames, blocks[i]);
- strcat(blockNames, "|");
- }
-
+
+ BaseString block_names;
+ for (unsigned i = 0; i<blocks.size(); i++)
+ block_names.appfmt("%s|", blocks[i].c_str());
+
int result = ndb_mgm_log_signals(m_mgmsrv,
processId,
NDB_MGM_SIGNAL_LOG_MODE_INOUT,
- blockNames,
+ block_names.c_str(),
&reply);
if (result != 0) {
ndbout_c("Execute LOG on node %d failed.", processId);
=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2010-08-30 09:51:49 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2010-09-23 07:31:51 +0000
@@ -45,6 +45,7 @@
#include <signaldata/DropNodegroup.hpp>
#include <signaldata/DbinfoScan.hpp>
#include <NdbSleep.h>
+#include <portlib/NdbDir.hpp>
#include <EventLogger.hpp>
#include <DebuggerNames.hpp>
#include <ndb_version.h>
@@ -594,8 +595,6 @@ MgmtSrvr::start()
void
MgmtSrvr::setClusterLog(const Config* config)
{
- g_eventLogger->close();
-
DBUG_ASSERT(_ownNodeId);
ConfigIter iter(config, CFG_SECTION_NODE);
@@ -605,7 +604,13 @@ MgmtSrvr::setClusterLog(const Config* co
const char *datadir;
require(iter.get(CFG_NODE_DATADIR, &datadir) == 0);
NdbConfig_SetPath(datadir);
- my_setwd(NdbConfig_get_path(0), MYF(0));
+
+ if (NdbDir::chdir(NdbConfig_get_path(NULL)) != 0)
+ {
+ g_eventLogger->warning("Cannot change directory to '%s', error: %d",
+ NdbConfig_get_path(NULL), errno);
+ // Ignore error
+ }
// Get log destination from config
BaseString logdest;
@@ -624,6 +629,8 @@ MgmtSrvr::setClusterLog(const Config* co
logdest_configured = false;
}
+ g_eventLogger->close();
+
int err= 0;
char errStr[100]= {0};
if(!g_eventLogger->addHandler(logdest, &err, sizeof(errStr), errStr)) {
=== modified file 'storage/ndb/src/mgmsrv/main.cpp'
--- a/storage/ndb/src/mgmsrv/main.cpp 2010-09-22 13:28:20 +0000
+++ b/storage/ndb/src/mgmsrv/main.cpp 2010-09-23 07:31:51 +0000
@@ -28,6 +28,7 @@
#include <portlib/ndb_daemon.h>
#include <NdbConfig.h>
#include <NdbSleep.h>
+#include <portlib/NdbDir.hpp>
#include <ndb_version.h>
#include <mgmapi_config_parameters.h>
#include <NdbAutoPtr.hpp>
@@ -267,7 +268,12 @@ static int mgmd_main(int argc, char** ar
mgmd_exit(1);
}
- my_setwd(NdbConfig_get_path(0), MYF(0));
+ if (NdbDir::chdir(NdbConfig_get_path(NULL)) != 0)
+ {
+ g_eventLogger->warning("Cannot change directory to '%s', error: %d",
+ NdbConfig_get_path(NULL), errno);
+ // Ignore error
+ }
if (opts.daemon)
{
=== modified file 'storage/ndb/test/ndbapi/testIndex.cpp'
--- a/storage/ndb/test/ndbapi/testIndex.cpp 2010-03-19 14:15:57 +0000
+++ b/storage/ndb/test/ndbapi/testIndex.cpp 2010-09-24 18:19:07 +0000
@@ -24,6 +24,9 @@
#include <NdbRestarts.hpp>
#include <Vector.hpp>
#include <signaldata/DumpStateOrd.hpp>
+#include <NodeBitmask.hpp>
+#include <NdbSqlUtil.hpp>
+#include <BlockNumbers.h>
#define CHECK(b) if (!(b)) { \
g_err << "ERR: "<< step->getName() \
@@ -2473,6 +2476,250 @@ runClearError(NDBT_Context* ctx, NDBT_St
return NDBT_OK;
}
+// bug#56829
+
+#undef CHECK2 // previous no good
+#define CHECK2(b, e) \
+ if (!(b)) { \
+ g_err << "ERR: " << #b << " failed at line " << __LINE__ \
+ << ": " << e << endl; \
+ result = NDBT_FAILED; \
+ break; \
+ }
+
+static int
+get_data_memory_pages(NdbMgmHandle h, NdbNodeBitmask dbmask, int* pages_out)
+{
+ int result = NDBT_OK;
+ int pages = 0;
+
+ while (1)
+ {
+ // sends dump 1000 and retrieves all replies
+ ndb_mgm_events* e = 0;
+ CHECK2((e = ndb_mgm_dump_events(h, NDB_LE_MemoryUsage, 0, 0)) != 0, ndb_mgm_get_latest_error_msg(h));
+
+ // sum up pages (also verify sanity)
+ for (int i = 0; i < e->no_of_events; i++)
+ {
+ ndb_logevent* le = &e->events[i];
+ CHECK2(le->type == NDB_LE_MemoryUsage, "bad event type " << le->type);
+ const ndb_logevent_MemoryUsage* lem = &le->MemoryUsage;
+ if (lem->block != DBTUP)
+ continue;
+ int nodeId = le->source_nodeid;
+ CHECK2(dbmask.get(nodeId), "duplicate event from node " << nodeId);
+ dbmask.clear(nodeId);
+ pages += lem->pages_used;
+ g_info << "i:" << i << " node:" << le->source_nodeid << " pages:" << lem->pages_used << endl;
+ }
+ free(e);
+ CHECK2(result == NDBT_OK, "failed");
+
+ char buf[NdbNodeBitmask::TextLength + 1];
+ CHECK2(dbmask.isclear(), "no response from nodes " << dbmask.getText(buf));
+ break;
+ }
+
+ *pages_out = pages;
+ return result;
+}
+
+int
+runBug56829(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Ndb* pNdb = GETNDB(step);
+ NdbDictionary::Dictionary* pDic = pNdb->getDictionary();
+ const int loops = ctx->getNumLoops();
+ int result = NDBT_OK;
+ const NdbDictionary::Table tab(*ctx->getTab());
+ const int rows = ctx->getNumRecords();
+ const char* mgm = 0;//XXX ctx->getRemoteMgm();
+
+ char tabname[100];
+ strcpy(tabname, tab.getName());
+ char indname[100];
+ strcpy(indname, tabname);
+ strcat(indname, "X1");
+
+ (void)pDic->dropTable(tabname);
+
+ NdbMgmHandle h = 0;
+ NdbNodeBitmask dbmask;
+ // entry n marks if row with PK n exists
+ char* rowmask = new char [rows];
+ memset(rowmask, 0, rows);
+ int loop = 0;
+ while (loop < loops)
+ {
+ CHECK2(rows > 0, "rows must be != 0");
+ g_info << "loop " << loop << "<" << loops << endl;
+
+ // at first loop connect to mgm
+ if (loop == 0)
+ {
+ CHECK2((h = ndb_mgm_create_handle()) != 0, "mgm: failed to create handle");
+ CHECK2(ndb_mgm_set_connectstring(h, mgm) == 0, ndb_mgm_get_latest_error_msg(h));
+ CHECK2(ndb_mgm_connect(h, 0, 0, 0) == 0, ndb_mgm_get_latest_error_msg(h));
+ g_info << "mgm: connected to " << (mgm ? mgm : "default") << endl;
+
+ // make bitmask of DB nodes
+ dbmask.clear();
+ ndb_mgm_cluster_state* cs = 0;
+ CHECK2((cs = ndb_mgm_get_status(h)) != 0, ndb_mgm_get_latest_error_msg(h));
+ for (int j = 0; j < cs->no_of_nodes; j++)
+ {
+ ndb_mgm_node_state* ns = &cs->node_states[j];
+ if (ns->node_type == NDB_MGM_NODE_TYPE_NDB)
+ {
+ CHECK2(ns->node_status == NDB_MGM_NODE_STATUS_STARTED, "node " << ns->node_id << " not started status " << ns->node_status);
+ CHECK2(!dbmask.get(ns->node_id), "duplicate node id " << ns->node_id);
+ dbmask.set(ns->node_id);
+ g_info << "added DB node " << ns->node_id << endl;
+ }
+ }
+ free(cs);
+ CHECK2(result == NDBT_OK, "some DB nodes are not started");
+ CHECK2(!dbmask.isclear(), "found no DB nodes");
+ }
+
+ // data memory pages after following events
+ // 0-initial 1,2-create table,index 3-load 4-delete 5,6-drop index,table
+ int pages[7];
+
+ // initial
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[0]) == NDBT_OK, "failed");
+ g_info << "initial pages " << pages[0] << endl;
+
+ // create table
+ g_info << "create table " << tabname << endl;
+ const NdbDictionary::Table* pTab = 0;
+ CHECK2(pDic->createTable(tab) == 0, pDic->getNdbError());
+ CHECK2((pTab = pDic->getTable(tabname)) != 0, pDic->getNdbError());
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[1]) == NDBT_OK, "failed");
+ g_info << "create table pages " << pages[1] << endl;
+
+ // choice of index attributes is not relevant to this bug
+ // choose one non-PK updateable column
+ NdbDictionary::Index ind;
+ ind.setName(indname);
+ ind.setTable(tabname);
+ ind.setType(NdbDictionary::Index::OrderedIndex);
+ ind.setLogging(false);
+ {
+ HugoCalculator calc(*pTab);
+ for (int j = 0; j < pTab->getNoOfColumns(); j++)
+ {
+ const NdbDictionary::Column* col = pTab->getColumn(j);
+ if (col->getPrimaryKey() || calc.isUpdateCol(j))
+ continue;
+ CHARSET_INFO* cs = col->getCharset();
+ if (NdbSqlUtil::check_column_for_ordered_index(col->getType(), col->getCharset()) == 0)
+ {
+ ind.addColumn(*col);
+ break;
+ }
+ }
+ }
+ CHECK2(ind.getNoOfColumns() == 1, "cannot use table " << tabname);
+
+ // create index
+ g_info << "create index " << indname << " on " << ind.getColumn(0)->getName() << endl;
+ const NdbDictionary::Index* pInd = 0;
+ CHECK2(pDic->createIndex(ind, *pTab) == 0, pDic->getNdbError());
+ CHECK2((pInd = pDic->getIndex(indname, tabname)) != 0, pDic->getNdbError());
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[2]) == NDBT_OK, "failed");
+ g_info << "create index pages " << pages[2] << endl;
+
+ HugoTransactions trans(*pTab);
+
+ // load all records
+ g_info << "load records" << endl;
+ CHECK2(trans.loadTable(pNdb, rows) == 0, trans.getNdbError());
+ memset(rowmask, 1, rows);
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[3]) == NDBT_OK, "failed");
+ g_info << "load records pages " << pages[3] << endl;
+
+ // test index with random ops
+ g_info << "test index ops" << endl;
+ {
+ HugoOperations ops(*pTab);
+ for (int i = 0; i < rows; i++)
+ {
+ CHECK2(ops.startTransaction(pNdb) == 0, ops.getNdbError());
+ for (int j = 0; j < 32; j++)
+ {
+ int n = rand() % rows;
+ if (!rowmask[n])
+ {
+ CHECK2(ops.pkInsertRecord(pNdb, n) == 0, ops.getNdbError());
+ rowmask[n] = 1;
+ }
+ else if (rand() % 2 == 0)
+ {
+ CHECK2(ops.pkDeleteRecord(pNdb, n) == 0, ops.getNdbError());
+ rowmask[n] = 0;
+ }
+ else
+ {
+ CHECK2(ops.pkUpdateRecord(pNdb, n) == 0, ops.getNdbError());
+ }
+ }
+ CHECK2(result == NDBT_OK, "index ops batch failed");
+ CHECK2(ops.execute_Commit(pNdb) == 0, ops.getNdbError());
+ ops.closeTransaction(pNdb);
+ }
+ CHECK2(result == NDBT_OK, "index ops failed");
+ }
+
+ // delete all records
+ g_info << "delete records" << endl;
+ CHECK2(trans.clearTable(pNdb) == 0, trans.getNdbError());
+ memset(rowmask, 0, rows);
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[4]) == NDBT_OK, "failed");
+ g_info << "delete records pages " << pages[4] << endl;
+
+ // drop index
+ g_info << "drop index" << endl;
+ CHECK2(pDic->dropIndex(indname, tabname) == 0, pDic->getNdbError());
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[5]) == NDBT_OK, "failed");
+ g_info << "drop index pages " << pages[5] << endl;
+
+ // drop table
+ g_info << "drop table" << endl;
+ CHECK2(pDic->dropTable(tabname) == 0, pDic->getNdbError());
+ CHECK2(get_data_memory_pages(h, dbmask, &pages[6]) == NDBT_OK, "failed");
+ g_info << "drop table pages " << pages[6] << endl;
+
+ // verify
+ CHECK2(pages[1] == pages[0], "pages after create table " << pages[1]
+ << " not == initial pages " << pages[0]);
+ CHECK2(pages[2] == pages[0], "pages after create index " << pages[2]
+ << " not == initial pages " << pages[0]);
+ CHECK2(pages[3] > pages[0], "pages after load " << pages[3]
+ << " not > initial pages " << pages[0]);
+ CHECK2(pages[4] == pages[0], "pages after delete " << pages[4]
+ << " not == initial pages " << pages[0]);
+ CHECK2(pages[5] == pages[0], "pages after drop index " << pages[5]
+ << " not == initial pages " << pages[0]);
+ CHECK2(pages[6] == pages[0], "pages after drop table " << pages[6]
+ << " not == initial pages " << pages[0]);
+
+ loop++;
+
+ // at last loop disconnect from mgm
+ if (loop == loops)
+ {
+ CHECK2(ndb_mgm_disconnect(h) == 0, ndb_mgm_get_latest_error_msg(h));
+ ndb_mgm_destroy_handle(&h);
+ g_info << "mgm: disconnected" << endl;
+ }
+ }
+ delete [] rowmask;
+
+ return result;
+}
+
NDBT_TESTSUITE(testIndex);
TESTCASE("CreateAll",
@@ -2874,6 +3121,11 @@ TESTCASE("FireTrigOverload", ""){
FINALIZER(runClearError);
FINALIZER(createRandomIndex_Drop);
}
+TESTCASE("Bug56829",
+ "Return empty ordered index nodes to index fragment "
+ "so that empty fragment pages can be freed"){
+ STEP(runBug56829);
+}
NDBT_TESTSUITE_END(testIndex);
=== modified file 'storage/ndb/test/ndbapi/testIndexStat.cpp'
--- a/storage/ndb/test/ndbapi/testIndexStat.cpp 2010-04-30 09:09:19 +0000
+++ b/storage/ndb/test/ndbapi/testIndexStat.cpp 2010-08-17 12:19:46 +0000
@@ -478,9 +478,9 @@ static void
freekeys()
{
if (g_keys != 0)
- my_free((char*)g_keys, MYF(0));
+ free(g_keys);
if (g_sortkeys != 0)
- my_free((char*)g_sortkeys, MYF(0));
+ free(g_sortkeys);
g_keys = 0;
g_sortkeys = 0;
}
@@ -490,8 +490,8 @@ allockeys()
{
freekeys();
size_t sz = sizeof(Key) * g_opts.rows;
- g_keys = (Key*)my_malloc(sz, MYF(0));
- g_sortkeys = (Key*)my_malloc(sz, MYF(0));
+ g_keys = (Key*)malloc(sz);
+ g_sortkeys = (Key*)malloc(sz);
chkrc(g_keys != 0 && g_sortkeys != 0);
memset(g_keys, 0x1f, sz);
memset(g_sortkeys, 0x1f, sz);
@@ -979,7 +979,7 @@ static void
freeranges()
{
if (g_ranges != 0)
- my_free((char*)g_ranges, MYF(0));
+ free(g_ranges);
g_ranges = 0;
}
@@ -988,7 +988,7 @@ allocranges()
{
freeranges();
size_t sz = sizeof(Range) * g_opts.ops;
- g_ranges = (Range*)my_malloc(sz, MYF(0));
+ g_ranges = (Range*)malloc(sz);
chkrc(g_ranges != 0);
memset(g_ranges, 0x1f, sz);
return 0;
=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt 2010-09-23 06:22:44 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2010-09-24 18:19:07 +0000
@@ -1593,3 +1593,7 @@ max-time: 500
cmd: testDict
args: -n Bug53944 T1
+max-time: 300
+cmd: testIndex
+args: -n Bug56829 T1
+
=== modified file 'storage/ndb/test/run-test/files.cpp'
--- a/storage/ndb/test/run-test/files.cpp 2010-08-23 08:46:34 +0000
+++ b/storage/ndb/test/run-test/files.cpp 2010-09-23 09:02:47 +0000
@@ -350,7 +350,8 @@ create_directory(const char * path)
cwd.append(list[i].c_str());
cwd.append("/");
NdbDir::create(cwd.c_str(),
- NdbDir::u_rwx() | NdbDir::g_r() | NdbDir::g_x());
+ NdbDir::u_rwx() | NdbDir::g_r() | NdbDir::g_x(),
+ true);
}
struct stat sbuf;
=== modified file 'storage/ndb/test/src/NdbBackup.cpp'
--- a/storage/ndb/test/src/NdbBackup.cpp 2010-06-14 12:16:32 +0000
+++ b/storage/ndb/test/src/NdbBackup.cpp 2010-09-23 08:24:52 +0000
@@ -64,7 +64,7 @@ NdbBackup::clearOldBackups()
* Clear old backup files
*/
BaseString tmp;
- tmp.assfmt("ssh -v %s rm -rfv %s/BACKUP", host, path);
+ tmp.assfmt("ssh -v %s rm -rf %s/BACKUP", host, path);
ndbout << "buf: "<< tmp.c_str() <<endl;
int res = system(tmp.c_str());
=== modified file 'storage/ndb/test/tools/CMakeLists.txt'
--- a/storage/ndb/test/tools/CMakeLists.txt 2009-11-13 04:50:47 +0000
+++ b/storage/ndb/test/tools/CMakeLists.txt 2010-08-17 12:27:44 +0000
@@ -32,7 +32,6 @@ ADD_DEPENDENCIES(hugoPkUpdate ndbNDBT)
ADD_EXECUTABLE(hugoScanRead hugoScanRead.cpp)
ADD_EXECUTABLE(hugoScanUpdate hugoScanUpdate.cpp)
ADD_EXECUTABLE(restart restart.cpp)
-#ADD_EXECUTABLE(transproxy transproxy.cpp)
ADD_EXECUTABLE(verify_index verify_index.cpp)
ADD_EXECUTABLE(copy_tab copy_tab.cpp)
ADD_EXECUTABLE(create_index create_index.cpp)
=== modified file 'storage/ndb/test/tools/Makefile.am'
--- a/storage/ndb/test/tools/Makefile.am 2010-08-06 08:19:19 +0000
+++ b/storage/ndb/test/tools/Makefile.am 2010-09-23 09:36:19 +0000
@@ -18,8 +18,6 @@ EXTRA_DIST = CMakeLists.txt
ndbtest_PROGRAMS = hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab create_index ndb_cpcc listen_event eventlog rep_latency ndb_connect
-# transproxy
-
hugoFill_SOURCES = hugoFill.cpp
hugoLoad_SOURCES = hugoLoad.cpp
hugoLockRecords_SOURCES = hugoLockRecords.cpp
@@ -30,7 +28,6 @@ hugoPkUpdate_SOURCES = hugoPkUpdate.cpp
hugoScanRead_SOURCES = hugoScanRead.cpp
hugoScanUpdate_SOURCES = hugoScanUpdate.cpp
restart_SOURCES = restart.cpp
-# transproxy_SOURCES = transproxy.cpp
verify_index_SOURCES = verify_index.cpp
copy_tab_SOURCES = copy_tab.cpp
create_index_SOURCES = create_index.cpp
=== removed file 'storage/ndb/test/tools/transproxy.cpp'
--- a/storage/ndb/test/tools/transproxy.cpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/test/tools/transproxy.cpp 1970-01-01 00:00:00 +0000
@@ -1,363 +0,0 @@
-/*
- Copyright (C) 2003 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
-*/
-
-#include <ndb_global.h>
-
-#include <NdbTCP.h>
-#include <NdbOut.hpp>
-#include <NdbThread.h>
-#include <NdbSleep.h>
-#include <Properties.hpp>
-#include <LocalConfig.hpp>
-#include <Config.hpp>
-#include <InitConfigFileParser.hpp>
-#include <IPCConfig.hpp>
-
-static void
-fatal(char const* fmt, ...)
-{
- va_list ap;
- char buf[200];
- va_start(ap, fmt);
- BaseString::vsnprintf(buf, sizeof(buf), fmt, ap);
- va_end(ap);
- ndbout << "FATAL: " << buf << endl;
- sleep(1);
- exit(1);
-}
-
-static void
-debug(char const* fmt, ...)
-{
- va_list ap;
- char buf[200];
- va_start(ap, fmt);
- BaseString::vsnprintf(buf, sizeof(buf), fmt, ap);
- va_end(ap);
- ndbout << buf << endl;
-}
-
-// node
-struct Node {
- enum Type { MGM = 1, DB = 2, API = 3 };
- Type type;
- unsigned id; // node id
- static Node* list;
- static unsigned count;
- static Node* find(unsigned n) {
- for (unsigned i = 0; i < count; i++) {
- if (list[i].id == n)
- return &list[i];
- }
- return 0;
- }
-};
-
-unsigned Node::count = 0;
-Node* Node::list = 0;
-
-struct Copy {
- int rfd; // read from
- int wfd; // write to
- unsigned char* buf;
- unsigned bufsiz;
- NdbThread* thread;
- void run();
- char info[20];
-};
-
-// connection between nodes 0-server side 1-client side
-// we are client to 0 and server to 1
-struct Conn {
- Node* node[2]; // the nodes
- unsigned port; // server port
- unsigned proxy; // proxy port
- static unsigned count;
- static unsigned proxycount;
- static Conn* list;
- NdbThread* thread; // thread handling this connection
- void run(); // run the connection
- int sockfd[2]; // socket 0-on server side 1-client side
- void conn0(); // connect to side 0
- void conn1(); // connect to side 0
- char info[20];
- Copy copy[2]; // 0-to-1 and 1-to-0
-};
-
-unsigned Conn::count = 0;
-unsigned Conn::proxycount = 0;
-Conn* Conn::list = 0;
-
-// global data
-static char* hostname = 0;
-static struct sockaddr_in hostaddr;
-static char* localcfgfile = 0;
-static char* initcfgfile = 0;
-static unsigned ownnodeid = 0;
-
-static void
-properr(const Properties* props, const char* name, int i = -1)
-{
- if (i < 0) {
- fatal("get %s failed: errno = %d", name, props->getPropertiesErrno());
- } else {
- fatal("get %s_%d failed: errno = %d", name, i, props->getPropertiesErrno());
- }
-}
-
-// read config and load it into our structs
-static void
-getcfg()
-{
- LocalConfig lcfg;
- if (! lcfg.read(localcfgfile)) {
- fatal("read %s failed", localcfgfile);
- }
- ownnodeid = lcfg._ownNodeId;
- debug("ownnodeid = %d", ownnodeid);
- InitConfigFileParser pars(initcfgfile);
- Config icfg;
- if (! pars.getConfig(icfg)) {
- fatal("parse %s failed", initcfgfile);
- }
- Properties* ccfg = icfg.getConfig(ownnodeid);
- if (ccfg == 0) {
- const char* err = "unknown error";
- fatal("getConfig: %s", err);
- }
- ccfg->put("NodeId", ownnodeid);
- ccfg->put("NodeType", "MGM");
- if (! ccfg->get("NoOfNodes", &Node::count)) {
- properr(ccfg, "NoOfNodes", -1);
- }
- debug("Node::count = %d", Node::count);
- Node::list = new Node[Node::count];
- for (unsigned i = 0; i < Node::count; i++) {
- Node& node = Node::list[i];
- const Properties* nodecfg;
- if (! ccfg->get("Node", 1+i, &nodecfg)) {
- properr(ccfg, "Node", 1+i);
- }
- const char* type;
- if (! nodecfg->get("Type", &type)) {
- properr(nodecfg, "Type");
- }
- if (strcmp(type, "MGM") == 0) {
- node.type = Node::MGM;
- } else if (strcmp(type, "DB") == 0) {
- node.type = Node::DB;
- } else if (strcmp(type, "API") == 0) {
- node.type = Node::API;
- } else {
- fatal("prop %s_%d bad Type = %s", "Node", 1+i, type);
- }
- if (! nodecfg->get("NodeId", &node.id)) {
- properr(nodecfg, "NodeId");
- }
- debug("node id=%d type=%d", node.id, node.type);
- }
- IPCConfig ipccfg(ccfg);
- if (ipccfg.init() != 0) {
- fatal("ipccfg init failed");
- }
- if (! ccfg->get("NoOfConnections", &Conn::count)) {
- properr(ccfg, "NoOfConnections");
- }
- debug("Conn::count = %d", Conn::count);
- Conn::list = new Conn[Conn::count];
- for (unsigned i = 0; i < Conn::count; i++) {
- Conn& conn = Conn::list[i];
- const Properties* conncfg;
- if (! ccfg->get("Connection", i, &conncfg)) {
- properr(ccfg, "Connection", i);
- }
- unsigned n;
- if (! conncfg->get("NodeId1", &n)) {
- properr(conncfg, "NodeId1");
- }
- if ((conn.node[0] = Node::find(n)) == 0) {
- fatal("node %d not found", n);
- }
- if (! conncfg->get("NodeId2", &n)) {
- properr(conncfg, "NodeId2");
- }
- if ((conn.node[1] = Node::find(n)) == 0) {
- fatal("node %d not found", n);
- }
- if (! conncfg->get("PortNumber", &conn.port)) {
- properr(conncfg, "PortNumber");
- }
- conn.proxy = 0;
- const char* proxy;
- if (conncfg->get("Proxy", &proxy)) {
- conn.proxy = atoi(proxy);
- if (conn.proxy > 0) {
- Conn::proxycount++;
- }
- }
- sprintf(conn.info, "conn %d-%d", conn.node[0]->id, conn.node[1]->id);
- }
-}
-
-void
-Conn::conn0()
-{
- int fd;
- while (1) {
- if ((fd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
- fatal("%s: create client socket failed: %s", info, strerror(socket_errno));
- }
- struct sockaddr_in servaddr;
- memset(&servaddr, 0, sizeof(servaddr));
- servaddr.sin_family = AF_INET;
- servaddr.sin_port = htons(port);
- servaddr.sin_addr = hostaddr.sin_addr;
-#if 0 // coredump
- if (Ndb_getInAddr(&servaddr.sin_addr, hostname) != 0) {
- fatal("%s: hostname %s lookup failed", info, hostname);
- }
-#endif
- if (connect(fd, (struct sockaddr*)&servaddr, sizeof(servaddr)) == 0)
- break;
- if (socket_errno != SOCKET_ECONNREFUSED) {
- fatal("%s: connect failed: %s", info, strerror(socket_errno));
- }
- close(fd);
- NdbSleep_MilliSleep(100);
- }
- sockfd[0] = fd;
- debug("%s: side 0 connected", info);
-}
-
-void
-Conn::conn1()
-{
- int servfd;
- if ((servfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
- fatal("%s: create server socket failed: %s", info, strerror(socket_errno));
- }
- struct sockaddr_in servaddr;
- memset(&servaddr, 0, sizeof(servaddr));
- servaddr.sin_family = AF_INET;
- servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
- servaddr.sin_port = htons(proxy);
- const int on = 1;
- setsockopt(servfd, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
- if (bind(servfd, (struct sockaddr*) &servaddr, sizeof(servaddr)) == -1) {
- fatal("%s: bind %d failed: %s", info, proxy, strerror(socket_errno));
- }
- if (listen(servfd, 1) == -1) {
- fatal("%s: listen %d failed: %s", info, proxy, strerror(socket_errno));
- }
- int fd;
- if ((fd = accept(servfd, 0, 0)) == -1) {
- fatal("%s: accept failed: %s", info, strerror(socket_errno));
- }
- sockfd[1] = fd;
- close(servfd);
- debug("%s: side 1 connected", info);
-}
-
-void
-Copy::run()
-{
- debug("%s: start", info);
- int n, m;
- while (1) {
- n = read(rfd, buf, sizeof(buf));
- if (n < 0)
- fatal("read error: %s", strerror(errno));
- m = write(wfd, buf, n);
- if (m != n)
- fatal("write error: %s", strerror(errno));
- }
- debug("%s: stop", info);
-}
-
-extern "C" void*
-copyrun_C(void* copy)
-{
- ((Copy*) copy)->run();
- return 0;
-}
-
-void
-Conn::run()
-{
- debug("%s: start", info);
- conn1();
- conn0();
- const unsigned siz = 32 * 1024;
- for (int i = 0; i < 2; i++) {
- Copy& copy = this->copy[i];
- copy.rfd = sockfd[i];
- copy.wfd = sockfd[1-i];
- copy.buf = new unsigned char[siz];
- copy.bufsiz = siz;
- sprintf(copy.info, "copy %d-%d", this->node[i]->id, this->node[1-i]->id);
- copy.thread = NdbThread_Create(copyrun_C, (void**)©,
- 8192, "copyrun", NDB_THREAD_PRIO_LOW);
- if (copy.thread == 0) {
- fatal("%s: create thread %d failed errno=%d", i, errno);
- }
- }
- debug("%s: stop", info);
-}
-
-extern "C" void*
-connrun_C(void* conn)
-{
- ((Conn*) conn)->run();
- return 0;
-}
-
-static void
-start()
-{
- NdbThread_SetConcurrencyLevel(3 * Conn::proxycount + 2);
- for (unsigned i = 0; i < Conn::count; i++) {
- Conn& conn = Conn::list[i];
- if (! conn.proxy)
- continue;
- conn.thread = NdbThread_Create(connrun_C, (void**)&conn,
- 8192, "connrun", NDB_THREAD_PRIO_LOW);
- if (conn.thread == 0) {
- fatal("create thread %d failed errno=%d", i, errno);
- }
- }
- sleep(3600);
-}
-
-int
-main(int av, char** ac)
-{
- ndb_init();
- debug("start");
- hostname = "ndb-srv7";
- if (Ndb_getInAddr(&hostaddr.sin_addr, hostname) != 0) {
- fatal("hostname %s lookup failed", hostname);
- }
- localcfgfile = "Ndb.cfg";
- initcfgfile = "config.txt";
- getcfg();
- start();
- debug("done");
- return 0;
-}
-
-// vim: set sw=4 noet:
=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp 2010-08-19 14:16:35 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp 2010-09-23 09:36:19 +0000
@@ -547,19 +547,19 @@ bool BackupRestore::translate_frm(NdbDic
{
DBUG_RETURN(TRUE);
}
- if ((new_data = (char*) my_malloc(data_len + extra_growth, MYF(0))))
+ if ((new_data = (char*) malloc(data_len + extra_growth)))
{
DBUG_RETURN(TRUE);
}
if (map_in_frm(new_data, (const char*)data, data_len, &new_data_len))
{
- my_free(new_data, MYF(0));
+ free(new_data);
DBUG_RETURN(TRUE);
}
if (packfrm((uchar*) new_data, new_data_len,
&new_pack_data, &new_pack_len))
{
- my_free(new_data, MYF(0));
+ free(new_data);
DBUG_RETURN(TRUE);
}
table->setFrm(new_pack_data, (Uint32)new_pack_len);
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100928112926-l3c2fgwzd0guzaw5.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0-llcp branch (jonas:3684 to 3685) | Jonas Oreland | 28 Sep |