From 83cd9eca3044a0fe0bbae59d5e55d014488d741b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 May 2006 10:58:12 +0200 Subject: [PATCH] Bug #16997 Table rename that changes database does not rename indexes: merge --- ndb/include/ndbapi/NdbDictionary.hpp | 29 ++++++++++++++-------------- ndb/src/ndbapi/NdbDictionary.cpp | 2 +- ndb/src/ndbapi/NdbDictionaryImpl.hpp | 3 ++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index b1dd212ebca..1413931035d 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -1182,6 +1182,15 @@ public: const Index * getIndex(const char * indexName, const char * tableName) const; + /** + * Get index with given name, NULL if undefined + * @param indexName Name of index to get. + * @param Table instance table that index belongs to. + * @return index if successful, otherwise 0. + */ + const Index * getIndex(const char * indexName, + const Table & table) const; + /** * Fetch list of indexes of given table. * @param list Reference to list where to store the listed indexes @@ -1301,23 +1310,15 @@ public: */ int dropIndex(const char * indexName, const char * tableName); - /** - * Get index with given name, NULL if undefined - * @param indexName Name of index to get. - * @param tableName Name of table that index belongs to. - * @return index if successful, otherwise 0. - */ - const Index * getIndex(const char * indexName, - const char * tableName); /** - * Get index with given name, NULL if undefined - * @param indexName Name of index to get. - * @param Table instance table that index belongs to. - * @return index if successful, otherwise 0. + * Drop index the defined Index instance + * @param Index to drop + * @return 0 if successful otherwise -1. */ - const Index * getIndex(const char * indexName, - const Table & table); + int dropIndex(const Index &); + + #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Invalidate cached index object diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 2f5c1756000..a342a5d5926 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -818,7 +818,7 @@ NdbDictionary::Dictionary::getIndex(const char * indexName, const NdbDictionary::Index * NdbDictionary::Dictionary::getIndex(const char * indexName, - const Table & t) + const Table & t) const { NdbIndexImpl * i = m_impl.getIndex(indexName, & NdbTableImpl::getImpl(t)); if(i) diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index d464c9a7a9c..b0b7adf25f3 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -702,6 +702,7 @@ inline NdbIndexImpl * NdbDictionaryImpl::getIndex(const char * index_name, const char * table_name) +{ return getIndex(index_name, (table_name) ? getTable(table_name) : NULL); } @@ -710,7 +711,7 @@ NdbIndexImpl * NdbDictionaryImpl::getIndex(const char * index_name, NdbTableImpl * table) { - if (table || m_ndb.usingFullyQualifiedNames()) { + if (table || m_ndb.usingFullyQualifiedNames()) { const BaseString internal_indexname( (table)