summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <mskold/marty@mysql.com/linux.site>2006-09-13 18:49:05 +0200
committerunknown <mskold/marty@mysql.com/linux.site>2006-09-13 18:49:05 +0200
commit64c937038d037c925221612555879a73ac66def9 (patch)
treefdd4de3e1952e0c20bd6a425398e44043fb78490 /sql/ha_ndbcluster.cc
parent8b1d995987f0cdfb24814127c3d9218052c52891 (diff)
downloadmariadb-git-64c937038d037c925221612555879a73ac66def9.tar.gz
Bug #21378 Alter table from X storage engine to NDB could cause data loss: skip autodiscover of local tables
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 987c96aed37..7398c15a9c8 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -4720,7 +4720,6 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
if (hash_search(&ndb_tables, file_name, strlen(file_name)))
{
DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name));
- // File existed in NDB and as frm file, put in ok_tables list
file_on_disk= true;
}
@@ -4733,14 +4732,21 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
DBUG_PRINT("info", ("%s did not exist on disk", name));
// .ndb file did not exist on disk, another table type
if (file_on_disk)
+ {
+ // Ignore this ndb table
+ gptr record= hash_search(&ndb_tables, file_name, strlen(file_name));
+ DBUG_ASSERT(record);
+ hash_delete(&ndb_tables, record);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TABLE_EXISTS_ERROR,
"Local table %s.%s shadows ndb table",
db, file_name);
+ }
continue;
}
if (file_on_disk)
{
+ // File existed in NDB and as frm file, put in ok_tables list
my_hash_insert(&ok_tables, (byte*)file_name);
continue;
}