diff options
author | unknown <evgen@moonbone.local> | 2006-10-13 21:59:52 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-10-13 21:59:52 +0400 |
commit | 67770b7671652ee4fe89c82ffbe77a3a1c08ed78 (patch) | |
tree | 7bd36ea523de49e01ecb5afa66beded74a185380 /mysql-test/r/rename.result | |
parent | b6248f76ed201d524ccc9b33cae2d961a0724c5e (diff) | |
download | mariadb-git-67770b7671652ee4fe89c82ffbe77a3a1c08ed78.tar.gz |
Bug#14959: ALTER TABLE isn't able to rename a view
The mysql_alter_table() was able to rename only a table.
The view/table renaming code is moved from the function rename_tables
to the new function called do_rename().
The mysql_alter_table() function calls it when it needs to rename a view.
mysql-test/t/rename.test:
Added a test case for bug#14959: ALTER TABLE isn't able to rename a view
mysql-test/r/rename.result:
Added a test case for bug#14959: ALTER TABLE isn't able to rename a view
sql/mysql_priv.h:
Bug#14959: ALTER TABLE isn't able to rename a view
Added the prototype of the do_rename() function.
sql/sql_rename.cc:
Bug#14959: ALTER TABLE isn't able to rename a view
The view/table renaming code is moved from the function rename_tables
to the new function called do_rename().
sql/sql_table.cc:
Bug#14959: ALTER TABLE isn't able to rename a view
Added handling of a view rename to the mysql_alter_table() function.
Diffstat (limited to 'mysql-test/r/rename.result')
-rw-r--r-- | mysql-test/r/rename.result | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result index 76c0f4422fe..345270231ef 100644 --- a/mysql-test/r/rename.result +++ b/mysql-test/r/rename.result @@ -54,3 +54,13 @@ Tables_in_test t2 t4 drop table t2, t4; +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 +drop view v1; +drop table t1; |