Skip to content

Commit

Permalink
MDEV-8115 mysql_upgrade crashes the server with REPAIR VIEW
Browse files Browse the repository at this point in the history
on REPAIR don't do table-specific stuff for views
(because even if the view has a temp table opened for it,
it's not opened all the way down the engine. In particular,
Aria crashes in maria_status() because MARIA_HA* info - that is
table->table->file->file - is NULL)
  • Loading branch information
vuvova committed May 7, 2015
1 parent 8350ea0 commit 0014bdc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mysql-test/r/repair.result
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,10 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 (a blob);
create view v1 as select * from t1;
repair view v1;
Table Op Msg_type Msg_text
test.v1 repair status OK
drop view v1;
drop table t1;
9 changes: 9 additions & 0 deletions mysql-test/t/repair.test
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,12 @@ repair table t1 use_frm;
select count(*) from t1;
check table t1;
drop table t1;

#
# MDEV-8115 mysql_upgrade crashes the server with REPAIR VIEW
#
create table t1 (a blob);
create view v1 as select * from t1;
repair view v1;
drop view v1;
drop table t1;
2 changes: 1 addition & 1 deletion sql/sql_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
break;
}
}
if (table->table)
if (table->table && !table->view)
{
if (table->table->s->tmp_table)
{
Expand Down

0 comments on commit 0014bdc

Please sign in to comment.