summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-10-08 13:37:13 +0200
committerunknown <magnus@neptunus.(none)>2004-10-08 13:37:13 +0200
commit3d963659e4873423a948acb4dac94f8a8bfcf4e3 (patch)
tree312b2fb7c11708d32ce870e2cebdcf25b2b22920 /sql/ha_ndbcluster.cc
parent69b6adbd583fa669a2c52ed7d37e147d77fa40ee (diff)
downloadmariadb-git-3d963659e4873423a948acb4dac94f8a8bfcf4e3.tar.gz
BUG#5973 ndb table belonging to different database shows up in SHOW TABLES
mysql-test/r/ndb_autodiscover.result: Added test cases to check that SHOW TABLES only show tables in the selected db. mysql-test/t/ndb_autodiscover.test: Added test cases to check that SHOW TABLES only show tables in the selected db. sql/ha_ndbcluster.cc: Only find files for the current db Only add files to files list which can be created i.e has a valid frm blob. This prevents NDB$BLOB tables and tables created from NdbApi to show up.
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index bb6ace75f1f..3441ee1e339 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -3844,6 +3844,10 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
NdbDictionary::Dictionary::List::Element& t= list.elements[i];
DBUG_PRINT("info", ("Found %s/%s in NDB", t.database, t.name));
+ // Add only tables that belongs to db
+ if (my_strcasecmp(system_charset_info, t.database, db))
+ continue;
+
// Apply wildcard to list of tables in NDB
if (wild)
{
@@ -3938,8 +3942,8 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
while ((file_name=it2++))
{
DBUG_PRINT("info", ("Table %s need discovery", name));
- ha_create_table_from_engine(thd, db, file_name, true);
- files->push_back(thd->strdup(file_name));
+ if (ha_create_table_from_engine(thd, db, file_name, true) == 0)
+ files->push_back(thd->strdup(file_name));
}
pthread_mutex_unlock(&LOCK_open);