summaryrefslogtreecommitdiff
path: root/ndb/src/mgmapi
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-11-15 19:27:06 +0100
committerunknown <serg@serg.mylan>2004-11-15 19:27:06 +0100
commit03d82a4652c82fb1930e0e515877e8fffbb0e5b0 (patch)
treef8bc0b4f9899e5b4a5f848426d4568de1213e64b /ndb/src/mgmapi
parentf3f73a48df66247e8c155fa429aeb1c42b2e7a55 (diff)
parenta59b0fbfd6b7627a4fdf2233482e732480dbe437 (diff)
downloadmariadb-git-03d82a4652c82fb1930e0e515877e8fffbb0e5b0.tar.gz
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0 BitKeeper/etc/ignore: auto-union configure.in: Auto merged dbug/dbug.c: Auto merged include/my_dbug.h: Auto merged include/my_sys.h: Auto merged sql/filesort.cc: Auto merged sql/ha_isam.cc: Auto merged sql/ha_isammrg.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'ndb/src/mgmapi')
-rw-r--r--ndb/src/mgmapi/Makefile_old27
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp42
2 files changed, 42 insertions, 27 deletions
diff --git a/ndb/src/mgmapi/Makefile_old b/ndb/src/mgmapi/Makefile_old
deleted file mode 100644
index fa734f998e6..00000000000
--- a/ndb/src/mgmapi/Makefile_old
+++ /dev/null
@@ -1,27 +0,0 @@
-include .defs.mk
-
-TYPE := util
-
-PIC_ARCHIVE := Y
-ARCHIVE_TARGET := mgmapi
-
-A_LIB := Y
-SO_LIB := Y
-PIC_LIB := Y
-
-#DIRS := test
-
-LIB_TARGET := MGM_API
-LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib
-
-# Source files of non-templated classes (.C files)
-SOURCES = mgmapi.cpp mgmapi_configuration.cpp
-
-CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \
- -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon)
-
-CCFLAGS += -DNO_DEBUG_MESSAGES
-
-# -I$(NDB_TOP)/src/common/mgmcommon
-
-include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 4b62df968b3..66f0dbb1842 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -1834,4 +1834,46 @@ ndb_mgm_set_string_parameter(NdbMgmHandle handle,
return res;
}
+extern "C"
+int
+ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){
+ CHECK_HANDLE(handle, 0);
+ CHECK_CONNECTED(handle, 0);
+
+ Properties args;
+
+ const ParserRow<ParserDummy> reply[]= {
+ MGM_CMD("purge stale sessions reply", NULL, ""),
+ MGM_ARG("purged", String, Optional, ""),
+ MGM_ARG("result", String, Mandatory, "Error message"),
+ MGM_END()
+ };
+
+ const Properties *prop;
+ prop= ndb_mgm_call(handle, reply, "purge stale sessions", &args);
+
+ if(prop == NULL) {
+ SET_ERROR(handle, EIO, "Unable to purge stale sessions");
+ return -1;
+ }
+
+ int res= -1;
+ do {
+ const char * buf;
+ if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
+ ndbout_c("ERROR Message: %s\n", buf);
+ break;
+ }
+ if (purged) {
+ if (prop->get("purged", &buf))
+ *purged= strdup(buf);
+ else
+ *purged= 0;
+ }
+ res= 0;
+ } while(0);
+ delete prop;
+ return res;
+}
+
template class Vector<const ParserRow<ParserDummy>*>;