1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Initial commit for Encode/Decode.

This commit is contained in:
benthompson15
2020-11-06 15:23:24 -06:00
parent 84fb821c47
commit 3e9b7b3401
9 changed files with 320 additions and 4 deletions

View File

@ -24,6 +24,7 @@
#define FUNCTOR_STR_H
#include "functor.h"
#include "sql_crypt.h"
namespace funcexp
{
@ -882,6 +883,64 @@ public:
execplan::CalpontSystemCatalog::ColType& op_ct);
};
/** @brief Func_encode class
*/
class Func_encode : public Func_Str
{
public:
Func_encode() : Func_Str("encode") , fSeeded(false) , fSeeds{0,0} {}
virtual ~Func_encode() {}
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
std::string getStrVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
void resetSeed()
{
fSeeded = false;
fSeeds[0] = 0;
fSeeds[1] = 0;
}
private:
void hash_password(ulong *result, const char *password, uint password_len);
bool fSeeded;
SQL_CRYPT sql_crypt;
ulong fSeeds[2];
};
/** @brief Func_encode class
*/
class Func_decode : public Func_Str
{
public:
Func_decode() : Func_Str("decode") , fSeeded(false) , fSeeds{0,0} {}
virtual ~Func_decode() {}
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType);
std::string getStrVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
void resetSeed()
{
fSeeded = false;
fSeeds[0] = 0;
fSeeds[1] = 0;
}
private:
void hash_password(ulong *result, const char *password, uint password_len);
bool fSeeded;
SQL_CRYPT sql_crypt;
ulong fSeeds[2];
};
}
#endif