test
```
DROP TABLE IF EXISTS range_issue;

CREATE TABLE range_issue
ENGINE = Log AS
SELECT range(rand() % 601) AS arr
FROM numbers(21000000)
```

It's regression:
20.7 - last version when test passes.
20.8 - first version when  test fails. 

Error message & stacktrace:
```
Received exception from server (version 21.9.1):
Code: 69. DB::Exception: Received from localhost:9000. DB::Exception: A call to function range would produce 314754485 array elements, which is greater than the allowed maximum of 100000000: while executing 'FUNCTION range(modulo(rand(), 601) :: 2) -> range(modulo(rand(), 601)) Array(UInt16) : 1'. Stack trace:

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x8f9817a in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
1. COW<DB::IColumn>::immutable_ptr<DB::IColumn> DB::FunctionRange::executeInternal<unsigned short>(DB::IColumn const*) const @ 0xed7f527 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
2. DB::FunctionRange::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0xed7d422 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
3. DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0xb12828e in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
4. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0xfa7621e in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
5. DB::IExecutableFunction::execute(std::__1::vector<DB::ColumnWithTypeAndName, std::__1::allocator<DB::ColumnWithTypeAndName> > const&, std::__1::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0xfa76712 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
6. DB::ExpressionActions::execute(DB::Block&, unsigned long&, bool) const @ 0x100d6e15 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
7. DB::ExpressionTransform::transform(DB::Chunk&) @ 0x1119b6dc in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
8. DB::ISimpleTransform::transform(DB::Chunk&, DB::Chunk&) @ 0x1119ba70 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
9. DB::ISimpleTransform::work() @ 0x1119e947 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
10. void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<DB::PipelineExecutor::addJob(DB::ExecutingGraph::Node*)::$_0, void ()> >(std::__1::__function::__policy_storage const*) @ 0x11051d7d in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
11. DB::PipelineExecutor::executeStepImpl(unsigned long, unsigned long, std::__1::atomic<bool>*) @ 0x1104e911 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
12. DB::PipelineExecutor::executeImpl(unsigned long) @ 0x1104c94f in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
13. DB::PipelineExecutor::execute(unsigned long) @ 0x1104c72d in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
14. void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x110599bf in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
15. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x8fd903f in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
16. void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) @ 0x8fdc923 in /usr/lib/debug/.build-id/8c/ba2568d486f3b979445af26ce56a0deaa65ba7.debug
17. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
18. clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
```


M(Bool, allow_experimental_database_materialized_postgresql, false, "Allow to create database with Engine=MaterializedPostgreSQL(...).", 0) \
    M(Bool, system_events_show_zero_values, false, "Include all metrics, even with zero values", 0) \
    M(MySQLDataTypesSupport, mysql_datatypes_support_level, 0, "Which MySQL types should be converted to corresponding ClickHouse types (rather than being represented as String). Can be empty or any combination of 'decimal' or 'datetime64'. When empty MySQL's DECIMAL and DATETIME/TIMESTAMP with non-zero precision are seen as String on ClickHouse's side.", 0) \
    M(Bool, optimize_trivial_insert_select, true, "Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query", 0) \
    M(Bool, allow_non_metadata_alters, true, "Allow to execute alters which affects not only tables metadata, but also data on disk", 0) \
    M(Bool, enable_global_with_statement, true, "Propagate WITH statements to UNION queries and all subqueries", 0) \
    M(Bool, aggregate_functions_null_for_empty, false, "Rewrite all aggregate functions in a query, adding -OrNull suffix to them", 0) \
    M(Bool, optimize_fuse_sum_count_avg, false, "Fuse aggregate functions sum(), avg(), count() with identical arguments into one sumCount() call, if the query has at least two different functions", 0) \
    M(Bool, flatten_nested, true, "If true, columns of type Nested will be flatten to separate array columns instead of one array of tuples", 0) \
    M(Bool, asterisk_include_materialized_columns, false, "Include MATERIALIZED columns for wildcard query", 0) \
    M(Bool, asterisk_include_alias_columns, false, "Include ALIAS columns for wildcard query", 0) \
    M(Bool, optimize_skip_merged_partitions, false, "Skip partitions with one part with level > 0 in optimize final", 0) \
    M(Bool, optimize_on_insert, true, "Do the same transformation for inserted block of data as if merge was done on this block.", 0) \
    M(Bool, allow_experimental_map_type, true, "Obsolete setting, does nothing.", 0) \
    M(Bool, allow_experimental_window_functions, false, "Allow experimental window functions", 0) \
    M(Bool, allow_experimental_projection_optimization, false, "Enable projection optimization when processing SELECT queries", 0) \
    M(Bool, force_optimize_projection, false, "If projection optimization is enabled, SELECT queries need to use projection", 0) \
    M(Bool, async_socket_for_remote, true, "Asynchronously read from socket executing remote query", 0) \
    M(Bool, insert_null_as_default, true, "Insert DEFAULT values instead of NULL in INSERT SELECT (UNION ALL)", 0) \
    \
    M(Bool, optimize_rewrite_sum_if_to_count_if, true, "Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent", 0) \
    M(UInt64, insert_shard_id, 0, "If non zero, when insert into a distributed table, the data will be inserted into the shard `insert_shard_id` synchronously. Possible values range from 1 to `shards_number` of corresponding distributed table", 0) \
    \
    /** Experimental feature for moving data between shards. */ \
    \
    M(Bool, allow_experimental_query_deduplication, false, "Experimental data deduplication for SELECT queries based on part UUIDs", 0) \
    M(Bool, experimental_query_deduplication_send_all_part_uuids, false, "If false only part UUIDs for currently moving parts are sent. If true all read part UUIDs are sent (useful only for testing).", 0) \
    \
    M(Bool, engine_file_empty_if_not_exists, false, "Allows to select data from a file engine table without file", 0) \
    M(Bool, engine_file_truncate_on_insert, false, "Enables or disables truncate before insert in file engine tables", 0) \