You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +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:
@ -492,6 +492,14 @@ double Func_cot::getDoubleVal(Row& row,
|
|||||||
{
|
{
|
||||||
// null value is indicated by isNull
|
// null value is indicated by isNull
|
||||||
double value = parm[0]->data()->getDoubleVal(row, 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)
|
if (isNull)
|
||||||
{
|
{
|
||||||
isNull = true;
|
isNull = true;
|
||||||
@ -505,6 +513,15 @@ double Func_cot::getDoubleVal(Row& row,
|
|||||||
case execplan::CalpontSystemCatalog::DATE:
|
case execplan::CalpontSystemCatalog::DATE:
|
||||||
{
|
{
|
||||||
int32_t value = parm[0]->data()->getDateIntVal(row, isNull);
|
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)
|
if (isNull)
|
||||||
{
|
{
|
||||||
isNull = true;
|
isNull = true;
|
||||||
@ -518,6 +535,14 @@ double Func_cot::getDoubleVal(Row& row,
|
|||||||
case execplan::CalpontSystemCatalog::DATETIME:
|
case execplan::CalpontSystemCatalog::DATETIME:
|
||||||
{
|
{
|
||||||
int64_t value = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
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)
|
if (isNull)
|
||||||
{
|
{
|
||||||
isNull = true;
|
isNull = true;
|
||||||
|
Reference in New Issue
Block a user