You've already forked mariadb-columnstore-engine
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:
@ -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
|
||||
|
Reference in New Issue
Block a user