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

MCOL-289 Fix MCOL(0) handling

Now throws an error instead of returning NULL to align with MariaDB
This commit is contained in:
Andrew Hutchings
2016-10-03 22:27:30 +01:00
parent a966fa3382
commit 9606375939

View File

@ -492,6 +492,14 @@ double Func_cot::getDoubleVal(Row& row,
{
// null value is indicated by isNull
double value = parm[0]->data()->getDoubleVal(row, isNull);
if (value == 0)
{
Message::Args args;
args.add("cot");
args.add(value);
unsigned errcode = ERR_INCORRECT_VALUE;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
if (isNull)
{
isNull = true;
@ -505,6 +513,15 @@ double Func_cot::getDoubleVal(Row& row,
case execplan::CalpontSystemCatalog::DATE:
{
int32_t value = parm[0]->data()->getDateIntVal(row, isNull);
if (value == 0)
{
Message::Args args;
args.add("cot");
args.add(value);
unsigned errcode = ERR_INCORRECT_VALUE;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
if (isNull)
{
isNull = true;
@ -518,6 +535,14 @@ double Func_cot::getDoubleVal(Row& row,
case execplan::CalpontSystemCatalog::DATETIME:
{
int64_t value = parm[0]->data()->getDatetimeIntVal(row, isNull);
if (value == 0)
{
Message::Args args;
args.add("cot");
args.add((uint64_t)value);
unsigned errcode = ERR_INCORRECT_VALUE;
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(errcode, args), errcode);
}
if (isNull)
{
isNull = true;