Bug #10687 MERGE Engine fails on Windows
Submitted: 17 May 2005 12:34 Modified: 25 May 2005 23:13
Reporter: Geert Vanderkelen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.12 OS:Microsoft Windows (Windows)
Assigned to: Reggie Burnett CPU Architecture:Any

[17 May 2005 12:34] Geert Vanderkelen
Description:
Hi,

MERGE table under Windows gives errno 2:

ERROR 1017 (HY000): Can't find file: 'mm.MRG' (errno: 2)

Tested with same release under Linux works fine.
Reported to work find under Windows using 4.1.11

Regards,

Geert

How to repeat:

create table t1 ( id int );
create table t2 ( id int );

create table mm ( id int ) engine=merge union=(t1,t2);

select count(*) from mm;

Suggested fix:

Not a fix but..

In 4.1.11 the content of MRG file is something like this:
C:\mysql\data\test/t1

In 4.1.12 it changes to:
./test/m1

Editing the MRG file with an editor to the previous c:\ format, make the MERGE table accessible again.
[17 May 2005 19:32] Geert Vanderkelen
Apparently the '/' is not working under Windows, where it was thought it would. Following ChangeSet from 28 April:

ChangeSet 1.2200.4.1 2005/04/28 18:28:50 ingo@mysql.com
  BUG#5964 - 4.1 MERGE tables regression from 4.0
  Changed the creation of the .MRG file so that only the table  name
  is written when the MyISAM table is in the same database as the
  MERGE table, a relative path is used in other cases in mysqld,
  and possibly an absolute path is used in an embedded server.
  No test case is added as the external behaviour is unchanged.
  Only the file names within the .MRG file are changed.
sql/ha_myisammrg.cc 1.54 2005/04/28 18:28:44 ingo@mysql.com
  BUG#5964 - 4.1 MERGE tables regression from 4.0
  Changed the creation of the .MRG file so that only the table  name
  is written when the MyISAM table is in the same database as the
  MERGE table, a relative path is used in other cases in mysqld,
  and possibly an absolute path is used in an embedded server.

Hope this helps!

Regards,

Geert
[23 May 2005 16:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25181
[23 May 2005 16:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25183
[23 May 2005 17:25] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25185
[23 May 2005 17:30] Reggie Burnett
This is fixed in 4.1.13 and 5.0.7
[24 May 2005 12:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25211
[24 May 2005 20:05] Paul Dubois
Note in 4.1.13, 5.0.7 changelogs.
[25 May 2005 16:56] Lenz Grimmer
Setting it back to "Analyzing", as there are still cases in which the bug can be reproduced.
[25 May 2005 21:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25279
[25 May 2005 21:43] Jim Winstead
Fixed in 4.1.12a and 5.0.6.
[25 May 2005 23:13] Paul Dubois
Moved change notes to 4.1.12, 5.0.6 sections.
(In 4.1.12 section, added a note that it applies
to 4.1.12a.)