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

Remove variable-length arrays (-Wvla)

This commit is contained in:
Alexey Antipovsky
2020-11-11 05:37:51 +00:00
parent da691f7b7a
commit b25fee320a
16 changed files with 250 additions and 135 deletions

View File

@ -604,11 +604,13 @@ int PrimitiveProcessor::convertToRegexp(idb_regex_t* regex, const p_DataValue* s
bool PrimitiveProcessor::isLike(const p_DataValue* dict, const idb_regex_t* regex) throw()
{
#ifdef POSIX_REGEX
char cBuf[dict->len + 1];
char* cBuf = new char[dict->len + 1];
memcpy(cBuf, dict->data, dict->len);
cBuf[dict->len] = '\0';
return (regexec(&regex->regex, cBuf, 0, NULL, 0) == 0);
bool ret = (regexec(&regex->regex, cBuf, 0, NULL, 0) == 0);
delete [] cBuf;
return ret;
#else
/* Note, the passed-in pointers are effectively begin() and end() iterators */
return regex_match(dict->data, dict->data + dict->len, regex->regex);

View File

@ -53,6 +53,7 @@ using namespace boost;
#include "blockcacheclient.h"
#include "MonitorProcMem.h"
#include "threadnaming.h"
#include "vlarray.h"
#define MAX64 0x7fffffffffffffffLL
#define MIN64 0x8000000000000000LL
@ -589,7 +590,7 @@ void BatchPrimitiveProcessor::addToJoiner(ByteStream& bs)
// properly-named functions for clarity.
if (typelessJoin[joinerNum])
{
vector<pair<TypelessData, uint32_t> > tmpBuckets[processorThreads];
utils::VLArray<vector<pair<TypelessData, uint32_t> > > tmpBuckets(processorThreads);
TypelessData tlLargeKey;
uint8_t nullFlag;
PoolAllocator &storedKeyAllocator = storedKeyAllocators[joinerNum];
@ -652,7 +653,7 @@ void BatchPrimitiveProcessor::addToJoiner(ByteStream& bs)
uint64_t nullValue = joinNullValues[joinerNum];
bool &l_doMatchNulls = doMatchNulls[joinerNum];
joblist::JoinType joinType = joinTypes[joinerNum];
vector<pair<uint64_t, uint32_t> > tmpBuckets[processorThreads];
utils::VLArray<vector<pair<uint64_t, uint32_t> > > tmpBuckets(processorThreads);
if (joinType & MATCHNULLS)
{