From 04afbf59c7211346fc50f3aa6d8601a6089a24f3 Mon Sep 17 00:00:00 2001 From: jmrojas2332 Date: Thu, 5 Mar 2020 17:30:02 +0000 Subject: [PATCH] MCOL-3760 Fix issue with random seed list not being initilized to empty --- utils/funcexp/func_rand.cpp | 2 +- utils/funcexp/functor_export.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/funcexp/func_rand.cpp b/utils/funcexp/func_rand.cpp index c02137568..f0400eb79 100644 --- a/utils/funcexp/func_rand.cpp +++ b/utils/funcexp/func_rand.cpp @@ -77,7 +77,7 @@ double Func_rand::getDoubleVal(rowgroup::Row& row, fSeedSet = false; fSeedIndex += 1; } - else if (fFirstRow == 0) + else if (fFirstRow == nullptr) { // Store first row fFirstRow = row.getData(); diff --git a/utils/funcexp/functor_export.h b/utils/funcexp/functor_export.h index ad885296e..a59a37c3d 100644 --- a/utils/funcexp/functor_export.h +++ b/utils/funcexp/functor_export.h @@ -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){} + Func_rand() : Func("rand"), fSeed1(0), fSeed2(0), fSeedSet(false), fMultipleSeedsSet(false), fFirstRow(nullptr), fSeeds(){} virtual ~Func_rand() {} double getRand(); @@ -46,7 +46,6 @@ public: { fSeedSet = seedSet; fMultipleSeedsSet = seedSet; - fFirstRow = nullptr; } execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);