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-1429 Fix DAYNAME()/MONTHNAME() NULL result
For NULL result -1 cast to a uint was used as an array index. This caused crashes with TIME data type.
This commit is contained in:
@ -145,7 +145,9 @@ string Func_dayname::getStrVal(rowgroup::Row& row,
|
|||||||
bool& isNull,
|
bool& isNull,
|
||||||
CalpontSystemCatalog::ColType& op_ct)
|
CalpontSystemCatalog::ColType& op_ct)
|
||||||
{
|
{
|
||||||
uint32_t weekday = getIntVal(row, parm, isNull, op_ct);
|
int32_t weekday = getIntVal(row, parm, isNull, op_ct);
|
||||||
|
if (weekday == -1)
|
||||||
|
return "";
|
||||||
return helpers::weekdayFullNames[weekday];
|
return helpers::weekdayFullNames[weekday];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,9 @@ string Func_monthname::getStrVal(rowgroup::Row& row,
|
|||||||
bool& isNull,
|
bool& isNull,
|
||||||
CalpontSystemCatalog::ColType& op_ct)
|
CalpontSystemCatalog::ColType& op_ct)
|
||||||
{
|
{
|
||||||
uint32_t month = getIntVal(row, parm, isNull, op_ct);
|
int32_t month = getIntVal(row, parm, isNull, op_ct);
|
||||||
|
if (month == -1)
|
||||||
|
return "";
|
||||||
return helpers::monthFullNames[month];
|
return helpers::monthFullNames[month];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user