@zhyass and I found some codes may be incorrect in

https://github.com/ClickHouse/ClickHouse/blob/33ffe11d0397aa6904c246172223b1da1fbcf1cc/src/Storages/MergeTree/KeyCondition.cpp#L280-L297

It tries to extract fixed prefix from the like pattern to find the range, but it's wrong, A counterexample is ：

like_pattern  -> "a%c",  the prefix will be "a" and the range will be ` Range("a", true,"b", false)` yet the String "axxxxxd" still not match match this pattern (  axxxxxd not like a%c => true  ).

`Not like` is not the reverse of `Like` in continuous key ranges.

The only special case to work fine for "not like" to range is that string pattern ends with "%" or "_" , eg:    'a%', 'a\_'

cc @alexey-milovidov 
{
    NameSet names;
    for (const auto & action : key_expr.getActions())
        names.insert(action.node->result_name);
    return names;
}
KeyCondition::KeyCondition(
    const SelectQueryInfo & query_info,
    ContextPtr context,
    const Names & key_column_names,
    const ExpressionActionsPtr & key_expr_,
    bool single_point_,
    bool strict_)
    : key_expr(key_expr_)
    , key_subexpr_names(getAllSubexpressionNames(*key_expr))
    , prepared_sets(query_info.sets)
    , single_point(single_point_)
    , strict(strict_)
{
    for (size_t i = 0, size = key_column_names.size(); i < size; ++i)
    {
        std::string name = key_column_names[i];
        if (!key_columns.count(name))
            key_columns[name] = i;