mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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
This commit is contained in:
@@ -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 t3_c | grep ForceVarPart
|
||||||
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_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??
|
# random output order??
|
||||||
#show tables;
|
#show tables;
|
||||||
|
|
||||||
|
@@ -6955,9 +6955,26 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
|
|||||||
while ((file_name=it++))
|
while ((file_name=it++))
|
||||||
{
|
{
|
||||||
bool file_on_disk= FALSE;
|
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)))
|
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));
|
DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
|
||||||
file_on_disk= TRUE;
|
file_on_disk= TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user