1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-1822 Intermediate checkin. DISTINCT not working.

This commit is contained in:
David Hall
2019-02-25 14:54:46 -06:00
parent ab931e7c51
commit a2aa4b8479
67 changed files with 2391 additions and 1018 deletions

View File

@@ -89,6 +89,44 @@ double Func_pow::getDoubleVal(Row& row,
return 0.0;
}
long double Func_pow::getLongDoubleVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
// null value is indicated by isNull
long double base = parm[0]->data()->getLongDoubleVal(row, isNull);
if (!isNull)
{
// Should this be long double? Not sure on usage.
double exponent = parm[1]->data()->getDoubleVal(row, isNull);
if (!isNull)
{
errno = 0;
long double x = powl(base, (long double)exponent);
// @bug3490, 4461, rule out domain error, pole error and overflow range error.
if (!isfinite(x))
{
isNull = true;
Message::Args args;
args.add("pow");
args.add((double)base);
args.add(exponent);
unsigned errcode = ERR_FUNC_OUT_OF_RANGE_RESULT;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
return x;
}
}
return 0.0;
}
} // namespace funcexp
// vim:ts=4 sw=4: