Bug #42848 Wrong error message when MERGE exceeds file descriptor limits
Submitted: 13 Feb 2009 20:50 Modified: 14 Mar 2009 19:15
Reporter: Dean Ellis Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0.51 OS:Any
Assigned to: CPU Architecture:Any

[13 Feb 2009 20:50] Dean Ellis
Description:
When a MERGE UNION requires more file descriptors than the server has available, and the base, underlying tables have been accessed directly, accessing the MERGE produces a wrong error message.

How to repeat:
Set open_files_limit to something small, or in any case create a MERGE table with more tables in the UNION than available file descriptors.

CREATE TABLE t1 ( a INT PRIMARY KEY ) ENGINE=MyISAM;
...
CREATE TABLE m (a INT PRIMARY KEY ) ENGINE=MERGE UNION=(t1, ...);
INSERT INTO t1 VALUES (1);
FLUSH TABLES;
SELECT * FROM m;
SELECT * FROM t1;
SELECT * FROM m;

My test:

mysql> flush tables;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from m;
ERROR 29 (HY000): File './mtest/t555.MYD' not found (Errcode: 24)

mysql> select * from m;
ERROR 29 (HY000): File './mtest/t555.MYD' not found (Errcode: 24)

mysql> select * from t1;
Empty set (0.00 sec)

mysql> select * from m;
ERROR 1168 (HY000): Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist

Suggested fix:
n/a
[14 Feb 2009 19:15] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior.

Please try with current version 5.0.75 (or 5.0.67) and if problem still exists provide more details about your environment.
[15 Mar 2009 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".