summaryrefslogtreecommitdiff
path: root/mysql-test/r/rename.result
diff options
context:
space:
mode:
authorDmitry Lenev <dlenev@mysql.com>2010-05-28 09:25:11 +0400
committerDmitry Lenev <dlenev@mysql.com>2010-05-28 09:25:11 +0400
commita81da06f5764c97d9cd20c0c4091b58bc5cd8e95 (patch)
treed0e33df4f5e96e3d70da6800c01809e25edd9999 /mysql-test/r/rename.result
parentd108c80ee74ff843bf696a2cc2504bbb946d8cb6 (diff)
downloadmariadb-git-a81da06f5764c97d9cd20c0c4091b58bc5cd8e95.tar.gz
Patch that addresses bug #53976 "ALTER TABLE RENAME
is allowed on views (not documented, broken)". Remove support of ALTER TABLE RENAME for views as: a) this feature was not documented, c) does not add any compatibility with other databases, b) its implementation doesn't follow metadata locking protocol by accessing .FRM without holding any metadata lock, c) its implementation complicates ALTER TABLE's code by introducing yet another separate branch to it. After this patch one can rename a view by using the documented way - RENAME TABLE statement. mysql-test/r/rename.result: Adjusted existing test case for bug #14959 "ALTER TABLE isn't able to rename a view" after fixing bug #53976: "ALTER TABLE RENAME is allowed on views (not documented, broken)". mysql-test/r/view.result: Adjusted test case after removing support for renaming of views through ALTER TABLE ... RENAME. mysql-test/t/rename.test: Adjusted existing test case for bug #14959 "ALTER TABLE isn't able to rename a view" after fixing bug #53976: "ALTER TABLE RENAME is allowed on views (not documented, broken)". mysql-test/t/view.test: Adjusted test case after removing support for renaming of views through ALTER TABLE ... RENAME. sql/sql_table.cc: Removed support for ALTER TABLE ... RENAME for views. This feature was not properly documented and its implementation was not following metadata locking protocol.
Diffstat (limited to 'mysql-test/r/rename.result')
-rw-r--r--mysql-test/r/rename.result11
1 files changed, 6 insertions, 5 deletions
diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result
index 1257a668cce..edf05d0c5d3 100644
--- a/mysql-test/r/rename.result
+++ b/mysql-test/r/rename.result
@@ -55,14 +55,15 @@ t2
t4
drop table t2, t4;
End of 4.1 tests
+#
+# Bug#14959: "ALTER TABLE isn't able to rename a view"
+# Bug#53976: "ALTER TABLE RENAME is allowed on views
+# (not documented, broken)"
+#
create table t1(f1 int);
create view v1 as select * from t1;
alter table v1 rename to v2;
-alter table v1 rename to v2;
-ERROR 42S02: Table 'test.v1' doesn't exist
-rename table v2 to v1;
-rename table v2 to v1;
-ERROR 42S01: Table 'v1' already exists
+ERROR HY000: 'test.v1' is not BASE TABLE
drop view v1;
drop table t1;
End of 5.0 tests