mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01: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
This commit is contained in:
parent
38dfc8628e
commit
803228a1a8
2 changed files with 23 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue