Fix for bug #30679: 5.1 name encoding not performed for views during upgrade

Problem: we skip views perfoming --fix-table-names.

Fix: rename views as well.
This commit is contained in:
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru 2007-10-24 22:36:57 +05:00
parent 5a42bb96f8
commit bb79b4662f
3 changed files with 36 additions and 2 deletions

View File

@ -533,8 +533,11 @@ static int process_all_tables_in_db(char *database)
else
{
while ((row = mysql_fetch_row(res)))
/* Skip tables with an engine of NULL (probably a view). */
if (row[1])
/*
Skip tables with an engine of NULL (probably a view)
if we don't perform renaming.
*/
if (row[1] || what_to_do == DO_UPGRADE)
{
handle_request_for_tables(row[0], strlen(row[0]));
}

View File

@ -58,3 +58,21 @@ test.t1 OK
drop view v1;
drop table t1;
End of 5.0 tests
create table t1(a int);
create view v1 as select * from t1;
show tables;
Tables_in_test
t1
v1
show tables;
Tables_in_test
t1
#mysql50#v-1
v1
show tables;
Tables_in_test
t1
v1
v-1
drop view v1, `v-1`;
drop table t1;

View File

@ -38,3 +38,16 @@ drop view v1;
drop table t1;
--echo End of 5.0 tests
#
# Bug #30679: 5.1 name encoding not performed for views during upgrade
#
create table t1(a int);
create view v1 as select * from t1;
show tables;
--copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm
show tables;
--exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test
show tables;
drop view v1, `v-1`;
drop table t1;