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

@ -63,6 +63,13 @@ mcsv1_UDAF::ReturnCode regr_avgx::init(mcsv1Context* context,
context->setErrorMessage("regr_avgx() with a non-numeric x argument");
return mcsv1_UDAF::ERROR;
}
if (!(isNumeric(colTypes[1].dataType)))
{
// The error message will be prepended with
// "The storage engine for the table doesn't support "
context->setErrorMessage("regr_avgx() with a non-numeric independant (second) argument");
return mcsv1_UDAF::ERROR;
}
context->setUserDataSize(sizeof(regr_avgx_data));
context->setResultType(CalpontSystemCatalog::DOUBLE);