Commit ef99545f authored by unknown's avatar unknown

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
parent d319e12a
......@@ -180,6 +180,11 @@ drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
# Bug #30667
# ndb table discovery does not work correcly with information schema
# - prior to bug fix this would yeild no output and a warning
select * from information_schema.columns where table_name = "t1_c";
# random output order??
#show tables;
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment