summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-08-28 15:43:06 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-08-28 15:43:06 +0200
commitef99545faa2a868e9e96e9abc5fef623e7b510c3 (patch)
tree47afbf13d90cd2df962bfeb8d91245dfebcda851 /sql/ha_ndbcluster.cc
parentd319e12ab713c60b0efb4e34637977f1e3f3e401 (diff)
downloadmariadb-git-ef99545faa2a868e9e96e9abc5fef623e7b510c3.tar.gz
Bug #30667 ndb table discovery does not work correcly with information schema
- the listed file_names are not necessarily on disk, so we need to discover them if they aren't mysql-test/t/ndb_restore.test: Bug #30667 ndb table discovery does not work correcly with information schema
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 4d02c8267db..d252a92393c 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -6955,9 +6955,26 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
while ((file_name=it++))
{
bool file_on_disk= FALSE;
- DBUG_PRINT("info", ("%s", file_name));
+ DBUG_PRINT("info", ("%s", file_name));
if (hash_search(&ndb_tables, file_name, strlen(file_name)))
{
+ build_table_filename(name, sizeof(name), db, file_name, reg_ext, 0);
+ if (my_access(name, F_OK))
+ {
+ pthread_mutex_lock(&LOCK_open);
+ DBUG_PRINT("info", ("Table %s listed and need discovery",
+ file_name));
+ if (ndb_create_table_from_engine(thd, db, file_name))
+ {
+ pthread_mutex_unlock(&LOCK_open);
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TABLE_EXISTS_ERROR,
+ "Discover of table %s.%s failed",
+ db, file_name);
+ continue;
+ }
+ pthread_mutex_unlock(&LOCK_open);
+ }
DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
file_on_disk= TRUE;
}