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;
|
fSeed1 += 23;
|
||||||
|
|
||||||
fSeed2 = (fSeed1 + fSeed2 + 33) % maxValue;
|
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);
|
return (((double) fSeed1) / (double)maxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ namespace funcexp
|
|||||||
class Func_rand : public Func
|
class Func_rand : public Func
|
||||||
{
|
{
|
||||||
public:
|
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() {}
|
virtual ~Func_rand() {}
|
||||||
|
|
||||||
double getRand();
|
double getRand();
|
||||||
@ -46,8 +46,8 @@ public:
|
|||||||
{
|
{
|
||||||
fSeedSet = seedSet;
|
fSeedSet = seedSet;
|
||||||
fMultipleSeedsSet = seedSet;
|
fMultipleSeedsSet = seedSet;
|
||||||
fFirstRow = nullptr;
|
fFirstRow = NULL;
|
||||||
fSeeds = {};
|
fSeeds.clear();
|
||||||
}
|
}
|
||||||
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
|
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user