Bug #11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack
Submitted: 12 Jul 2005 21:29 Modified: 19 Jun 2010 17:43
Reporter: Timothy Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:4.1.12, 5.0.XX, 5.1 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: v6

[12 Jul 2005 21:29] Timothy Smith
Description:

The server crashes when doing the following steps:

1)  start the server with --innodb_file_per_table

2)  create a file in the data directory called 'inno_moved.sym' with contents "e:/tmp/inno_moved_files"

3)  create directory e:/tmp/inno_moved_files

4)  mysql -e 'create table t (id int) engine=innodb' inno_moved

How to repeat:

See Description.  I tested this w/ the 4.1.12a-nt binary on Windows XP Home, data on a fat32 partition.

Suggested fix:

It would be great if InnoDB knew about the mysql hack for .sym files, so that the .ibd files could be moved around as needed.  But at least InnoDB should verify that the directory exists and throw a meaningful error message instead of crashing.
[21 Feb 2006 16:55] MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=17623 marked as duplicate
of this.
[22 Feb 2006 1:13] MySQL Verification Team
Added version 5.0.XX.
[6 Sep 2006 10:00] Heikki Tuuri
Changing the status to 'Won't fix' because this bug only arises from placing .sym files in the place of InnoDB tables. Users should use some native Windows symlink mechanism and not the MyISAM mechanism implemented by Monty.
[19 Jun 2007 7:49] MySQL Verification Team
I wrote to docs to ask them to mention this in the manual.
[27 Feb 2008 14:32] Domas Mituzas
I'm reopening the bug, because the crash happens in legit environment:

1. Database directory is using symlinks, not specific table files
2. Symlinks are feature of MySQL
3. InnoDB file-per-table is feature of MySQL/InnoDB
4. 2&3 together cause a crash/full stop of MySQL. 

So, either precaution has to be made at InnoDB level, SQL level, or .sym-links should be resolved.

Even if it is documented that "it is not supported", it should not be a way to crash the server, thats what SHUTDOWN privilege is for :-)

Now, the native Windows symlink support has issues:
1. Windows 2000 users must install resource kit, to be able to modify links themselves
2. 'fsutil' was included with Windows XP (and later)
3. The easy way to manage links on Windows / NTFS 5.0 involves 3rd party tool, 'Junction' 

Having the documented method working properly seems like a somewhat easier way to handle this situation. Well, in worst case, let it not crash - thats already serious bug.
[4 Mar 2008 15:57] Heikki Tuuri
Calvin,

please fix this Windows crash. You should probably use some Windows function to check that the directory is really a directory, and not a .sym file!

Regards,

Heikki
[19 May 2008 22:20] Calvin Sun
patch queued in local 5.1 repository.
[24 Jun 2008 21:26] Calvin Sun
Merged into 6.0.6-alpha, according to Tim. But the patch has not been pushed into 5.1 yet.
[24 Jul 2008 1:36] Paul DuBois
Noted in 6.0.6 changelog.

On Windows, moving an InnoDB .ibd file and then symlinking to it in
the database directory using a .sym file caused a server crash.

Setting report to Need Doc Info pending push of fix into 5.1.x.
[11 Mar 2009 21:07] Timothy Smith
Docs team,

This bug was fixed in 5.1.31, but wasn't updated here properly.  Sorry!  Please close it after documenting for 5.1.31.  This is not fixed in 5.0.

Thanks,

Tim
[12 Mar 2009 21:55] Paul DuBois
Noted in 5.1.31 changelog.
[5 May 2010 15:12] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 1:29] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[28 May 2010 6:02] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:30] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 6:58] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 15:37] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[17 Jun 2010 12:05] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:50] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:32] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)