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

MCOL-1983 Reject non-numeric arguments for regr_*** functions that require numeric

This commit is contained in:
David Hall
2019-01-02 10:31:53 -06:00
parent 4701e8f4af
commit eb75d3cd7e
13 changed files with 152 additions and 3 deletions

View File

@ -57,6 +57,13 @@ mcsv1_UDAF::ReturnCode regr_r2::init(mcsv1Context* context,
context->setErrorMessage("regr_r2() with other than 2 arguments");
return mcsv1_UDAF::ERROR;
}
if (!(isNumeric(colTypes[0].dataType) && isNumeric(colTypes[1].dataType)))
{
// The error message will be prepended with
// "The storage engine for the table doesn't support "
context->setErrorMessage("regr_r2() with non-numeric arguments");
return mcsv1_UDAF::ERROR;
}
context->setUserDataSize(sizeof(regr_r2_data));
context->setResultType(CalpontSystemCatalog::DOUBLE);