diff options
author | unknown <mskold/marty@mysql.com/linux.site> | 2006-09-01 15:14:50 +0200 |
---|---|---|
committer | unknown <mskold/marty@mysql.com/linux.site> | 2006-09-01 15:14:50 +0200 |
commit | 6138410cf08728e607e7bc80d8744953eeeef79a (patch) | |
tree | 9d1b05ab23ca550c8e52260f1bd0be73bec28471 /storage/ndb/ndbapi-examples/ndbapi_simple_index | |
parent | 3dcf86736ad48960656d2f2fce9839e6ea330070 (diff) | |
download | mariadb-git-6138410cf08728e607e7bc80d8744953eeeef79a.tar.gz |
Fixed ndbapi-examples, and added tests for mysql-test-run.pl
storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp
storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile
storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp
mysql-test/include/have_ndbapi_examples.inc:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/include/have_ndbapi_examples.inc
mysql-test/t/ndbapi.test:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/t/ndbapi.test
mysql-test/t/rpl_ndbapi_multi.test:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/t/rpl_ndbapi_multi.test
mysql-test/r/have_ndbapi_examples.require:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/r/have_ndbapi_examples.require
mysql-test/r/ndbapi.result:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/r/ndbapi.result
mysql-test/r/rpl_ndbapi_multi.result:
BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/r/rpl_ndbapi_multi.result
Diffstat (limited to 'storage/ndb/ndbapi-examples/ndbapi_simple_index')
-rw-r--r-- | storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile | 1 | ||||
-rw-r--r-- | storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile b/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile index 3b3ac7f484a..c38975381f5 100644 --- a/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile +++ b/storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile @@ -10,6 +10,7 @@ TOP_SRCDIR = ../../../.. INCLUDE_DIR = $(TOP_SRCDIR) LIB_DIR = -L$(TOP_SRCDIR)/storage/ndb/src/.libs \ -L$(TOP_SRCDIR)/libmysql_r/.libs \ + -L$(TOP_SRCDIR)/zlib/.libs \ -L$(TOP_SRCDIR)/mysys -L$(TOP_SRCDIR)/strings SYS_LIB = diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp b/storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp index 5afaf6078d1..c1cc20f2ea1 100644 --- a/storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp +++ b/storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp @@ -49,8 +49,15 @@ PRINT_ERROR(error.code,error.message); \ exit(-1); } -int main() +int main(int argc, char** argv) { + if (argc != 3) + { + std::cout << "Arguments are <socket mysqld> <connect_string cluster>.\n"; + exit(-1); + } + char * mysqld_sock = argv[1]; + const char *connectstring = argv[2]; ndb_init(); MYSQL mysql; @@ -63,7 +70,7 @@ int main() exit(-1); } if ( !mysql_real_connect(&mysql, "localhost", "root", "", "", - 3306, "/tmp/mysql.sock", 0) ) + 0, mysqld_sock, 0) ) MYSQLERROR(mysql); mysql_query(&mysql, "CREATE DATABASE TEST_DB_1"); @@ -85,7 +92,7 @@ int main() **************************************************************/ Ndb_cluster_connection *cluster_connection= - new Ndb_cluster_connection(); // Object representing the cluster + new Ndb_cluster_connection(connectstring); // Object representing the cluster if (cluster_connection->connect(5,3,1)) { @@ -110,7 +117,7 @@ int main() const NdbDictionary::Table *myTable= myDict->getTable("MYTABLENAME"); if (myTable == NULL) APIERROR(myDict->getNdbError()); - const NdbDictionary::Index *myIndex= myDict->getIndex("MYINDEXNAME","MYTABLENAME"); + const NdbDictionary::Index *myIndex= myDict->getIndex("MYINDEXNAME$unique","MYTABLENAME"); if (myIndex == NULL) APIERROR(myDict->getNdbError()); |