diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2005-01-05 19:59:45 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2005-01-05 19:59:45 +0100 |
commit | 41b5876edb2b73138dee69fafd453480a1f33ac4 (patch) | |
tree | a3ad24c5488118265d6c9231fe34950f5070f3d8 /ndb | |
parent | 3add897ef9126487a5d6bf299bc46268df17072e (diff) | |
download | mariadb-git-41b5876edb2b73138dee69fafd453480a1f33ac4.tar.gz |
last go at enabling using const NdbDictionary didn't work
+ some docs update on events
ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp:
updated example somewhat
ndb/include/ndbapi/NdbDictionary.hpp:
fixed some docs
ndb/src/ndbapi/NdbDictionary.cpp:
last go at enabling using const NdbDictionary didn't work
ndb/tools/desc.cpp:
last go at enabling using const NdbDictionary didn't work
ndb/tools/listTables.cpp:
last go at enabling using const NdbDictionary didn't work
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp | 3 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbDictionary.hpp | 31 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionary.cpp | 14 | ||||
-rw-r--r-- | ndb/tools/desc.cpp | 2 | ||||
-rw-r--r-- | ndb/tools/listTables.cpp | 2 |
5 files changed, 33 insertions, 19 deletions
diff --git a/ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp b/ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp index c8fa494345c..82b7abc16eb 100644 --- a/ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp +++ b/ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp @@ -72,7 +72,7 @@ int main() } // Optionally connect and wait for the storage nodes (ndbd's) - if (cluster_connection.wait_until_ready(30,30)) + if (cluster_connection.wait_until_ready(30,0) < 0) { std::cout << "Cluster was not ready within 30 secs.\n"; exit(-1); @@ -92,7 +92,6 @@ int main() run_application(mysql, cluster_connection); } - // ndb_end should not be called until all "Ndb" objects are deleted ndb_end(0); std::cout << "\nTo drop created table use:\n" diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index b82ba79463e..250942bbf82 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -901,21 +901,32 @@ public: */ class Event : public Object { public: - enum TableEvent { TE_INSERT=1, TE_DELETE=2, TE_UPDATE=4, TE_ALL=7 }; + enum TableEvent { + TE_INSERT=1, ///< Insert event on table + TE_DELETE=2, ///< Delete event on table + TE_UPDATE=4, ///< Update event on table + TE_ALL=7 ///< Any/all event on table (not relevant when + ///< events are received) + }; enum EventDurability { - ED_UNDEFINED = 0, + ED_UNDEFINED +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + = 0 +#endif #if 0 // not supported - ED_SESSION = 1, + ,ED_SESSION = 1, // Only this API can use it // and it's deleted after api has disconnected or ndb has restarted - ED_TEMPORARY = 2, + ED_TEMPORARY = 2 // All API's can use it, // But's its removed when ndb is restarted -#endif - ED_PERMANENT = 3 - // All API's can use it, - // It's still defined after a restart +#endif + ,ED_PERMANENT ///< All API's can use it, + ///< It's still defined after a restart +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + = 3 +#endif }; Event(const char *name); @@ -1010,7 +1021,7 @@ public: * Fetch list of all objects, optionally restricted to given type. */ int listObjects(List & list, Object::Type type = Object::TypeUndefined); - int listObjects(const List & list, + int listObjects(List & list, Object::Type type = Object::TypeUndefined) const; /** @@ -1050,7 +1061,7 @@ public: * @return 0 if successful, otherwise -1 */ int listIndexes(List & list, const char * tableName); - int listIndexes(const List & list, const char * tableName) const; + int listIndexes(List & list, const char * tableName) const; /** @} *******************************************************************/ /** diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 24cd48cb2a3..f641b8cd5a0 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -824,10 +824,9 @@ NdbDictionary::Dictionary::listObjects(List& list, Object::Type type) } int -NdbDictionary::Dictionary::listObjects(const List& list, - Object::Type type) const +NdbDictionary::Dictionary::listObjects(List& list, Object::Type type) const { - return m_impl.listObjects(*(List*)&list, type); + return m_impl.listObjects(list, type); } int @@ -842,10 +841,15 @@ NdbDictionary::Dictionary::listIndexes(List& list, const char * tableName) } int -NdbDictionary::Dictionary::listIndexes(const List& list, +NdbDictionary::Dictionary::listIndexes(List& list, const char * tableName) const { - return listIndexes(*(List *)&list, tableName); + const NdbDictionary::Table* tab= getTable(tableName); + if(tab == 0) + { + return -1; + } + return m_impl.listIndexes(list, tab->getTableId()); } const struct NdbError & diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index 4129f775540..b18f97a05b1 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -101,7 +101,7 @@ int main(int argc, char** argv){ if (pTab != 0){ ndbout << (* pTab) << endl; - const NdbDictionary::Dictionary::List list; + NdbDictionary::Dictionary::List list; if (dict->listIndexes(list, argv[i]) != 0){ ndbout << argv[i] << ": " << dict->getNdbError() << endl; return NDBT_ProgramExit(NDBT_FAILED); diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index fbad9eeba87..e018bd6d9a5 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -29,7 +29,7 @@ static Ndb_cluster_connection *ndb_cluster_connection= 0; static Ndb* ndb = 0; -static NdbDictionary::Dictionary * dic = 0; +static const NdbDictionary::Dictionary * dic = 0; static int _unqualified = 0; static void |