mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -72,4 +72,17 @@ disconnect con2;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
||||
#
|
||||
# Bug#14959: ALTER TABLE isn't able to rename a view
|
||||
#
|
||||
create table t1(f1 int);
|
||||
create view v1 as select * from t1;
|
||||
alter table v1 rename to v2;
|
||||
--error 1146
|
||||
alter table v1 rename to v2;
|
||||
rename table v2 to v1;
|
||||
--error 1050
|
||||
rename table v2 to v1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
# End of 4.1 tests
|
||||
|
Reference in New Issue
Block a user