1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-3760 Related. Fix bug3145 regression broken on rand()

This commit is contained in:
Jose Rojas
2020-03-10 03:01:05 +00:00
committed by jmrojas2332
parent 9db6e84ea2
commit 13716677d7
2 changed files with 12 additions and 4 deletions

View File

@ -53,7 +53,15 @@ double Func_rand::getRand()
fSeed1 += 23;
fSeed2 = (fSeed1 + fSeed2 + 33) % maxValue;
fSeeds[fSeedIndex] = std::make_pair(fSeed1, fSeed2);
if (fSeeds.size() > fSeedIndex)
{
fSeeds[fSeedIndex] = std::make_pair(fSeed1, fSeed2);
}
else
{
fSeeds.push_back(std::make_pair(fSeed1, fSeed2));
}
return (((double) fSeed1) / (double)maxValue);
}