"
  revision-id: sanja@askmonty.org-20110511110948-4kdevwzomvk56y1w
  committer: sanja@askmonty.org
  branch nick: work-maria-5.1-CREATE-merge
  timestamp: Wed 2011-05-11 14:09:48 +0300
    Bugfix: New table creation/renaming block added if old encoded table present
"
the old behavior was less inconsistent than the new one.
In the new one the error message was sometimes different (under LOCK TABLES e.g.),
and there were race conditions (if this CREATE happened when a concurrent ALTER
has renamed the old table away but haven't put the new table in place)

The old one was like "(when using old table names) for DML #mysql50# prefix
is optional, for DDL it's required".
This commit is contained in:
Sergei Golubchik 2013-04-09 15:35:07 +02:00
commit 87a9d60ec6
7 changed files with 54 additions and 116 deletions

View file

@ -1559,29 +1559,26 @@ drop table t1,t2,t3;
--echo # -- End of Bug#45829
#
--echo # new table creation/renaming blocked if old encoded table present
# new table creation/renaming is NOT blocked if old encoded table present
#
let $MYSQLD_DATADIR= `select @@datadir`;
create table `t-1` (a int) engine=myisam;
insert into `t-1` values (1);
create table `#mysql50#t-1` (a int) engine=myisam;
insert into `#mysql50#t-1` values (1);
show tables;
flush tables;
--echo convert table files in mysql 5.0 file name encoding
--copy_file $MYSQLD_DATADIR/test/t@002d1.MYD $MYSQLD_DATADIR/test/t-1.MYD
--copy_file $MYSQLD_DATADIR/test/t@002d1.MYI $MYSQLD_DATADIR/test/t-1.MYI
--copy_file $MYSQLD_DATADIR/test/t@002d1.frm $MYSQLD_DATADIR/test/t-1.frm
--remove_file $MYSQLD_DATADIR/test/t@002d1.MYD
--remove_file $MYSQLD_DATADIR/test/t@002d1.MYI
--remove_file $MYSQLD_DATADIR/test/t@002d1.frm
show tables;
--error ER_TABLE_EXISTS_ERROR
create table `t-1` (a int);
show tables;
# selects can distinguish between the two tables
select * from `t-1`;
select * from `#mysql50#t-1`;
drop table `t-1`;
create table t1 (a int);
--error ER_TABLE_EXISTS_ERROR
alter table t1 rename `t-1`;
--error ER_TABLE_EXISTS_ERROR
show tables;
drop table `t-1`;
create table t1 (a int);
rename table t1 to `t-1`;
drop table `#mysql50#t-1`, t1;
show tables;
drop table `#mysql50#t-1`, `t-1`;
--echo
--echo End of 5.1 tests