Bug #817 Order by RAND() .... not really random
Submitted: 9 Jul 2003 1:35 Modified: 9 Jul 2003 9:13
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:3.23.55 OS:Windows (windows 2000 server)
Assigned to: CPU Architecture:Any

[9 Jul 2003 1:35] [ name withheld ]
I found a problem with a string like this:

"SELECT * FROM sings.dance WHERE singer='pippo' ORDER BY RAND() LIMIT 1;"

Infact every first time i launch this command, the result is the same, everytime.

How to repeat:
I explain it:

1) launch mysql from prompt dos
2) type sql string
3) view the results
4) close mysql
5) reopen mysql from prompt dos
6) retype sql string 
7) view the result, that is the same

If i type "SELECT FROM sings.dance ORDER BY RAND() LIMIT 1;" this show different results.

Thanx and good work.
[9 Jul 2003 9:13] Paul DuBois
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
[9 Jul 2003 9:14] Paul DuBois
RAND() initialization was one of the problems addressed in 3.23.56.
You are using 3.23.55, so this problem should now be fixed.

[29 Jul 2005 10:09] b b

 Got the same problem, RAND() allways shows the same thing: but the machine is running Win2000. MySql: Ver 14.7 Distrib 4.1.10a, for Win95/Win98 (i32)

 Any ideas? 

[29 Jul 2005 10:35] b b

 Just restarted Sql service and it works... :)