Bug #17220 table created with merge eng and non MyISAM table has bad error message
Submitted: 8 Feb 2006 2:25 Modified: 18 May 2006 11:00
Reporter: Jonathan Miller Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.7 OS:Linux (Linux 32 Bit OS)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[8 Feb 2006 2:25] Jonathan Miller
Description:
When default engine is set to NDB the test case listed below returns:

Errors are (from /home/ndbdev/jmiller/clones/mysql-5.1-new/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 9: query 'SHOW CREATE TABLE t3' failed: 1017: Can't find file: 't3' (errno: 2)(the last lines may be the most important ones)

But if you just show tables, it shows to exist:
+ create table t1 (a int);
+ insert into t1 values (10);
+ create table t3 (a int) engine=merge union(t1);
+ show warnings;
+ Level Code    Message
+ show tables;
+ Tables_in_test
+ t1
+ t3

How to repeat:
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (a int);
create table t3 (a int) engine=merge union(t1);
show warnings;
show tables;
SHOW CREATE TABLE t3;
DROP TABLE t3;
DROP TABLE t1;
[8 Feb 2006 9:17] Tomas Ulin
reading the manual states that merge engine is for myisam tables only

so either leave as is and/or document more and/or print error message if you try to do a merge table based on other engines than myisam
[24 Apr 2006 6:56] Tomas Ulin
same happens for innodb:

master> create table t1 (a int) engine=innodb;
Query OK, 0 rows affected (0.01 sec)

master> create table t3 (a int) engine=merge union(t1);
Query OK, 0 rows affected (0.00 sec)

master> SHOW CREATE TABLE t3;
ERROR 1017 (HY000): Can't find file: 't3' (errno: 2)
[18 May 2006 11:00] Ramil Kalimullin
From the documentation
(http://dev.mysql.com/doc/refman/5.1/en/merge-table-problems.html):

 If you encounter an error message similar to ERROR 1017 (HY000): Can't find file: 'mm.MRG' (errno: 2) it generally indicates that some of the base tables are not using the MyISAM storage engine. Confirm that all tables are MyISAM.