Bug #53587 what are the semantics of the rand function
| Submitted: | 11 May 2010 22:57 | Modified: | 17 Aug 2016 14:51 |
|---|---|---|---|
| Reporter: | Mark Callaghan | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
| Version: | 5.0,5.1 | OS: | Any |
| Assigned to: | Paul DuBois | CPU Architecture: | Any |
| Tags: | by, FUNCTION, GROUP, rand, UPDATE | ||
[11 May 2010 22:57]
Mark Callaghan
[12 May 2010 3:51]
Valeriy Kravchuk
Behavior of rand() in WHERE clause is documented on that page: "RAND() in a WHERE clause is re-evaluated every time the WHERE is executed." But I agree that manual should describe RAND() behavior in more details, including GROUP BY clause and even potential deadlocks, as you had correctly pointed out.
[12 May 2010 4:14]
Mark Callaghan
For the update case I don't know how it can be correct to evaluate rand() more than once per row.
[17 May 2010 23:51]
Donna Harmon
Verified on 5.1.46 the group by problem with test provided
[15 Feb 2016 23:04]
Paul DuBois
Added a note to the RAND() description that the ORDER BY problem can also occur for GROUP BY.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.062 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.