1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Merge pull request #586 from mariadb-corporation/MCOL-1775

MCOL-1775 Fix addtime/subtime for WHERE
This commit is contained in:
Roman Nozdrin
2018-10-08 11:22:42 +03:00
committed by GitHub
2 changed files with 11 additions and 4 deletions

View File

@@ -3665,11 +3665,16 @@ ReturnedColumn* buildFunctionColumn(
gwi.no_parm_func_list.push_back(fc); gwi.no_parm_func_list.push_back(fc);
} }
// add the sign for addtime function // func name is addtime/subtime in 10.3.9
if (funcName == "add_time") // note: this means get_time() can now go away in our server fork
if ((funcName == "addtime") || (funcName == "subtime"))
{ {
Item_func_add_time* addtime = (Item_func_add_time*)ifp; int64_t sign = 1;
sptp.reset(new ParseTree(new ConstantColumn((int64_t)addtime->get_sign()))); if (funcName == "subtime")
{
sign = -1;
}
sptp.reset(new ParseTree(new ConstantColumn(sign)));
funcParms.push_back(sptp); funcParms.push_back(sptp);
} }

View File

@@ -75,6 +75,8 @@ FuncExp::FuncExp()
fFuncMap["abs"] = new Func_abs(); fFuncMap["abs"] = new Func_abs();
fFuncMap["acos"] = new Func_acos(); fFuncMap["acos"] = new Func_acos();
fFuncMap["add_time"] = new Func_add_time(); fFuncMap["add_time"] = new Func_add_time();
fFuncMap["addtime"] = new Func_add_time();
fFuncMap["subtime"] = new Func_add_time();
fFuncMap["asin"] = new Func_asin(); fFuncMap["asin"] = new Func_asin();
fFuncMap["ascii"] = new Func_ascii(); fFuncMap["ascii"] = new Func_ascii();
fFuncMap["atan"] = new Func_atan(); fFuncMap["atan"] = new Func_atan();