Description:
feature request: it would be useful to be able to see the structure of m1, even though it is unusable due to incorrect definition:
mysql> create table t1(id int)engine=myisam;
Query OK, 0 rows affected (0.01 sec)
mysql> create table m1(id bigint)engine=merge union=(t1);
Query OK, 0 rows affected (0.05 sec)
mysql> show create table m1;
ERROR 1168 (HY000): Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
rational: you can see a view's structure even if the view is unusable due
to missing tables:
flush tables;
drop table if exists m1,t1;
create table t1(id int)engine=myisam;
create or replace view v1 as select * from t1;
show create view v1;
drop table if exists t1;
show create view v1;
How to repeat:
flush tables;
drop table if exists m1,t1;
create table t1(id int)engine=myisam;
create table m1(id bigint)engine=merge union=(t1);
show create table m1;
Suggested fix:
make the behaviour consistent with faulty view handling. print the structure, and a warning if the merge table is really faulty.
as a workaround, just recreate the merge table;
drop table m1;
create table m1 like t1;
alter table m1 engine=merge union=(t1);
check table m1;