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

Merge pull request #949 from tntnatbry/fix-bitcount

Implement bit_count() distributed function and handle hexadecimal string literals in buildReturnedColumn().
This commit is contained in:
Roman Nozdrin
2019-11-25 21:51:44 +03:00
committed by GitHub
4 changed files with 71 additions and 0 deletions

View File

@ -3173,6 +3173,15 @@ ReturnedColumn* buildReturnedColumn(Item* item, gp_walk_info& gwi, bool& nonSupp
}
case STRING_RESULT:
{
// Special handling for 0xHHHH literals
const Type_handler *tph = item->type_handler();
if (typeid(*tph) == typeid(Type_handler_hex_hybrid))
{
Item_hex_hybrid *hip = reinterpret_cast<Item_hex_hybrid*>(const_cast<Item*>(item));
rc = new ConstantColumn((int64_t)hip->val_int(), ConstantColumn::NUM);
break;
}
String val, *str = item->val_str(&val);
string valStr;
valStr.assign(str->ptr(), str->length());