Commit 9ff78327 authored by mskold/marty@mysql.com/linux.site's avatar mskold/marty@mysql.com/linux.site

Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1

into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0
parents bf52d20b 4979d152
...@@ -69,3 +69,35 @@ t3 ...@@ -69,3 +69,35 @@ t3
t4 t4
drop table t1, t2, t3, t4; drop table t1, t2, t3, t4;
drop table t1, t3, t4; drop table t1, t3, t4;
create table t1(c1 int key)ENGINE=MyISAM;
insert into t1 values(1),(3),(5);
select * from t1 order by c1;
c1
1
3
5
create table t1(c1 int key)ENGINE=MyISAM;
insert into t1 values(100),(344),(533);
select * from t1 order by c1;
c1
100
344
533
alter table t1 engine=ndb;
show tables;
Tables_in_test
t1
Warnings:
Warning 1050 Local table t1 shadows cluster table
select * from t1 order by c1;
c1
100
344
533
drop table t1;
select * from t1 order by c1;
c1
1
3
5
drop table t1;
...@@ -69,4 +69,26 @@ drop table t1, t2, t3, t4; ...@@ -69,4 +69,26 @@ drop table t1, t2, t3, t4;
connection server2; connection server2;
drop table t1, t3, t4; drop table t1, t3, t4;
# bug#21378
connection server1;
create table t1(c1 int key)ENGINE=MyISAM;
insert into t1 values(1),(3),(5);
select * from t1 order by c1;
connection server2;
create table t1(c1 int key)ENGINE=MyISAM;
insert into t1 values(100),(344),(533);
select * from t1 order by c1;
connection server1;
alter table t1 engine=ndb;
connection server2;
show tables;
select * from t1 order by c1;
drop table t1;
connection server1;
select * from t1 order by c1;
drop table t1;
# End of 4.1 tests # End of 4.1 tests
...@@ -5070,16 +5070,15 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, ...@@ -5070,16 +5070,15 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
List<char> delete_list; List<char> delete_list;
while ((file_name=it++)) 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))) if (hash_search(&ndb_tables, file_name, strlen(file_name)))
{ {
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 existed in NDB and as frm file, put in ok_tables list file_on_disk= true;
my_hash_insert(&ok_tables, (byte*)file_name);
continue;
} }
// File is not in NDB, check for .ndb file with this name // Check for .ndb file with this name
(void)strxnmov(name, FN_REFLEN, (void)strxnmov(name, FN_REFLEN,
mysql_data_home,"/",db,"/",file_name,ha_ndb_ext,NullS); mysql_data_home,"/",db,"/",file_name,ha_ndb_ext,NullS);
DBUG_PRINT("info", ("Check access for %s", name)); DBUG_PRINT("info", ("Check access for %s", name));
...@@ -5087,9 +5086,25 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, ...@@ -5087,9 +5086,25 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
{ {
DBUG_PRINT("info", ("%s did not exist on disk", name)); DBUG_PRINT("info", ("%s did not exist on disk", name));
// .ndb file did not exist on disk, another table type // .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; continue;
} }
DBUG_PRINT("info", ("%s existed on disk", name)); DBUG_PRINT("info", ("%s existed on disk", name));
// The .ndb file exists on disk, but it's not in list of tables in ndb // The .ndb file exists on disk, but it's not in list of tables in ndb
// Verify that handler agrees table is gone. // Verify that handler agrees table is gone.
......
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