diff options
-rw-r--r-- | mysql-test/r/repair.result | 7 | ||||
-rw-r--r-- | mysql-test/t/repair.test | 9 | ||||
-rw-r--r-- | sql/sql_admin.cc | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 52ae9c38792..51c3374602d 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -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; diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 337b73f37d1..f625965090a 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -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; diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 44057b6220e..9827c67065c 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -901,7 +901,7 @@ send_result_message: break; } } - if (table->table) + if (table->table && !table->view) { if (table->table->s->tmp_table) { |