Fix predicted first rand() call
sql/sql_class.cc: Fix Random hash initialization on for new connections to make result it more random
This commit is contained in:
parent
2d9a417d56
commit
9753cea1aa
@ -156,7 +156,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&LOCK_thread_count);
|
pthread_mutex_lock(&LOCK_thread_count);
|
||||||
ulong tmp=(ulong) (rnd(&sql_rand) * 3000000);
|
ulong tmp=(ulong) (rnd(&sql_rand) * 0xffffffff); /* make all bits random */
|
||||||
pthread_mutex_unlock(&LOCK_thread_count);
|
pthread_mutex_unlock(&LOCK_thread_count);
|
||||||
randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
|
randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user