You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-3760 Related. Fix bug3145 regression broken on rand()
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace funcexp
|
||||
class Func_rand : public Func
|
||||
{
|
||||
public:
|
||||
Func_rand() : Func("rand"), fSeed1(0), fSeed2(0), fSeedSet(false), fMultipleSeedsSet(false), fFirstRow(nullptr), fSeeds(){}
|
||||
Func_rand() : Func("rand"), fSeed1(0), fSeed2(0), fSeedSet(false), fMultipleSeedsSet(false), fFirstRow(NULL), fSeeds(){}
|
||||
virtual ~Func_rand() {}
|
||||
|
||||
double getRand();
|
||||
@ -46,8 +46,8 @@ public:
|
||||
{
|
||||
fSeedSet = seedSet;
|
||||
fMultipleSeedsSet = seedSet;
|
||||
fFirstRow = nullptr;
|
||||
fSeeds = {};
|
||||
fFirstRow = NULL;
|
||||
fSeeds.clear();
|
||||
}
|
||||
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
|
||||
|
||||
|
Reference in New Issue
Block a user