Bug #332 4.1.0-alpha Win32 Symlinks Do Not Work
Submitted: 26 Apr 2003 9:56 Modified: 27 Apr 2003 10:53
Reporter: abombss Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.0-alpha OS:Windows (Win32)
Assigned to: Mark Matthews CPU Architecture:Any

[26 Apr 2003 9:56] abombss
Description:
Upgraded to 4.1.0 Alpha from MySQL 4.0 and no symlinks are working.  "show databases" returns a list of all databases including those with symlinks.  Trying to change to a symlink database produces "ERROR 1049: Unknown database 'symLinkDb'".

I have verified that mysqld is using symlinks.  

I have tried running the server both with use-symbolic-link and without.  Neither works properly.

How to repeat:
Install MySQL 4.1.0 Alpha on Win32 (C:\mysql)

Create a new directory for a new database on another drive
(D:\data\symLinkDb)

Create a text file containing the full path to the new folder and save it as C:\mysql\data\symLinkDb

Log into the mysql server and change to database \u symLinkDb.

Error 1049 should be displayed.

Suggested fix:
Temporary Fix:
Since symlinks will not work if you want to access this data you must create a temporary database local to the mysql root data dir.  Copy all the database files (*.MYI,*MYD, *.frm) to the new temporary database.

Log into mysql change databases to the new temp db.  Run a show tables to verify all the tables exist, run a couple of test queries and maybe an myisamchk.

I don't know where or how to fix this in the actual code.
[26 Apr 2003 11:30] MySQL Verification Team
Thanks for the bug report.

Some explanations:

the symbolic links was introduced on Windows only for
the servers with the prefix "max" and the debug version,
so I assume you are using either mysqld-nt.exe or
mysqld-opt.exe.

With some changes introduced in the code, those
servers begin to show the symbolic link as enabled
with the mysys library didn't supporting this
option. This is the "actual bug".

Suggestion Fix:
Enable the USE_SYMDIR for the mysys.dsp project file
for the configuration build: mysys - Win32 Release
or to introduce that on config-win.h and removing
it from the pre-processor definitons of project
files.
[26 Apr 2003 11:43] abombss
Thanks for the info.  In following the readme instructions word for word when I upgraded I used the mysqld-nt.exe binary.  Changing to the mysqld-max-nt.exe binary works perfectly.

Note: When running the mysqld-nt.exe binary the version reported from "show variables" was "4.1.0-alpha-max-nt-log" even though it was not the MAX version.  Running the mysqld-max-nt.exe also returns "4.1.0-alpha-max-nt-log" as the version.
[26 Apr 2003 17:00] MySQL Verification Team
Your last note:
**********************************************************
When running the mysqld-nt.exe binary the version reported
from "show variables" was "4.1.0-alpha-max-nt-log" even
though it was not the MAX version.
**********************************************************
Also it is collateral "bug" from Max stuff modifications:
the prefix binary server is made up according with the
engine tables defined  in the compilation. Currently the
InnoDB table makes part of the all binaries servers.

Suggested Fix:

*** d:\mysql-dev\mysql-4.1\sql\mysqld.cc	Sat Apr 26 14:34:36 2003
--- c:\fix\mysqld.cc	Sat Apr 26 20:47:58 2003
***************
*** 205,216 ****
  #ifdef __WIN__
  #undef MYSQL_SERVER_SUFFIX
  #ifdef __NT__
! #if defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB)
  #define MYSQL_SERVER_SUFFIX "-max-nt"
  #else
  #define MYSQL_SERVER_SUFFIX "-nt"
  #endif /* ...DB */
! #elif defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB)
  #define MYSQL_SERVER_SUFFIX "-max"
  #else
  #define MYSQL_SERVER_SUFFIX ""
--- 205,216 ----
  #ifdef __WIN__
  #undef MYSQL_SERVER_SUFFIX
  #ifdef __NT__
! #if defined(HAVE_BERKELEY_DB)
  #define MYSQL_SERVER_SUFFIX "-max-nt"
  #else
  #define MYSQL_SERVER_SUFFIX "-nt"
  #endif /* ...DB */
! #elif defined(HAVE_BERKELEY_DB)
  #define MYSQL_SERVER_SUFFIX "-max"
  #else
  #define MYSQL_SERVER_SUFFIX ""
[27 Apr 2003 10:53] Michael Widenius
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

A last note about this.

We accidently broke symlink handling on windows in a late 4.0 release and this also affected the 4.1 release tree.

4.1.1 will use the new symlink code from 4.0 so this problems should then definitely disappear.