1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +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

@ -54,6 +54,13 @@ mcsv1_UDAF::ReturnCode regr_sxx::init(mcsv1Context* context,
context->setErrorMessage("regr_sxx() with other than 2 arguments");
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_sxx() with a non-numeric independant (second) argument");
return mcsv1_UDAF::ERROR;
}
context->setUserDataSize(sizeof(regr_sxx_data));
context->setResultType(CalpontSystemCatalog::DOUBLE);