mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
last go at enabling using const NdbDictionary didn't work
+ some docs update on events
This commit is contained in:
parent
79fb236b0a
commit
fa5127e2ff
5 changed files with 33 additions and 19 deletions
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
||||
/** @} *******************************************************************/
|
||||
/**
|
||||
|
|
|
@ -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 &
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue