summaryrefslogtreecommitdiff
path: root/mysql-test/t/rename.test
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/t/rename.test
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/t/rename.test')
-rw-r--r--mysql-test/t/rename.test14
1 files changed, 6 insertions, 8 deletions
diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test
index 5aa1a51a90f..bb90cbafd74 100644
--- a/mysql-test/t/rename.test
+++ b/mysql-test/t/rename.test
@@ -79,17 +79,15 @@ connection default;
--echo End of 4.1 tests
-#
-# Bug#14959: ALTER TABLE isn't able to rename a view
-#
+--echo #
+--echo # Bug#14959: "ALTER TABLE isn't able to rename a view"
+--echo # Bug#53976: "ALTER TABLE RENAME is allowed on views
+--echo # (not documented, broken)"
+--echo #
create table t1(f1 int);
create view v1 as select * from t1;
+--error ER_WRONG_OBJECT
alter table v1 rename to v2;
---error ER_NO_SUCH_TABLE
-alter table v1 rename to v2;
-rename table v2 to v1;
---error ER_TABLE_EXISTS_ERROR
-rename table v2 to v1;
drop view v1;
drop table t1;