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,9 +39,9 @@ using namespace joblist;
|
||||
namespace
|
||||
{
|
||||
|
||||
void reverse( char *start, char *end )
|
||||
void reverse( char* start, char* end )
|
||||
{
|
||||
while( start < end )
|
||||
while ( start < end )
|
||||
{
|
||||
char c = *start;
|
||||
*start++ = *end;
|
||||
@ -56,31 +56,31 @@ namespace funcexp
|
||||
|
||||
CalpontSystemCatalog::ColType Func_reverse::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();
|
||||
}
|
||||
|
||||
std::string Func_reverse::getStrVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType&)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType&)
|
||||
{
|
||||
string str = stringValue(fp[0], row, isNull);
|
||||
string str = stringValue(fp[0], row, isNull);
|
||||
|
||||
// We used to reverse in the string buffer, but that doesn't
|
||||
// work for all compilers as some re-use the buffer on simple
|
||||
// string assignment and implement a ref-count. Reversing in the
|
||||
// string buffer has the affect of reversing all strings from
|
||||
// which this one derived.
|
||||
int len = str.length();
|
||||
char* pbuf = new char[len+1];
|
||||
strncpy(pbuf, str.c_str(), len);
|
||||
pbuf[len] = 0;
|
||||
char *end = pbuf+len-1;
|
||||
reverse(pbuf, end);
|
||||
string rstr = pbuf;
|
||||
delete [] pbuf;
|
||||
return rstr;
|
||||
// We used to reverse in the string buffer, but that doesn't
|
||||
// work for all compilers as some re-use the buffer on simple
|
||||
// string assignment and implement a ref-count. Reversing in the
|
||||
// string buffer has the affect of reversing all strings from
|
||||
// which this one derived.
|
||||
int len = str.length();
|
||||
char* pbuf = new char[len + 1];
|
||||
strncpy(pbuf, str.c_str(), len);
|
||||
pbuf[len] = 0;
|
||||
char* end = pbuf + len - 1;
|
||||
reverse(pbuf, end);
|
||||
string rstr = pbuf;
|
||||
delete [] pbuf;
|
||||
return rstr;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user