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

MCOL-3760 + Fix multiple rands in statement with or without ORDER BY

This commit is contained in:
jmrojas2332
2020-02-13 23:28:28 +00:00
parent 34a0183f21
commit 0057d5fad5
2 changed files with 51 additions and 1 deletions

View File

@ -26,6 +26,8 @@
#include "functor.h"
#include <utility>
#include <vector>
namespace funcexp
{
@ -36,13 +38,15 @@ namespace funcexp
class Func_rand : public Func
{
public:
Func_rand() : Func("rand"), fSeed1(0), fSeed2(0), fSeedSet(false) {}
Func_rand() : Func("rand"), fSeed1(0), fSeed2(0), fSeedSet(false), fMultipleSeedsSet(false), fFirstRow(nullptr){}
virtual ~Func_rand() {}
double getRand();
void seedSet(bool seedSet)
{
fSeedSet = seedSet;
fMultipleSeedsSet = seedSet;
fFirstRow = nullptr;
}
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
@ -79,6 +83,10 @@ private:
uint64_t fSeed1;
uint64_t fSeed2;
bool fSeedSet;
bool fMultipleSeedsSet;
uint8_t* fFirstRow;
uint16_t fSeedIndex;
std::vector<std::pair<uint64_t, uint64_t> > fSeeds;
};