diff options
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | ndb/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/config/type_ndbapitools.mk.am | 3 | ||||
-rw-r--r-- | ndb/src/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/src/common/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/src/common/portlib/Makefile.am | 20 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbCondition.c (renamed from ndb/src/common/portlib/unix/NdbCondition.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbDaemon.c (renamed from ndb/src/common/portlib/unix/NdbDaemon.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbEnv.c (renamed from ndb/src/common/portlib/unix/NdbEnv.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbHost.c (renamed from ndb/src/common/portlib/unix/NdbHost.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbMem.c (renamed from ndb/src/common/portlib/unix/NdbMem.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbMutex.c (renamed from ndb/src/common/portlib/unix/NdbMutex.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbPortLibTest.cpp (renamed from ndb/src/common/portlib/test/NdbPortLibTest.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbSleep.c (renamed from ndb/src/common/portlib/unix/NdbSleep.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbTCP.c (renamed from ndb/src/common/portlib/unix/NdbTCP.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbThread.c (renamed from ndb/src/common/portlib/unix/NdbThread.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbTick.c (renamed from ndb/src/common/portlib/unix/NdbTick.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/memtest.c (renamed from ndb/src/common/portlib/memtest/memtest.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/mmslist.cpp (renamed from ndb/src/common/portlib/mmstest/mmslist.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/mmstest.cpp (renamed from ndb/src/common/portlib/mmstest/mmstest.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/munmaptest.cpp (renamed from ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/memtest/Makefile (renamed from ndb/src/common/portlib/memtest/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile (renamed from ndb/src/common/portlib/memtest/munmaptest/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/Makefile (renamed from ndb/src/common/portlib/ose/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbCondition.c (renamed from ndb/src/common/portlib/ose/NdbCondition.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h (renamed from ndb/src/common/portlib/ose/NdbConditionOSE.h) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbEnv.c (renamed from ndb/src/common/portlib/ose/NdbEnv.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbHost.c (renamed from ndb/src/common/portlib/ose/NdbHost.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbMem.c (renamed from ndb/src/common/portlib/ose/NdbMem.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp (renamed from ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbMutex.c (renamed from ndb/src/common/portlib/ose/NdbMutex.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp (renamed from ndb/src/common/portlib/ose/NdbOut.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbSleep.c (renamed from ndb/src/common/portlib/ose/NdbSleep.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbTCP.c (renamed from ndb/src/common/portlib/ose/NdbTCP.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbThread.c (renamed from ndb/src/common/portlib/ose/NdbThread.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbTick.c (renamed from ndb/src/common/portlib/ose/NdbTick.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/test/Makefile (renamed from ndb/src/common/portlib/test/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/unix/Makefile_old (renamed from ndb/src/common/portlib/unix/Makefile_old) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/Makefile (renamed from ndb/src/common/portlib/win32/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbCondition.c (renamed from ndb/src/common/portlib/win32/NdbCondition.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c (renamed from ndb/src/common/portlib/win32/NdbDaemon.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbEnv.c (renamed from ndb/src/common/portlib/win32/NdbEnv.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbHost.c (renamed from ndb/src/common/portlib/win32/NdbHost.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbMem.c (renamed from ndb/src/common/portlib/win32/NdbMem.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbMutex.c (renamed from ndb/src/common/portlib/win32/NdbMutex.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbSleep.c (renamed from ndb/src/common/portlib/win32/NdbSleep.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbTCP.c (renamed from ndb/src/common/portlib/win32/NdbTCP.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbThread.c (renamed from ndb/src/common/portlib/win32/NdbThread.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbTick.c (renamed from ndb/src/common/portlib/win32/NdbTick.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/unix/Makefile.am | 13 | ||||
-rw-r--r-- | ndb/src/kernel/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/test/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/tools/Makefile.am | 18 | ||||
-rw-r--r-- | ndb/tools/delete_all.cpp | 118 | ||||
-rw-r--r-- | ndb/tools/select_count.cpp | 115 | ||||
-rw-r--r-- | ndb/tools/waiter.cpp | 218 |
56 files changed, 465 insertions, 56 deletions
diff --git a/configure.in b/configure.in index 8ffab66d80a..a1d22625578 100644 --- a/configure.in +++ b/configure.in @@ -2897,7 +2897,7 @@ AC_SUBST([ndb_transporter_opt_objs]) ndb_bin_am_ldflags="-static" if test X"$have_ndb_test" = Xyes then - ndb_opt_test_subdirs="tools ndbapi run-test" + ndb_opt_test_subdirs="test" ndb_bin_am_ldflags="" fi AC_SUBST([ndb_bin_am_ldflags]) @@ -2911,7 +2911,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl ndb/src/Makefile ndb/src/common/Makefile dnl ndb/tools/Makefile dnl ndb/src/common/debugger/Makefile ndb/src/common/debugger/signaldata/Makefile dnl - ndb/src/common/portlib/Makefile ndb/src/common/portlib/unix/Makefile dnl + ndb/src/common/portlib/Makefile dnl ndb/src/common/util/Makefile dnl ndb/src/common/logger/Makefile dnl ndb/src/common/transporter/Makefile dnl diff --git a/ndb/Makefile.am b/ndb/Makefile.am index 4ccd4349ab1..ed934539b79 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -1,4 +1,5 @@ -SUBDIRS = src test tools . include +SUBDIRS = src tools . include $(ndb_opt_test_subdirs) +DIST_SUBDIRS = src tools ndbapi include test include $(top_srcdir)/ndb/config/common.mk.am diff --git a/ndb/config/type_ndbapitools.mk.am b/ndb/config/type_ndbapitools.mk.am index 1156a3174c4..19fa27895e3 100644 --- a/ndb/config/type_ndbapitools.mk.am +++ b/ndb/config/type_ndbapitools.mk.am @@ -1,6 +1,5 @@ -LDADD += $(top_srcdir)/ndb/test/src/libNDBT.a \ - $(top_srcdir)/ndb/src/libndbclient.la +LDADD += $(top_srcdir)/ndb/src/libndbclient.la INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index 69eb4f53d7f..ced6bd23d6d 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -14,5 +14,5 @@ libndbclient_la_LIBADD = \ $(top_srcdir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \ $(top_srcdir)/ndb/src/mgmapi/libmgmapi.la \ $(top_srcdir)/ndb/src/common/logger/liblogger.la \ - $(top_srcdir)/ndb/src/common/portlib/unix/libportlib.la \ + $(top_srcdir)/ndb/src/common/portlib/libportlib.la \ $(top_srcdir)/ndb/src/common/util/libgeneral.la diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 9ccf6f4350c..7fcf2cab636 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -8,6 +8,6 @@ libcommon_la_LIBADD = \ debugger/libtrace.la \ debugger/signaldata/libsignaldataprint.la \ mgmcommon/libmgmsrvcommon.la \ - portlib/unix/libportlib.la \ + portlib/libportlib.la \ logger/liblogger.la \ util/libgeneral.la diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index 485195fd037..0cc5026544e 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -1,3 +1,19 @@ -SUBDIRS = unix +noinst_HEADERS = gcc.cpp -noinst_DATA = gcc.cpp +noinst_LTLIBRARIES = libportlib.la + +libportlib_la_SOURCES = \ + NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \ + NdbEnv.c NdbThread.c NdbHost.c NdbTCP.c \ + NdbDaemon.c NdbMem.c + +include $(top_srcdir)/ndb/config/common.mk.am +include $(top_srcdir)/ndb/config/type_util.mk.am + +EXTRA_PROGRAMS = memtest PortLibTest munmaptest + +PortLibTest_SOURCES = NdbPortLibTest.cpp +munmaptest_SOURCES = munmaptest.cpp + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/NdbCondition.c index 1d229bdcdef..1d229bdcdef 100644 --- a/ndb/src/common/portlib/unix/NdbCondition.c +++ b/ndb/src/common/portlib/NdbCondition.c diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c index d8d33595156..d8d33595156 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/NdbDaemon.c diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/NdbEnv.c index d294e0b52ca..d294e0b52ca 100644 --- a/ndb/src/common/portlib/unix/NdbEnv.c +++ b/ndb/src/common/portlib/NdbEnv.c diff --git a/ndb/src/common/portlib/unix/NdbHost.c b/ndb/src/common/portlib/NdbHost.c index 4749bb39ea7..4749bb39ea7 100644 --- a/ndb/src/common/portlib/unix/NdbHost.c +++ b/ndb/src/common/portlib/NdbHost.c diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/NdbMem.c index 0b06e5b23f1..0b06e5b23f1 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/NdbMem.c diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/NdbMutex.c index 50f314d2683..50f314d2683 100644 --- a/ndb/src/common/portlib/unix/NdbMutex.c +++ b/ndb/src/common/portlib/NdbMutex.c diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp index 55b9ccec5f2..55b9ccec5f2 100644 --- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/NdbPortLibTest.cpp diff --git a/ndb/src/common/portlib/unix/NdbSleep.c b/ndb/src/common/portlib/NdbSleep.c index 8702a25d1b1..8702a25d1b1 100644 --- a/ndb/src/common/portlib/unix/NdbSleep.c +++ b/ndb/src/common/portlib/NdbSleep.c diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/NdbTCP.c index 287dc6c2ecd..287dc6c2ecd 100644 --- a/ndb/src/common/portlib/unix/NdbTCP.c +++ b/ndb/src/common/portlib/NdbTCP.c diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index b023e851d29..b023e851d29 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/NdbTick.c index d8f0b6ec27a..d8f0b6ec27a 100644 --- a/ndb/src/common/portlib/unix/NdbTick.c +++ b/ndb/src/common/portlib/NdbTick.c diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest.c index 059a4ec025e..059a4ec025e 100644 --- a/ndb/src/common/portlib/memtest/memtest.c +++ b/ndb/src/common/portlib/memtest.c diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmslist.cpp index 05538785293..05538785293 100644 --- a/ndb/src/common/portlib/mmstest/mmslist.cpp +++ b/ndb/src/common/portlib/mmslist.cpp diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest.cpp index 9cc7d810985..9cc7d810985 100644 --- a/ndb/src/common/portlib/mmstest/mmstest.cpp +++ b/ndb/src/common/portlib/mmstest.cpp diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/munmaptest.cpp index b1d84131810..b1d84131810 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp +++ b/ndb/src/common/portlib/munmaptest.cpp diff --git a/ndb/src/common/portlib/memtest/Makefile b/ndb/src/common/portlib/old_dirs/memtest/Makefile index 716cdbdea82..716cdbdea82 100644 --- a/ndb/src/common/portlib/memtest/Makefile +++ b/ndb/src/common/portlib/old_dirs/memtest/Makefile diff --git a/ndb/src/common/portlib/memtest/munmaptest/Makefile b/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile index ea8c5238d1c..ea8c5238d1c 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/Makefile +++ b/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile diff --git a/ndb/src/common/portlib/ose/Makefile b/ndb/src/common/portlib/old_dirs/ose/Makefile index 4ef93b7824a..4ef93b7824a 100644 --- a/ndb/src/common/portlib/ose/Makefile +++ b/ndb/src/common/portlib/old_dirs/ose/Makefile diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c index 73a2dbc5d66..73a2dbc5d66 100644 --- a/ndb/src/common/portlib/ose/NdbCondition.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c diff --git a/ndb/src/common/portlib/ose/NdbConditionOSE.h b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h index bd0306261cc..bd0306261cc 100644 --- a/ndb/src/common/portlib/ose/NdbConditionOSE.h +++ b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h diff --git a/ndb/src/common/portlib/ose/NdbEnv.c b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c index e2ac4d879d2..e2ac4d879d2 100644 --- a/ndb/src/common/portlib/ose/NdbEnv.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c diff --git a/ndb/src/common/portlib/ose/NdbHost.c b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c index f5e1e511c16..f5e1e511c16 100644 --- a/ndb/src/common/portlib/ose/NdbHost.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c index 0e38024bbb4..0e38024bbb4 100644 --- a/ndb/src/common/portlib/ose/NdbMem.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c diff --git a/ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp index cad22c0474b..cad22c0474b 100644 --- a/ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c index 253c0e412ff..253c0e412ff 100644 --- a/ndb/src/common/portlib/ose/NdbMutex.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp index eb81bc9d971..eb81bc9d971 100644 --- a/ndb/src/common/portlib/ose/NdbOut.cpp +++ b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp diff --git a/ndb/src/common/portlib/ose/NdbSleep.c b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c index 70fd83117ef..70fd83117ef 100644 --- a/ndb/src/common/portlib/ose/NdbSleep.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c diff --git a/ndb/src/common/portlib/ose/NdbTCP.c b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c index 9994697b3f8..9994697b3f8 100644 --- a/ndb/src/common/portlib/ose/NdbTCP.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c index e46903a5cce..e46903a5cce 100644 --- a/ndb/src/common/portlib/ose/NdbThread.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c diff --git a/ndb/src/common/portlib/ose/NdbTick.c b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c index c3deae2bec3..c3deae2bec3 100644 --- a/ndb/src/common/portlib/ose/NdbTick.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c diff --git a/ndb/src/common/portlib/test/Makefile b/ndb/src/common/portlib/old_dirs/test/Makefile index 4edc98ede75..4edc98ede75 100644 --- a/ndb/src/common/portlib/test/Makefile +++ b/ndb/src/common/portlib/old_dirs/test/Makefile diff --git a/ndb/src/common/portlib/unix/Makefile_old b/ndb/src/common/portlib/old_dirs/unix/Makefile_old index 452196d9f08..452196d9f08 100644 --- a/ndb/src/common/portlib/unix/Makefile_old +++ b/ndb/src/common/portlib/old_dirs/unix/Makefile_old diff --git a/ndb/src/common/portlib/win32/Makefile b/ndb/src/common/portlib/old_dirs/win32/Makefile index bb29ac5547e..bb29ac5547e 100644 --- a/ndb/src/common/portlib/win32/Makefile +++ b/ndb/src/common/portlib/old_dirs/win32/Makefile diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c index 77869b673de..77869b673de 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c index 972fb1b88d8..972fb1b88d8 100644 --- a/ndb/src/common/portlib/win32/NdbDaemon.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c index 0df703a5e97..0df703a5e97 100644 --- a/ndb/src/common/portlib/win32/NdbEnv.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c index f91dd1a531c..f91dd1a531c 100644 --- a/ndb/src/common/portlib/win32/NdbHost.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c index ab7123b0a29..ab7123b0a29 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c index e797024d5bb..e797024d5bb 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c index ac0f44dd07f..ac0f44dd07f 100644 --- a/ndb/src/common/portlib/win32/NdbSleep.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c index 483a53bd606..483a53bd606 100644 --- a/ndb/src/common/portlib/win32/NdbTCP.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c index 1f052f034e8..1f052f034e8 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c index e3a67d8437d..e3a67d8437d 100644 --- a/ndb/src/common/portlib/win32/NdbTick.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c diff --git a/ndb/src/common/portlib/unix/Makefile.am b/ndb/src/common/portlib/unix/Makefile.am deleted file mode 100644 index f50d46c1873..00000000000 --- a/ndb/src/common/portlib/unix/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -noinst_LTLIBRARIES = libportlib.la - -libportlib_la_SOURCES = \ - NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \ - NdbEnv.c NdbThread.c NdbHost.c NdbTCP.c \ - NdbDaemon.c NdbMem.c - -include $(top_srcdir)/ndb/config/common.mk.am -include $(top_srcdir)/ndb/config/type_util.mk.am - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 7f2f33bd8e5..485c47652c2 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -51,7 +51,7 @@ LDADD += \ $(top_srcdir)/ndb/src/common/logger/liblogger.la \ $(top_srcdir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \ $(top_srcdir)/ndb/src/mgmapi/libmgmapi.la \ - $(top_srcdir)/ndb/src/common/portlib/unix/libportlib.la \ + $(top_srcdir)/ndb/src/common/portlib/libportlib.la \ $(top_srcdir)/ndb/src/common/util/libgeneral.la # Don't update the files from bitkeeper diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am index c535344ac54..2e0f30df9d4 100644 --- a/ndb/test/Makefile.am +++ b/ndb/test/Makefile.am @@ -1,5 +1,4 @@ -SUBDIRS = src $(ndb_opt_test_subdirs) -DIST_SUBDIRS = src tools ndbapi run-test +SUBDIRS = src tools ndbapi run-test EXTRA_DIST = include diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 3ca1cf1b1da..5b131bdf94a 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -9,14 +9,16 @@ ndbtools_PROGRAMS = \ ndb_select_all \ ndb_select_count -ndb_waiter_SOURCES = waiter.cpp -ndb_delete_all_SOURCES = delete_all.cpp -ndb_desc_SOURCES = desc.cpp -ndb_drop_index_SOURCES = drop_index.cpp -ndb_drop_table_SOURCES = drop_tab.cpp -ndb_show_tables_SOURCES = listTables.cpp -ndb_select_all_SOURCES = select_all.cpp -ndb_select_count_SOURCES = select_count.cpp +tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp ../test/src/NDBT_Table.cpp ../test/src/NDBT_Output.cpp + +ndb_waiter_SOURCES = waiter.cpp $(tools_common_sources) +ndb_delete_all_SOURCES = delete_all.cpp $(tools_common_sources) +ndb_desc_SOURCES = desc.cpp $(tools_common_sources) +ndb_drop_index_SOURCES = drop_index.cpp $(tools_common_sources) +ndb_drop_table_SOURCES = drop_tab.cpp $(tools_common_sources) +ndb_show_tables_SOURCES = listTables.cpp $(tools_common_sources) +ndb_select_all_SOURCES = select_all.cpp ../test/src/NDBT_ResultRow.cpp $(tools_common_sources) +ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index 9cbba503e68..dabd9a0e8fa 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -23,19 +23,16 @@ #include <getarg.h> -#include <UtilTransactions.hpp> +static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); int main(int argc, const char** argv){ const char* _tabname = NULL; const char* _dbname = "TEST_DB"; int _help = 0; - int _ver2 = 1; struct getargs args[] = { { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "ver2", '2', arg_flag, &_ver2, "Use version 2 of clearTable (default)", "" }, - { "ver2", '1', arg_negative_flag, &_ver2, "Use version 1 of clearTable", "" }, { "database", 'd', arg_string, &_dbname, "dbname", "Name of database table is in"} }; @@ -74,20 +71,111 @@ int main(int argc, const char** argv){ } ndbout << "Deleting all from " << argv[i] << "..."; - UtilTransactions utilTrans(*pTab); - int tmp = NDBT_OK; - if (_ver2 == 0){ - if(utilTrans.clearTable(&MyNdb) == NDBT_FAILED) - tmp = NDBT_FAILED; - } else { - if(utilTrans.clearTable3(&MyNdb) == NDBT_FAILED) - tmp = NDBT_FAILED; - } - if(tmp == NDBT_FAILED){ - res = tmp; + if(clear_table(&MyNdb, pTab) == NDBT_FAILED){ + res = NDBT_FAILED; ndbout << "FAILED" << endl; } } return NDBT_ProgramExit(res); } + +int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism) +{ + // Scan all records exclusive and delete + // them one by one + int retryAttempt = 0; + const int retryMax = 10; + int deletedRows = 0; + int check; + NdbConnection *pTrans; + NdbScanOperation *pOp; + NdbError err; + + int par = parallelism; + while (true){ + restart: + if (retryAttempt++ >= retryMax){ + g_info << "ERROR: has retried this operation " << retryAttempt + << " times, failing!" << endl; + return NDBT_FAILED; + } + + pTrans = pNdb->startTransaction(); + if (pTrans == NULL) { + err = pNdb->getNdbError(); + if (err.status == NdbError::TemporaryError){ + ERR(err); + NdbSleep_MilliSleep(50); + continue; + } + goto failed; + } + + pOp = pTrans->getNdbScanOperation(pTab->getName()); + if (pOp == NULL) { + goto failed; + } + + NdbResultSet * rs = pOp->readTuplesExclusive(par); + if( rs == 0 ) { + goto failed; + } + + if(pTrans->execute(NoCommit) != 0){ + err = pTrans->getNdbError(); + if(err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + continue; + } + goto failed; + } + + while((check = rs->nextResult(true)) == 0){ + do { + if (rs->deleteTuple() != 0){ + goto failed; + } + deletedRows++; + } while((check = rs->nextResult(false)) == 0); + + if(check != -1){ + check = pTrans->execute(Commit); + pTrans->releaseCompletedOperations(); + } + + err = pTrans->getNdbError(); + if(check == -1){ + if(err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + par = 1; + goto restart; + } + goto failed; + } + } + if(check == -1){ + err = pTrans->getNdbError(); + if(err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + par = 1; + goto restart; + } + goto failed; + } + pNdb->closeTransaction(pTrans); + return NDBT_OK; + } + return NDBT_FAILED; + + failed: + if(pTrans != 0) pNdb->closeTransaction(pTrans); + ERR(err); + return (err.code != 0 ? err.code : NDBT_FAILED); +} diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index b1513ad4135..cae91feb378 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -26,6 +26,12 @@ #include <getarg.h> #include <UtilTransactions.hpp> +static int +select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, + int parallelism, + int* count_rows, + UtilTransactions::ScanLock lock, + NdbConnection* pBuddyTrans=0); int main(int argc, const char** argv){ const char* _dbname = "TEST_DB"; @@ -75,9 +81,8 @@ int main(int argc, const char** argv){ } int rows = 0; - UtilTransactions utilTrans(*pTab); - if (utilTrans.selectCount(&MyNdb, _parallelism, &rows, - (UtilTransactions::ScanLock)_lock) != 0){ + if (select_count(&MyNdb, pTab, _parallelism, &rows, + (UtilTransactions::ScanLock)_lock) != 0){ return NDBT_ProgramExit(NDBT_FAILED); } @@ -86,5 +91,109 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_OK); } +int +select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, + int parallelism, + int* count_rows, + UtilTransactions::ScanLock lock, + NdbConnection* pBuddyTrans){ + + int retryAttempt = 0; + const int retryMax = 100; + int check; + NdbConnection *pTrans; + NdbOperation *pOp; + + while (true){ + + if (retryAttempt >= retryMax){ + g_info << "ERROR: has retried this operation " << retryAttempt + << " times, failing!" << endl; + return NDBT_FAILED; + } + + pTrans = pNdb->hupp(pBuddyTrans); + if (pTrans == NULL) { + const NdbError err = pNdb->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + return NDBT_FAILED; + } + pOp = pTrans->getNdbOperation(pTab->getName()); + if (pOp == NULL) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + switch(lock){ + case UtilTransactions::SL_ReadHold: + check = pOp->openScanReadHoldLock(parallelism); + break; + case UtilTransactions::SL_Exclusive: + check = pOp->openScanExclusive(parallelism); + break; + case UtilTransactions::SL_Read: + default: + check = pOp->openScanRead(parallelism); + } + + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + check = pOp->interpret_exit_ok(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + check = pTrans->executeScan(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + int eof; + int rows = 0; + eof = pTrans->nextScanResult(); + + while(eof == 0){ + rows++; + eof = pTrans->nextScanResult(); + } + if (eof == -1) { + const NdbError err = pTrans->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + pNdb->closeTransaction(pTrans); + + if (count_rows != NULL){ + *count_rows = rows; + } + + return NDBT_OK; + } + return NDBT_FAILED; +} diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index d57daff3aea..549e0dc1ec3 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -15,17 +15,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mgmapi.h" +#include <mgmapi.h> #include <string.h> #include <NdbMain.h> #include <NdbOut.hpp> #include <NdbSleep.h> #include <getarg.h> +#include <kernel/ndb_limits.h> - -#include <NdbRestarter.hpp> #include <NDBT.hpp> +int +waitClusterStarted(const char* _addr, unsigned int _timeout= 120); + int main(int argc, const char** argv){ const char* _hostName = NULL; @@ -47,10 +49,216 @@ int main(int argc, const char** argv){ } _hostName = argv[optind]; - NdbRestarter restarter(_hostName); + // NdbRestarter restarter(_hostName); - if (restarter.waitClusterStarted() != 0) + if (waitClusterStarted(_hostName) != 0) return NDBT_ProgramExit(NDBT_FAILED); return NDBT_ProgramExit(NDBT_OK); } + +#define MGMERR(h) \ + ndbout << "latest_error="<<ndb_mgm_get_latest_error(h) \ + << ", line="<<ndb_mgm_get_latest_error_line(h) \ + << endl; + +NdbMgmHandle handle= NULL; + +Vector<ndb_mgm_node_state> ndbNodes; +Vector<ndb_mgm_node_state> mgmNodes; +Vector<ndb_mgm_node_state> apiNodes; + +int +getStatus(){ + int retries = 0; + struct ndb_mgm_cluster_state * status; + struct ndb_mgm_node_state * node; + + ndbNodes.clear(); + mgmNodes.clear(); + apiNodes.clear(); + + while(retries < 10){ + status = ndb_mgm_get_status(handle); + if (status == NULL){ + ndbout << "status==NULL, retries="<<retries<<endl; + MGMERR(handle); + retries++; + continue; + } + for (int i = 0; i < status->no_of_nodes; i++){ + node = &status->node_states[i]; + switch(node->node_type){ + case NDB_MGM_NODE_TYPE_NDB: + ndbNodes.push_back(*node); + break; + case NDB_MGM_NODE_TYPE_MGM: + mgmNodes.push_back(*node); + break; + case NDB_MGM_NODE_TYPE_API: + apiNodes.push_back(*node); + break; + default: + if(node->node_status == NDB_MGM_NODE_STATUS_UNKNOWN || + node->node_status == NDB_MGM_NODE_STATUS_NO_CONTACT){ + retries++; + ndbNodes.clear(); + mgmNodes.clear(); + apiNodes.clear(); + free(status); + status = NULL; + i = status->no_of_nodes; + + ndbout << "kalle"<< endl; + break; + } + abort(); + break; + } + } + if(status == 0){ + ndbout << "status == 0" << endl; + continue; + } + free(status); + return 0; + } + + g_err << "getStatus failed" << endl; + return -1; +} + +int +waitClusterStarted(const char* _addr, unsigned int _timeout) +{ + ndb_mgm_node_status _status = NDB_MGM_NODE_STATUS_STARTED; + int _startphase = -1; + + int _nodes[MAX_NDB_NODES]; + int _num_nodes = 0; + + if (getStatus() != 0) + return -1; + + // Collect all nodes into nodes + for (size_t i = 0; i < ndbNodes.size(); i++){ + _nodes[i] = ndbNodes[i].node_id; + _num_nodes++; + } + + handle = ndb_mgm_create_handle(); + if (handle == NULL){ + g_err << "handle == NULL" << endl; + return -1; + } + g_info << "Connecting to mgmsrv at " << _addr << endl; + if (ndb_mgm_connect(handle, _addr) == -1) { + MGMERR(handle); + g_err << "Connection to " << _addr << " failed" << endl; + return -1; + } + + unsigned int attempts = 0; + unsigned int resetAttempts = 0; + const unsigned int MAX_RESET_ATTEMPTS = 10; + bool allInState = false; + while (allInState == false){ + if (_timeout > 0 && attempts > _timeout){ + /** + * Timeout has expired waiting for the nodes to enter + * the state we want + */ + bool waitMore = false; + /** + * Make special check if we are waiting for + * cluster to become started + */ + if(_status == NDB_MGM_NODE_STATUS_STARTED){ + waitMore = true; + /** + * First check if any node is not starting + * then it's no idea to wait anymore + */ + for (size_t n = 0; n < ndbNodes.size(); n++){ + if (ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTED && + ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTING) + waitMore = false; + + } + } + + if (!waitMore || resetAttempts > MAX_RESET_ATTEMPTS){ + g_err << "waitNodeState(" + << ndb_mgm_get_node_status_string(_status) + <<", "<<_startphase<<")" + << " timeout after " << attempts <<" attemps" << endl; + return -1; + } + + g_err << "waitNodeState(" + << ndb_mgm_get_node_status_string(_status) + <<", "<<_startphase<<")" + << " resetting number of attempts " + << resetAttempts << endl; + attempts = 0; + resetAttempts++; + + } + + allInState = true; + if (getStatus() != 0){ + g_err << "getStatus != 0" << endl; + return -1; + } + + // ndbout << "waitNodeState; _num_nodes = " << _num_nodes << endl; + // for (int i = 0; i < _num_nodes; i++) + // ndbout << " node["<<i<<"] =" <<_nodes[i] << endl; + + for (int i = 0; i < _num_nodes; i++){ + ndb_mgm_node_state* ndbNode = NULL; + for (size_t n = 0; n < ndbNodes.size(); n++){ + if (ndbNodes[n].node_id == _nodes[i]) + ndbNode = &ndbNodes[n]; + } + + if(ndbNode == NULL){ + allInState = false; + continue; + } + + g_info << "State node " << ndbNode->node_id << " " + << ndb_mgm_get_node_status_string(ndbNode->node_status)<< endl; + + assert(ndbNode != NULL); + + if(_status == NDB_MGM_NODE_STATUS_STARTING && + ((ndbNode->node_status == NDB_MGM_NODE_STATUS_STARTING && + ndbNode->start_phase >= _startphase) || + (ndbNode->node_status == NDB_MGM_NODE_STATUS_STARTED))) + continue; + + if (_status == NDB_MGM_NODE_STATUS_STARTING){ + g_info << "status = " + << ndb_mgm_get_node_status_string(ndbNode->node_status) + <<", start_phase="<<ndbNode->start_phase<<endl; + if (ndbNode->node_status != _status) { + if (ndbNode->node_status < _status) + allInState = false; + else + g_info << "node_status(" << ndbNode->node_status + <<") != _status("<<_status<<")"<<endl; + } else if (ndbNode->start_phase < _startphase) + allInState = false; + } else { + if (ndbNode->node_status != _status) + allInState = false; + } + } + g_info << "Waiting for cluster enter state" + << ndb_mgm_get_node_status_string(_status)<< endl; + NdbSleep_SecSleep(1); + attempts++; + } + return 0; +} |