realpath(3) is not thread-safe. As a result one thread in
mysqld can cause another to get "lost" in a directory other
than the top level directory of the DB. mysqld often gets
stuck with its current working directory in /var/tmp with
"vi.recover" as the only "valid" database. This causes the
server to believe that it has no other databases and become
useless until it is restarted.
realpath(3) is similarly broken on other platforms. MySQL
has a build option HAVE_BROKEN_REALPATH that works around
this problem. Building the port as follows is enough to
correct the problem.
This scenario is not easy to trigger. Log lived
transactions/threads, such as are present when using MySQL's
replication facilities, seem to be more susceptible to this
If USENET or Goole are searched, more examples of users
experincing this problem can be found.
over to maintainer