You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -39,72 +39,82 @@ namespace funcexp
|
||||
|
||||
CalpontSystemCatalog::ColType Func_concat_ws::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType )
|
||||
{
|
||||
// operation type is not used by this functor
|
||||
return fp[0]->data()->resultType();
|
||||
// operation type is not used by this functor
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
|
||||
string Func_concat_ws::getStrVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType&)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType&)
|
||||
{
|
||||
string delim = stringValue(parm[0], row, isNull);
|
||||
if (isNull)
|
||||
return "";
|
||||
string delim = stringValue(parm[0], row, isNull);
|
||||
|
||||
if (isNull)
|
||||
return "";
|
||||
|
||||
#ifdef STRCOLL_ENH__
|
||||
wstring wstr;
|
||||
size_t strwclen = utf8::idb_mbstowcs(0,delim.c_str(),0) + 1;
|
||||
wchar_t* wcbuf = (wchar_t*)alloca(strwclen * sizeof(wchar_t));
|
||||
strwclen = utf8::idb_mbstowcs(wcbuf, delim.c_str(), strwclen);
|
||||
wstring wdelim(wcbuf, strwclen);
|
||||
wstring wstr;
|
||||
size_t strwclen = utf8::idb_mbstowcs(0, delim.c_str(), 0) + 1;
|
||||
wchar_t* wcbuf = (wchar_t*)alloca(strwclen * sizeof(wchar_t));
|
||||
strwclen = utf8::idb_mbstowcs(wcbuf, delim.c_str(), strwclen);
|
||||
wstring wdelim(wcbuf, strwclen);
|
||||
|
||||
for ( unsigned int id = 1 ; id < parm.size() ; id++)
|
||||
{
|
||||
string tstr = stringValue(parm[id], row, isNull);
|
||||
if (isNull)
|
||||
{
|
||||
isNull = false;
|
||||
continue;
|
||||
}
|
||||
if (!wstr.empty())
|
||||
wstr += wdelim;
|
||||
size_t strwclen1 = utf8::idb_mbstowcs(0, tstr.c_str(), 0) + 1;
|
||||
wchar_t* wcbuf1 = (wchar_t*)alloca(strwclen1 * sizeof(wchar_t));
|
||||
strwclen1 = utf8::idb_mbstowcs(wcbuf1, tstr.c_str(), strwclen1);
|
||||
wstring str1(wcbuf1, strwclen1);
|
||||
wstr += str1;
|
||||
}
|
||||
for ( unsigned int id = 1 ; id < parm.size() ; id++)
|
||||
{
|
||||
string tstr = stringValue(parm[id], row, isNull);
|
||||
|
||||
size_t strmblen = utf8::idb_wcstombs(0, wstr.c_str(), 0) + 1;
|
||||
char* outbuf = (char*)alloca(strmblen * sizeof(char));
|
||||
strmblen = utf8::idb_wcstombs(outbuf, wstr.c_str(), strmblen);
|
||||
if (strmblen == 0)
|
||||
isNull = true;
|
||||
else
|
||||
isNull = false;
|
||||
return string(outbuf, strmblen);
|
||||
if (isNull)
|
||||
{
|
||||
isNull = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!wstr.empty())
|
||||
wstr += wdelim;
|
||||
|
||||
size_t strwclen1 = utf8::idb_mbstowcs(0, tstr.c_str(), 0) + 1;
|
||||
wchar_t* wcbuf1 = (wchar_t*)alloca(strwclen1 * sizeof(wchar_t));
|
||||
strwclen1 = utf8::idb_mbstowcs(wcbuf1, tstr.c_str(), strwclen1);
|
||||
wstring str1(wcbuf1, strwclen1);
|
||||
wstr += str1;
|
||||
}
|
||||
|
||||
size_t strmblen = utf8::idb_wcstombs(0, wstr.c_str(), 0) + 1;
|
||||
char* outbuf = (char*)alloca(strmblen * sizeof(char));
|
||||
strmblen = utf8::idb_wcstombs(outbuf, wstr.c_str(), strmblen);
|
||||
|
||||
if (strmblen == 0)
|
||||
isNull = true;
|
||||
else
|
||||
isNull = false;
|
||||
|
||||
return string(outbuf, strmblen);
|
||||
|
||||
#else
|
||||
string str;
|
||||
for ( uint32_t i = 1 ; i < parm.size() ; i++)
|
||||
{
|
||||
str += string(stringValue(parm[i], row, isNull).c_str());
|
||||
string str;
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
isNull = false;
|
||||
continue;
|
||||
}
|
||||
if (!str.empty() && !isNull)
|
||||
str += delim;
|
||||
}
|
||||
if (str.empty())
|
||||
isNull = true;
|
||||
else
|
||||
isNull = false;
|
||||
return str;
|
||||
for ( uint32_t i = 1 ; i < parm.size() ; i++)
|
||||
{
|
||||
str += string(stringValue(parm[i], row, isNull).c_str());
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
isNull = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!str.empty() && !isNull)
|
||||
str += delim;
|
||||
}
|
||||
|
||||
if (str.empty())
|
||||
isNull = true;
|
||||
else
|
||||
isNull = false;
|
||||
|
||||
return str;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user