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

MCOL-4323: use vlarray.h

This commit is contained in:
benthompson15
2020-12-02 14:11:41 -06:00
parent 464b02c1ba
commit 4900559545
2 changed files with 13 additions and 10 deletions

View File

@ -5,6 +5,7 @@ using namespace std;
#include "functor_str.h"
#include "funchelpers.h"
#include "functioncolumn.h"
#include "vlarray.h"
using namespace execplan;
namespace funcexp
@ -53,8 +54,9 @@ string Func_encode::getStrVal(rowgroup::Row& row,
int nStrLen = str.length();
int nPassLen = password.length();
char res[nStrLen+1];
memset(res,0,nStrLen+1);
utils::VLArray<char> res(nStrLen + 1);
memset(res.data(),0,nStrLen+1);
if (!fSeeded)
{
@ -63,11 +65,11 @@ string Func_encode::getStrVal(rowgroup::Row& row,
fSeeded = true;
}
memcpy(res,str.c_str(),nStrLen);
sql_crypt.encode(res,nStrLen);
memcpy(res.data(),str.c_str(),nStrLen);
sql_crypt.encode(res.data(),nStrLen);
sql_crypt.reinit();
return res;
return res.data();
}
}