• unknown's avatar
    backporting Peter's fix for better RAND() initialization from 4.0 · 02132f55
    unknown authored
    
    sql/sql_class.cc:
      backporting Peter's fix for better RAND() initialization from 4.0
      to see what it does try
      perl -e 'while($N=shift) { printf "N=%-10d",$N; @b=@c=(); for (1..$N) { @A=split(" ",`mysql -BNe "select rand(), rand(), rand(), rand()"`); for(0..3) { $b[$_]+=$a[$_]; $c[$_]+=$a[$_]*$a[$_]; }} for (0..3) { printf "%15.14f ",($c[$_]-$b[$_]*$b[$_]/$N)/$N } print "\n" }' 10 10 10 100 100 10 100 1000
      before and after the fix
    02132f55
sql_class.cc 17 KB