Bug #29640 Function log2() is not available on many Unix dialects or older versions
Submitted: 9 Jul 2007 9:02 Modified: 26 Oct 2007 2:24
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.2.4 OS:Other (Solaris 8/9, FreeBSD 6)
Assigned to: Antony Curtis CPU Architecture:Any

[9 Jul 2007 9:02] Kent Boortz
Description:
Compile fail as the function log2() is assumed to be available.
It is referenced from "sql/handler.cc".

How to repeat:
Compile on one of the listed operating systems.

Suggested fix:
Don't know if the calculation could be expressed in another way,
but if log2() is really needed, there is an definition of log2()
in "uniques.cc"

      inline double log2_n_fact(double x){return (log(2*M_PI*x)/2 + x*log(x/M_E)) / M_LN2;}

Maybe the function should be moved to "mysys/" and there be a
configure test that test if the native log2() is available?
[2 Aug 2007 21:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32039

ChangeSet@1.2566, 2007-08-02 14:48:21-07:00, antony@pcg5ppc.xiphis.org +2 -0
  bug#29640
    "log2() is not available on many Unix dialects or older versions"
    Add check for existance of log2() function after checking for
    existance of libm.
    Declare a macro which approximates log2() if it does not exist.
    Tested on FreeBSD 6.2 which does not have a log2() implementation.
[2 Oct 2007 5:52] Ingo Strüwing
Ok to push.
[3 Oct 2007 22:36] Antony Curtis
queued on mysql-5.1-engines tree
[26 Oct 2007 0:33] Antony Curtis
Pushed into 6.0.4 tree
[26 Oct 2007 2:24] Paul DuBois
Noted in 6.0.4 changelog.

Compilation failed on systems where a native log2() implementation
was unavailable.