diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2005-01-03 13:51:28 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2005-01-03 13:51:28 +0100 |
commit | ab85635e686b68f679b3e2bf3f0f35709b8e5dc0 (patch) | |
tree | fee83c9ca62f95713f43baec3e9ac8b658e9d3a1 | |
parent | 52722f1b433a9c6406693ad26e79e9c10b574c34 (diff) | |
download | mariadb-git-ab85635e686b68f679b3e2bf3f0f35709b8e5dc0.tar.gz |
Makefile:
fixed ndbapi_example
ndbapi_example1.cpp:
fixed ndbapi_example
ndb/examples/ndbapi_example1/ndbapi_example1.cpp:
fixed ndbapi_example
ndb/examples/ndbapi_example1/Makefile:
fixed ndbapi_example
-rw-r--r-- | ndb/examples/ndbapi_example1/Makefile | 4 | ||||
-rw-r--r-- | ndb/examples/ndbapi_example1/ndbapi_example1.cpp | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/ndb/examples/ndbapi_example1/Makefile b/ndb/examples/ndbapi_example1/Makefile index 90719423233..648a4052dc2 100644 --- a/ndb/examples/ndbapi_example1/Makefile +++ b/ndb/examples/ndbapi_example1/Makefile @@ -7,12 +7,12 @@ DEBUG = LFLAGS = -Wall INCLUDE_DIR = ../../include LIB_DIR = -L../../src/.libs \ - -L../../../libmysql/.libs \ + -L../../../libmysql_r/.libs \ -L../../../mysys SYS_LIB = $(TARGET): $(OBJS) - $(CXX) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient -lmysys $(SYS_LIB) -o $(TARGET) + $(CXX) $(LFLAGS) $(LIB_DIR) $(OBJS) -lndbclient -lmysqlclient_r -lmysys -lz $(SYS_LIB) -o $(TARGET) $(TARGET).o: $(SRCS) $(CXX) $(CFLAGS) -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/ndbapi $(SRCS) diff --git a/ndb/examples/ndbapi_example1/ndbapi_example1.cpp b/ndb/examples/ndbapi_example1/ndbapi_example1.cpp index 25fb69d8690..a3f003e2fc4 100644 --- a/ndb/examples/ndbapi_example1/ndbapi_example1.cpp +++ b/ndb/examples/ndbapi_example1/ndbapi_example1.cpp @@ -49,6 +49,23 @@ int main() Ndb_cluster_connection *cluster_connection= new Ndb_cluster_connection(); // Object representing the cluster + int r= cluster_connection->connect(5 /* retries */, + 3 /* delay between retries */, + 1 /* verbose */); + if (r > 0) + { + std::cout + << "Cluster connect failed, possibly resolved with more retries.\n"; + exit(-1); + } + else if (r < 0) + { + std::cout + << "Cluster connect failed.\n"; + exit(-1); + } + + if (cluster_connection->wait_until_ready(30,30)) { std::cout << "Cluster was not ready within 30 secs." << std::endl; |