@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 
}
    if (const auto * func = node->as<ASTFunction>())
    {
        if (!func->arguments)
            return false;
        const auto & args = func->arguments->children;
        if (args.size() > 2 || args.empty())
            return false;
        out_functions_chain.push_back(func);
        bool ret = false;
        if (args.size() == 2)
        {
            if (args[0]->as<ASTLiteral>())
            {
                ret = isKeyPossiblyWrappedByMonotonicFunctionsImpl(args[1], out_key_column_num, out_key_column_type, out_functions_chain);
            }
            else if (args[1]->as<ASTLiteral>())
            {
                ret = isKeyPossiblyWrappedByMonotonicFunctionsImpl(args[0], out_key_column_num, out_key_column_type, out_functions_chain);
            }
        }
        else
        {
            ret = isKeyPossiblyWrappedByMonotonicFunctionsImpl(args[0], out_key_column_num, out_key_column_type, out_functions_chain);
        }
        return ret;
    }
    return false;
}
static void castValueToType(const DataTypePtr & desired_type, Field & src_value, const DataTypePtr & src_type, const ASTPtr & node)