summaryrefslogtreecommitdiff
path: root/mysql-test/t/create.test
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2010-05-05 12:17:07 +0200
committerMagne Mahre <magne.mahre@sun.com>2010-05-05 12:17:07 +0200
commitde493d92b2dcc8f1d1f39d5729675fef5571aabe (patch)
treed38f3ba61157ed0601cdd3c4db58d680e14b2169 /mysql-test/t/create.test
parenta03ce03977f7a0b75aef335637c9f606aecf5954 (diff)
downloadmariadb-git-de493d92b2dcc8f1d1f39d5729675fef5571aabe.tar.gz
Bug#48800 CREATE TABLE t...SELECT fails if t is a temporary
table If a temporary table A exists, and a (permanent) table with the same name is attempted created with "CREATE TABLE ... AS SELECT", the create would fail with an error. 1050: Table 'A' already exists The error occured in MySQL 5.1 releases, but is not present in MySQL 5.5. This patch adds a regression test to ensure that the problem does not reoccur.
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r--mysql-test/t/create.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index e0a6fde1381..2e205d47c5d 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1668,3 +1668,25 @@ CREATE TABLE t1 LIKE t2;
DROP TABLE t2;
DROP TABLE t1;
+
+--echo #
+--echo # Bug #48800 CREATE TABLE t...SELECT fails if t is a
+--echo # temporary table
+--echo #
+
+CREATE TEMPORARY TABLE t1 (a INT);
+CREATE TABLE t1 (a INT);
+
+CREATE TEMPORARY TABLE t2 (a INT);
+CREATE VIEW t2 AS SELECT 1;
+
+CREATE TABLE t3 (a INT);
+CREATE TEMPORARY TABLE t3 SELECT 1;
+
+CREATE TEMPORARY TABLE t4 (a INT);
+CREATE TABLE t4 AS SELECT 1;
+
+DROP TEMPORARY TABLE t1, t2, t3, t4;
+DROP TABLE t1, t3, t4;
+DROP VIEW t2;
+