summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/alter_table.result55
-rw-r--r--mysql-test/r/backup.result20
-rw-r--r--mysql-test/t/alter_table.test39
-rw-r--r--mysql-test/t/backup.test16
4 files changed, 63 insertions, 67 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 3095d5337ed..d3657d84678 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -657,43 +657,45 @@ SELECT * FROM t1;
v b
abc 5
DROP TABLE t1;
-DROP DATABASE IF EXISTS mysqltest;
-CREATE DATABASE mysqltest;
-use mysqltest;
-DROP TABLE IF EXISTS `t1_nägel`, `t1_blüten`;
-CREATE TABLE `t1_nägel` (c1 INT);
-ALTER TABLE `t1_nägel` RENAME `t1_blüten`;
-CREATE TABLE `t1_nägel` (c1 INT);
-ALTER TABLE `t1_nägel` RENAME `t1_blüten`;
-ERROR 42S01: Table 't1_blЭten' already exists
-DROP TABLE `t1_nägel`, `t1_blüten`;
-CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT);
-ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`;
-CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT);
-ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`;
-ERROR 42S01: Table 'tt1_blЭten' already exists
-SHOW CREATE TABLE `tt1_blüten`;
+DROP TABLE IF EXISTS `t+1`, `t+2`;
+CREATE TABLE `t+1` (c1 INT);
+ALTER TABLE `t+1` RENAME `t+2`;
+CREATE TABLE `t+1` (c1 INT);
+ALTER TABLE `t+1` RENAME `t+2`;
+ERROR 42S01: Table 't+2' already exists
+DROP TABLE `t+1`, `t+2`;
+CREATE TEMPORARY TABLE `tt+1` (c1 INT);
+ALTER TABLE `tt+1` RENAME `tt+2`;
+CREATE TEMPORARY TABLE `tt+1` (c1 INT);
+ALTER TABLE `tt+1` RENAME `tt+2`;
+ERROR 42S01: Table 'tt+2' already exists
+SHOW CREATE TABLE `tt+1`;
+Table Create Table
+tt+1 CREATE TEMPORARY TABLE `tt+1` (
+ `c1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE `tt+2`;
Table Create Table
-tt1_blüten CREATE TEMPORARY TABLE `tt1_blüten` (
+tt+2 CREATE TEMPORARY TABLE `tt+2` (
`c1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE `tt1_nägel`, `tt1_blüten`;
+DROP TABLE `tt+1`, `tt+2`;
CREATE TABLE `#sql1` (c1 INT);
CREATE TABLE `@0023sql2` (c1 INT);
SHOW TABLES;
-Tables_in_mysqltest
+Tables_in_test
#sql1
@0023sql2
RENAME TABLE `#sql1` TO `@0023sql1`;
RENAME TABLE `@0023sql2` TO `#sql2`;
SHOW TABLES;
-Tables_in_mysqltest
+Tables_in_test
#sql2
@0023sql1
ALTER TABLE `@0023sql1` RENAME `#sql-1`;
ALTER TABLE `#sql2` RENAME `@0023sql-2`;
SHOW TABLES;
-Tables_in_mysqltest
+Tables_in_test
#sql-1
@0023sql-2
INSERT INTO `#sql-1` VALUES (1);
@@ -702,18 +704,21 @@ DROP TABLE `#sql-1`, `@0023sql-2`;
CREATE TEMPORARY TABLE `#sql1` (c1 INT);
CREATE TEMPORARY TABLE `@0023sql2` (c1 INT);
SHOW TABLES;
-Tables_in_mysqltest
+Tables_in_test
ALTER TABLE `#sql1` RENAME `@0023sql1`;
ALTER TABLE `@0023sql2` RENAME `#sql2`;
SHOW TABLES;
-Tables_in_mysqltest
+Tables_in_test
INSERT INTO `#sql2` VALUES (1);
INSERT INTO `@0023sql1` VALUES (2);
+SHOW CREATE TABLE `#sql2`;
+Table Create Table
+#sql2 CREATE TEMPORARY TABLE `#sql2` (
+ `c1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE `@0023sql1`;
Table Create Table
@0023sql1 CREATE TEMPORARY TABLE `@0023sql1` (
`c1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `#sql2`, `@0023sql1`;
-use test;
-DROP DATABASE mysqltest;
diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result
index 05761240ca7..a4d1b18fe61 100644
--- a/mysql-test/r/backup.result
+++ b/mysql-test/r/backup.result
@@ -101,23 +101,23 @@ test.t5 backup status OK
Warnings:
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
drop table t5;
-DROP TABLE IF EXISTS `t-blüten`;
-CREATE TABLE `t-blüten` (c1 INT);
-INSERT INTO `t-blüten` VALUES (1), (2), (3);
-BACKUP TABLE `t-blüten` TO '../tmp';
+DROP TABLE IF EXISTS `t+1`;
+CREATE TABLE `t+1` (c1 INT);
+INSERT INTO `t+1` VALUES (1), (2), (3);
+BACKUP TABLE `t+1` TO '../tmp';
Table Op Msg_type Msg_text
-test.t-blüten backup status OK
+test.t+1 backup status OK
Warnings:
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
-DROP TABLE `t-blüten`;
-RESTORE TABLE `t-blüten` FROM '../tmp';
+DROP TABLE `t+1`;
+RESTORE TABLE `t+1` FROM '../tmp';
Table Op Msg_type Msg_text
-test.t-blüten restore status OK
+test.t+1 restore status OK
Warnings:
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
-SELECT * FROM `t-blüten`;
+SELECT * FROM `t+1`;
c1
1
2
3
-DROP TABLE `t-blüten`;
+DROP TABLE `t+1`;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index f6af92e0044..168d011a2ac 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -488,32 +488,26 @@ DROP TABLE t1;
#
# Bug#18775 - Temporary table from alter table visible to other threads
#
-# Use a special database to avoid name clashes with user tables.
+# Check if special characters work and duplicates are detected.
--disable_warnings
-DROP DATABASE IF EXISTS mysqltest;
+DROP TABLE IF EXISTS `t+1`, `t+2`;
--enable_warnings
-CREATE DATABASE mysqltest;
-use mysqltest;
-#
-# Check if non-ASCII alphabetic characters work and duplicates are detected.
---disable_warnings
-DROP TABLE IF EXISTS `t1_nägel`, `t1_blüten`;
---enable_warnings
-CREATE TABLE `t1_nägel` (c1 INT);
-ALTER TABLE `t1_nägel` RENAME `t1_blüten`;
-CREATE TABLE `t1_nägel` (c1 INT);
+CREATE TABLE `t+1` (c1 INT);
+ALTER TABLE `t+1` RENAME `t+2`;
+CREATE TABLE `t+1` (c1 INT);
--error ER_TABLE_EXISTS_ERROR
-ALTER TABLE `t1_nägel` RENAME `t1_blüten`;
-DROP TABLE `t1_nägel`, `t1_blüten`;
+ALTER TABLE `t+1` RENAME `t+2`;
+DROP TABLE `t+1`, `t+2`;
#
# Same for temporary tables though these names do not become file names.
-CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT);
-ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`;
-CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT);
+CREATE TEMPORARY TABLE `tt+1` (c1 INT);
+ALTER TABLE `tt+1` RENAME `tt+2`;
+CREATE TEMPORARY TABLE `tt+1` (c1 INT);
--error ER_TABLE_EXISTS_ERROR
-ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`;
-SHOW CREATE TABLE `tt1_blüten`;
-DROP TABLE `tt1_nägel`, `tt1_blüten`;
+ALTER TABLE `tt+1` RENAME `tt+2`;
+SHOW CREATE TABLE `tt+1`;
+SHOW CREATE TABLE `tt+2`;
+DROP TABLE `tt+1`, `tt+2`;
#
# Check if special characters as in tmp_file_prefix work.
CREATE TABLE `#sql1` (c1 INT);
@@ -538,10 +532,7 @@ ALTER TABLE `@0023sql2` RENAME `#sql2`;
SHOW TABLES;
INSERT INTO `#sql2` VALUES (1);
INSERT INTO `@0023sql1` VALUES (2);
+SHOW CREATE TABLE `#sql2`;
SHOW CREATE TABLE `@0023sql1`;
DROP TABLE `#sql2`, `@0023sql1`;
-#
-# Cleanup
-use test;
-DROP DATABASE mysqltest;
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index fa6bbc21813..61bde0cecb0 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -65,15 +65,15 @@ drop table t5;
#
# Backup did not encode table names.
--disable_warnings
-DROP TABLE IF EXISTS `t-blüten`;
+DROP TABLE IF EXISTS `t+1`;
--enable_warnings
-CREATE TABLE `t-blüten` (c1 INT);
-INSERT INTO `t-blüten` VALUES (1), (2), (3);
-BACKUP TABLE `t-blüten` TO '../tmp';
-DROP TABLE `t-blüten`;
+CREATE TABLE `t+1` (c1 INT);
+INSERT INTO `t+1` VALUES (1), (2), (3);
+BACKUP TABLE `t+1` TO '../tmp';
+DROP TABLE `t+1`;
#
# Same for restore.
-RESTORE TABLE `t-blüten` FROM '../tmp';
-SELECT * FROM `t-blüten`;
-DROP TABLE `t-blüten`;
+RESTORE TABLE `t+1` FROM '../tmp';
+SELECT * FROM `t+1`;
+DROP TABLE `t+1`;