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

Get the associated string values for charset()/collation() functions applied to a field.

This commit is contained in:
Gagan Goel
2019-11-22 01:34:29 +00:00
parent dbb9b21d26
commit a76ceb5aa0

View File

@ -3680,6 +3680,29 @@ ReturnedColumn* buildFunctionColumn(
fc = buildCaseFunction(ifp, gwi, nonSupport);
}
else if ((funcName == "charset" || funcName == "collation") &&
ifp->argument_count() == 1 &&
ifp->arguments()[0]->type() == Item::FIELD_ITEM)
{
Item_field *item = reinterpret_cast<Item_field*>(ifp->arguments()[0]);
CHARSET_INFO* info = item->charset_for_protocol();
ReturnedColumn* rc;
string val;
if (funcName == "charset")
{
val = info->csname;
}
else // collation
{
val = info->name;
}
rc = new ConstantColumn(val, ConstantColumn::LITERAL);
return rc;
}
else if ((functor = funcExp->getFunctor(funcName)))
{
// where clause isnull still treated as predicate operator