summaryrefslogtreecommitdiff
path: root/mysql-test/r/create.result
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-09-04 12:21:54 +0530
committerSatya B <satya.bn@sun.com>2009-09-04 12:21:54 +0530
commiteebffb422b515f6b8a32401679fb202f531a58e3 (patch)
tree6d3c909b8163402199ee3247c59f546ffb18af59 /mysql-test/r/create.result
parent81053daf9731145a84827ca0ce58b0097518ccf0 (diff)
downloadmariadb-git-eebffb422b515f6b8a32401679fb202f531a58e3.tar.gz
Fix for BUG#46384 - mysqld segfault when trying to create table with same
name as existing view When trying to create a table with the same name as existing view with join, mysql server crashes. The problem is when create table is issued with the same name as view, while verifying with the existing tables, we assume that base table object is created always. In this case, since it is a view over multiple tables, we don't have the mysql derived table object. Fixed the logic which checks if there is an existing table to not to assume that table object is created when the base table is view over multiple tables.
Diffstat (limited to 'mysql-test/r/create.result')
-rw-r--r--mysql-test/r/create.result13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index d37c1a04daa..dfd376a6bde 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1559,4 +1559,17 @@ CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
DROP TABLE t1, t2;
+#
+# BUG#46384 - mysqld segfault when trying to create table with same
+# name as existing view
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+INSERT INTO t2 VALUES (1),(2),(3);
+CREATE VIEW v1 AS SELECT t1.a FROM t1, t2;
+CREATE TABLE v1 AS SELECT * FROM t1;
+ERROR 42S01: Table 'v1' already exists
+DROP VIEW v1;
+DROP TABLE t1,t2;
End of 5.0 tests