Skip to content

Commit c41f8b6

Browse files
author
ramil/ram@ramil.myoffice.izhnet.ru
committed
Merge mysql.com:/home/ram/work/mysql-5.1-maint
into mysql.com:/home/ram/work/b30679/b30679.5.1
2 parents 030d1a1 + bb79b46 commit c41f8b6

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

client/mysqlcheck.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,11 @@ static int process_all_tables_in_db(char *database)
557557
else
558558
{
559559
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)
562565
{
563566
handle_request_for_tables(row[0], fixed_name_length(row[0]));
564567
}

mysql-test/r/mysqlcheck.result

+18
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,21 @@ test.t 1 OK
6363
test.t`1 OK
6464
drop table `t``1`, `t 1`;
6565
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;

mysql-test/t/mysqlcheck.test

+13
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,16 @@ create table `t 1`(a int);
4747
drop table `t``1`, `t 1`;
4848

4949
--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;

0 commit comments

Comments
 (0)