Problems building and installing MySQL on Solaris 10

I'm putting this here in the hope that it will help someone else once it gets indexed by Google, as I certainly couldn't find anything helpful myself. I've been trying to build and install MySQL 4.0.20 on Solaris 10 x86. It was building OK, but when I did make install I got the following error:

Making install in extra
make: Fatal error: Don't know how to make target `../mysys/libmysys.a'
Current working directory /home1/tonic/infrastructure/bld/mysql-4.0.20/extra
*** Error code 1
make: Fatal error: Command failed for target `install-recursive'

The cause of the error was simple to fix but distinctly non-obvious to find. I was setting the INSTALL environment variable to point to the install-sh script that comes as part of mysql to do the install (the Solaris install is incompatible with the GNU one), and that was the cause of the problem - the install-sh that ships as part of MySQL won't actually install it. So much for testing! I grabbed and built a copy of the GNU install utility from here, used that and it then installed fine.

Unfortunately even once built and installed, MySQL fails its test suite - the 'union' test fails because the found_rows() SQL function returns a large negative integer instead of the correct positive integer number of rows. I'm pretty certain it is a unsigned/signed 32-bit integer overflow problem as the value returned is (-2^32) + <correct row count>, but tracking it down could be tricky - it's probably the result of some sort of disagreement between gcc and our compiler.

This is all supposed to 'just work', sigh.

Update

I've raised bugs for both of these:

  • Install issue: MySQL bugid 4694
  • found_rows() issue: MySQL bugid 4681

Further update

Turns out the found_rows() issue is actually a bug in the Forte compiler optimizer on x86 - it's calculating an incorrect value when doing mixed 32/64 bit unsigned arithmetic - sigh. I've put some workarounds in the MySQL bug database and raised a Sun bug - the bugid is 5077233 for those of you with SunSolve access.

Categories : Java, Solaris