Bug #41762 MyISAM Symlink Tables does not seem to work on MySQL 5.1
Submitted: 27 Dec 2008 17:14 Modified: 29 Dec 2008 7:42
Reporter: Eric Ang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:5.1.30 OS:Any
Assigned to: CPU Architecture:Any

[27 Dec 2008 17:14] Eric Ang
Description:
Symlink tables does not seem to work anymore on version 5.1
ERROR 1030 (HY000): Got error 140 from storage engine

How to repeat:
mysql> create table A (A varchar(10) primary key, B text);
mysql> create table B like A;

Symlink Table B to Table A manually
ln -sf A.MYD B.MYD
ln -sf A.MYI B.MYI

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

mysql> select * from B;
ERROR 1030 (HY000): Got error 140 from storage engine
[29 Dec 2008 7:42] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read http://dev.mysql.com/doc/refman/5.1/en/news-5-1-28.html:

# Important Change: Security Fix: Additional corrections were made for the symlink-related privilege problem originally addressed in MySQL 5.1.24. The original fix did not correctly handle the data directory pathname if it contained symlinked directories in its path, and the check was made only at table-creation time, not at table-opening time later. (Bug#32167, CVE-2008-2079)

See also Bug#39277.