Bug #31470 ndb table with special characters in name are not discovered correctly

parent 0bf78805
...@@ -121,3 +121,24 @@ show tables; ...@@ -121,3 +121,24 @@ show tables;
Tables_in_db Tables_in_db
t2 t2
drop database db; drop database db;
use test;
create table `test`.`t1$EX`
(server_id int unsigned,
master_server_id int unsigned,
master_epoch bigint unsigned,
count int unsigned,
primary key(server_id, master_server_id,
master_epoch, count))
engine ndb;
show tables like '%$%';
Tables_in_test (%$%)
t1$EX
use test;
show tables like '%$%';
Tables_in_test (%$%)
t1$EX
drop table `test`.`t1$EX`;
show tables like '%$%';
Tables_in_test (%$%)
show tables like '%$%';
Tables_in_test (%$%)
...@@ -122,4 +122,31 @@ connection server2; ...@@ -122,4 +122,31 @@ connection server2;
show tables; show tables;
drop database db; drop database db;
#
# bug#31470, ndb table with special characters in name
# are not discovered correctly
connection server1;
use test;
create table `test`.`t1$EX`
(server_id int unsigned,
master_server_id int unsigned,
master_epoch bigint unsigned,
count int unsigned,
primary key(server_id, master_server_id,
master_epoch, count))
engine ndb;
# check that table shows up ok on both servers
# before bugfix table would not show up on server2
show tables like '%$%';
connection server2;
use test;
show tables like '%$%';
# check cleanup
drop table `test`.`t1$EX`;
show tables like '%$%';
connection server1; connection server1;
show tables like '%$%';
...@@ -2641,8 +2641,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) ...@@ -2641,8 +2641,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
frmblob and frmlen are set, write the frm to disk frmblob and frmlen are set, write the frm to disk
*/ */
(void)strxnmov(path,FN_REFLEN-1,mysql_data_home,FN_ROOTDIR, build_table_filename(path, FN_REFLEN-1, db, name, "", 0);
db,FN_ROOTDIR,name,NullS);
// Save the frm file // Save the frm file
error= writefrm(path, frmblob, frmlen); error= writefrm(path, frmblob, frmlen);
my_free(frmblob, MYF(0)); my_free(frmblob, MYF(0));
......
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