From 3d963659e4873423a948acb4dac94f8a8bfcf4e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Oct 2004 13:37:13 +0200 Subject: 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. --- sql/ha_ndbcluster.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/ha_ndbcluster.cc') 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); -- cgit v1.2.1