When calling RAND() in a subquery and filtering on it in the outer query, it appears that a random number is being generated twice, with both values checked against the WHERE clause. This issue sounds similar to
MDEV-5414, but that issue is marked as fixed in 10.0.8. MySQL (or at least recent versions of it) does not appear to exhibit this problem.
This query should return 10 on average, but instead returns 1 on average.
One workaround is to add a LIMIT clause to the inner query. The following code returns an average of 10 as expected: