summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2005-09-12 17:01:17 +0300
committerunknown <timour@mysql.com>2005-09-12 17:01:17 +0300
commitfa47a0e01f5324e522ceef075f010c62aab68ab3 (patch)
treee24256811228bef5c6b8b39a13df7f44fdade1ad /mysql-test/t/view.test
parent65a02a4de4c6f3a8f53f0d2131b28530fafe618e (diff)
downloadmariadb-git-fa47a0e01f5324e522ceef075f010c62aab68ab3.tar.gz
Fix for BUG#6808.
The problem was in that add_table_to_list was testing for duplicate tables in a list of tables that included the created view. mysql-test/r/view.result: Test for BUG#6808 mysql-test/t/view.test: Test for BUG#6808 sql/sql_parse.cc: When testing for table name uniquness, skip the first table the current statement is CREATE VIEW. Notice that the first table is skipped differently for CREATE TABLE ... SELECT ... statements, so we don't have to handle that case here (see production 'create_select', the call 'to save_and_clear').
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test13
1 files changed, 11 insertions, 2 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 7cca98391a8..33b77d80020 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1083,11 +1083,11 @@ create view v1 as select * from t1;
create view v2 as select * from v1;
-- error 1146
alter view v1 as select * from v2;
--- error 1066
+-- error 1146
alter view v1 as select * from v1;
-- error 1146
create or replace view v1 as select * from v2;
--- error 1066
+-- error 1146
create or replace view v1 as select * from v1;
drop view v2,v1;
drop table t1;
@@ -2059,3 +2059,12 @@ order by users_names;
drop view v1, v2;
drop table t1, t2;
+
+#
+# Bug #6808 - Views: CREATE VIEW v ... FROM t AS v fails
+#
+
+create table t1 (s1 int);
+create view abc as select * from t1 as abc;
+drop table t1;
+drop view abc;