File tree 3 files changed +36
-2
lines changed
3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -557,8 +557,11 @@ static int process_all_tables_in_db(char *database)
557
557
else
558
558
{
559
559
while ((row = mysql_fetch_row (res )))
560
- /* Skip tables with an engine of NULL (probably a view). */
561
- if (row [1 ])
560
+ /*
561
+ Skip tables with an engine of NULL (probably a view)
562
+ if we don't perform renaming.
563
+ */
564
+ if (row [1 ] || what_to_do == DO_UPGRADE )
562
565
{
563
566
handle_request_for_tables (row [0 ], fixed_name_length (row [0 ]));
564
567
}
Original file line number Diff line number Diff line change @@ -63,3 +63,21 @@ test.t 1 OK
63
63
test.t`1 OK
64
64
drop table `t``1`, `t 1`;
65
65
End of 5.0 tests
66
+ create table t1(a int);
67
+ create view v1 as select * from t1;
68
+ show tables;
69
+ Tables_in_test
70
+ t1
71
+ v1
72
+ show tables;
73
+ Tables_in_test
74
+ t1
75
+ #mysql50#v-1
76
+ v1
77
+ show tables;
78
+ Tables_in_test
79
+ t1
80
+ v1
81
+ v-1
82
+ drop view v1, `v-1`;
83
+ drop table t1;
Original file line number Diff line number Diff line change @@ -47,3 +47,16 @@ create table `t 1`(a int);
47
47
drop table `t``1`, `t 1`;
48
48
49
49
--echo End of 5.0 tests
50
+
51
+ #
52
+ # Bug #30679: 5.1 name encoding not performed for views during upgrade
53
+ #
54
+ create table t1(a int);
55
+ create view v1 as select * from t1;
56
+ show tables;
57
+ --copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm
58
+ show tables;
59
+ --exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test
60
+ show tables;
61
+ drop view v1, `v-1`;
62
+ drop table t1;
You can’t perform that action at this time.
0 commit comments