summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-05-12 16:31:54 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2011-05-12 16:31:54 +0200
commit1779c2adbfdd0a99ab1b8f1f9de132b0345887ba (patch)
treef33a3842ccb43602dd87c9ee1e2b8464009721b6 /mysql-test
parente343a2c1347a0e99b363dbced913276d2355237f (diff)
parent984fa23b457fe0956fd118ea543467b2d2c7475e (diff)
downloadmariadb-git-1779c2adbfdd0a99ab1b8f1f9de132b0345887ba.tar.gz
merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/create.result19
-rw-r--r--mysql-test/r/upgrade.result6
-rw-r--r--mysql-test/t/create.test25
-rw-r--r--mysql-test/t/upgrade.test4
4 files changed, 46 insertions, 8 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index e871d9526ca..720e7c1d24e 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1890,5 +1890,24 @@ create table t3 (a int) row_format=page;
drop table t1,t2,t3;
# -- End of Bug#45829
+# new table creation/renaming blocked if old encoded table present
+create table `t-1` (a int) engine=myisam;
+insert into `t-1` values (1);
+show tables;
+Tables_in_test
+t-1
+flush tables;
+convert table files in mysql 5.0 file name encoding
+show tables;
+Tables_in_test
+#mysql50#t-1
+create table `t-1` (a int);
+ERROR 42S01: Table '#mysql50#t-1' already exists
+create table t1 (a int);
+alter table t1 rename `t-1`;
+ERROR 42S01: Table '#mysql50#t-1' already exists
+rename table t1 to `t-1`;
+ERROR 42S01: Table '#mysql50#t-1' already exists
+drop table `#mysql50#t-1`, t1;
End of 5.1 tests
diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result
index f2c8886c915..ec63cc0d98c 100644
--- a/mysql-test/r/upgrade.result
+++ b/mysql-test/r/upgrade.result
@@ -48,14 +48,10 @@ insert into `txu#p#p1` values (1);
select * from `txu@0023p@0023p1`;
ERROR 42S02: Table 'test.txu@0023p@0023p1' doesn't exist
create table `txu@0023p@0023p1` (s1 int);
-insert into `txu@0023p@0023p1` values (2);
-select * from `txu@0023p@0023p1`;
-s1
-2
+ERROR 42S01: Table '#mysql50#txu@0023p@0023p1' already exists
select * from `txu#p#p1`;
s1
1
-drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
#
# Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index b59fa9edb9f..8f39fb0e0b9 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1534,5 +1534,30 @@ drop table t1,t2,t3;
--echo
--echo # -- End of Bug#45829
+#
+--echo # new table creation/renaming 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);
+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);
+create table t1 (a int);
+--error ER_TABLE_EXISTS_ERROR
+alter table t1 rename `t-1`;
+--error ER_TABLE_EXISTS_ERROR
+rename table t1 to `t-1`;
+drop table `#mysql50#t-1`, t1;
+
--echo
--echo End of 5.1 tests
diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test
index 400ce07b7fd..a8c875ef764 100644
--- a/mysql-test/t/upgrade.test
+++ b/mysql-test/t/upgrade.test
@@ -41,11 +41,9 @@ create table `txu#p#p1` (s1 int);
insert into `txu#p#p1` values (1);
--error 1146
select * from `txu@0023p@0023p1`;
+--error ER_TABLE_EXISTS_ERROR
create table `txu@0023p@0023p1` (s1 int);
-insert into `txu@0023p@0023p1` values (2);
-select * from `txu@0023p@0023p1`;
select * from `txu#p#p1`;
-drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
--echo #