Bug #3130 apparent pread problem in Darwin-x86
Submitted: 10 Mar 2004 12:25 Modified: 11 Apr 2004 14:51
Reporter: Don Whiteside Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.18 OS:Darwin-6.6-on-X86
Assigned to: Assigned Account CPU Architecture:Any

[10 Mar 2004 12:25] Don Whiteside
If configure is run and detected settings used make will succeed and mysql_install_db will work (apparently) but subsequent attempts to start mysqld will terminate when trying to read the host.frm file. Examining the trace file shows that this line in mysys/my_pread.c:

    error=((readbytes = (uint) pread(Filedes, Buffer, Count, offset)) != Count);

will always return -1 and return (the seemingly incorrect) error 27 indicating a filesystem full/quota issue. (a little odd for a READ operation :)

How to repeat:
Install OpenDarwin on an x86 system and compile the source distro, do install and attempt to do initial installation steps; databases seem to create but mysqld will not load the permissions table.

Suggested fix:
If I comment out this line in config.h before compiling:

#define HAVE_PREAD 1

the compiled binaries will function.

I tried adding -DHAVE_BROKEN_PREAD to CXXFlags but that didn't seem to resolve the issue - perhaps I don't understand the flag's function correctly.
[11 Mar 2004 14:51] Michael Widenius
From the problem description it sounds that there is some unknown problem with pread() on your systems. As I don't have access to a Darwing 6.6 (our Mac OS X is 6.8) I can't find out what could be the problem.

In theory having -DHAVE_BROKEN_PREAD in both CFLAGS and CXXFLAGS should solve this problem.  This will just undef HAVE_PREAD and HAVE_PWRITE for the compilation:

In include/my_global.h:

#ifdef HAVE_BROKEN_PREAD	/* These doesn't work on HPUX 11.x */

Hope the above is enough for you to resolve your issue until you can upgrade to 6.8
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".