You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-06-13 16:01:32 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -43,65 +43,65 @@ namespace windowfunction
|
||||
|
||||
int64_t FrameBoundRow::getBound(int64_t b, int64_t e, int64_t c)
|
||||
{
|
||||
return c;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
const string FrameBoundRow::toString() const
|
||||
{
|
||||
return FrameBound::toString();
|
||||
return FrameBound::toString();
|
||||
}
|
||||
|
||||
|
||||
int64_t FrameBoundConstantRow::getBound(int64_t b, int64_t e, int64_t c)
|
||||
{
|
||||
if (fBoundType < WF__CURRENT_ROW)
|
||||
{
|
||||
if (fOffset <= (c - b))
|
||||
c -= fOffset;
|
||||
else
|
||||
c = b - (!fStart ? 1 : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fOffset <= (e - c))
|
||||
c += fOffset;
|
||||
else
|
||||
c = e + (fStart ? 1 : 0);
|
||||
}
|
||||
if (fBoundType < WF__CURRENT_ROW)
|
||||
{
|
||||
if (fOffset <= (c - b))
|
||||
c -= fOffset;
|
||||
else
|
||||
c = b - (!fStart ? 1 : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fOffset <= (e - c))
|
||||
c += fOffset;
|
||||
else
|
||||
c = e + (fStart ? 1 : 0);
|
||||
}
|
||||
|
||||
return c;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
const string FrameBoundConstantRow::toString() const
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << fOffset << " " << FrameBound::toString();
|
||||
return oss.str();
|
||||
oss << fOffset << " " << FrameBound::toString();
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
int64_t FrameBoundExpressionRow<T>::getBound(int64_t b, int64_t e, int64_t c)
|
||||
{
|
||||
// set row data
|
||||
// get expression int value
|
||||
fRow.setData(getPointer(fRowData->at(c)));
|
||||
// set row data
|
||||
// get expression int value
|
||||
fRow.setData(getPointer(fRowData->at(c)));
|
||||
|
||||
if (fRow.isNullValue(fExprIdx))
|
||||
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, "NULL"),
|
||||
ERR_WF_BOUND_OUT_OF_RANGE);
|
||||
if (fRow.isNullValue(fExprIdx))
|
||||
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, "NULL"),
|
||||
ERR_WF_BOUND_OUT_OF_RANGE);
|
||||
|
||||
getOffset();
|
||||
getOffset();
|
||||
|
||||
if (fOffset < 0)
|
||||
{
|
||||
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, fOffset),
|
||||
ERR_WF_BOUND_OUT_OF_RANGE);
|
||||
}
|
||||
if (fOffset < 0)
|
||||
{
|
||||
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, fOffset),
|
||||
ERR_WF_BOUND_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return FrameBoundConstantRow::getBound(b, e, c);
|
||||
return FrameBoundConstantRow::getBound(b, e, c);
|
||||
}
|
||||
|
||||
|
||||
@ -109,8 +109,8 @@ template<typename T>
|
||||
const string FrameBoundExpressionRow<T>::toString() const
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "value_expr " << FrameBound::toString();
|
||||
return oss.str();
|
||||
oss << "value_expr " << FrameBound::toString();
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
@ -121,25 +121,25 @@ template<typename T> void FrameBoundExpressionRow<T>::getOffset()
|
||||
|
||||
template<> void FrameBoundExpressionRow<int64_t>::getOffset()
|
||||
{
|
||||
fOffset = fRow.getIntField(fExprIdx);
|
||||
fOffset = fRow.getIntField(fExprIdx);
|
||||
}
|
||||
|
||||
|
||||
template<> void FrameBoundExpressionRow<uint64_t>::getOffset()
|
||||
{
|
||||
fOffset = fRow.getUintField(fExprIdx);
|
||||
fOffset = fRow.getUintField(fExprIdx);
|
||||
}
|
||||
|
||||
|
||||
template<> void FrameBoundExpressionRow<double>::getOffset()
|
||||
{
|
||||
fOffset = (int64_t) fRow.getDoubleField(fExprIdx);
|
||||
fOffset = (int64_t) fRow.getDoubleField(fExprIdx);
|
||||
}
|
||||
|
||||
|
||||
template<> void FrameBoundExpressionRow<float>::getOffset()
|
||||
{
|
||||
fOffset = (int64_t) fRow.getFloatField(fExprIdx);
|
||||
fOffset = (int64_t) fRow.getFloatField(fExprIdx);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user