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(UInt64, max_network_bytes, 0, "The maximum number of bytes (compressed) to receive or transmit over the network for execution of the query.", 0) \
    M(UInt64, max_network_bandwidth_for_user, 0, "The maximum speed of data exchange over the network in bytes per second for all concurrently running user queries. Zero means unlimited.", 0)\
    M(UInt64, max_network_bandwidth_for_all_users, 0, "The maximum speed of data exchange over the network in bytes per second for all concurrently running queries. Zero means unlimited.", 0) \
    \
    M(Bool, log_profile_events, true, "Log query performance statistics into the query_log and query_thread_log.", 0) \
    M(Bool, log_query_settings, true, "Log query settings into the query_log.", 0) \
    M(Bool, log_query_threads, true, "Log query threads into system.query_thread_log table. This setting have effect only when 'log_queries' is true.", 0) \
    M(String, log_comment, "", "Log comment into system.query_log table and server log. It can be set to arbitrary string no longer than max_query_size.", 0) \
    M(LogsLevel, send_logs_level, LogsLevel::fatal, "Send server text logs with specified minimum level to client. Valid values: 'trace', 'debug', 'information', 'warning', 'error', 'fatal', 'none'", 0) \
    M(Bool, enable_optimize_predicate_expression, 1, "If it is set to true, optimize predicates to subqueries.", 0) \
    M(Bool, enable_optimize_predicate_expression_to_final_subquery, 1, "Allow push predicate to final subquery.", 0) \
    M(Bool, allow_push_predicate_when_subquery_contains_with, 1, "Allows push predicate when subquery contains WITH clause", 0) \
    \
    M(UInt64, low_cardinality_max_dictionary_size, 8192, "Maximum size (in rows) of shared global dictionary for LowCardinality type.", 0) \
    M(Bool, low_cardinality_use_single_dictionary_for_part, false, "LowCardinality type serialization setting. If is true, than will use additional keys when global dictionary overflows. Otherwise, will create several shared dictionaries.", 0) \
    M(Bool, decimal_check_overflow, true, "Check overflow of decimal arithmetic/comparison operations", 0) \
    \
    M(Bool, prefer_localhost_replica, 1, "1 - always send query to local replica, if it exists. 0 - choose replica to send query between local and remote ones according to load_balancing", 0) \
    M(UInt64, max_fetch_partition_retries_count, 5, "Amount of retries while fetching partition from another host.", 0) \
    M(UInt64, http_max_multipart_form_data_size, 1024 * 1024 * 1024, "Limit on size of multipart/form-data content. This setting cannot be parsed from URL parameters and should be set in user profile. Note that content is parsed and external tables are created in memory before start of query execution. And this is the only limit that has effect on that stage (limits on max memory usage and max execution time have no effect while reading HTTP form data).", 0) \
    M(Bool, calculate_text_stack_trace, 1, "Calculate text stack trace in case of exceptions during query execution. This is the default. It requires symbol lookups that may slow down fuzzing tests when huge amount of wrong queries are executed. In normal cases you should not disable this option.", 0) \
    M(Bool, allow_ddl, true, "If it is set to true, then a user is allowed to executed DDL queries.", 0) \
    M(Bool, parallel_view_processing, false, "Enables pushing to attached views concurrently instead of sequentially.", 0) \
    M(Bool, enable_unaligned_array_join, false, "Allow ARRAY JOIN with multiple arrays that have different sizes. When this settings is enabled, arrays will be resized to the longest one.", 0) \
    M(Bool, optimize_read_in_order, true, "Enable ORDER BY optimization for reading data in corresponding order in MergeTree tables.", 0) \
    M(Bool, optimize_aggregation_in_order, false, "Enable GROUP BY optimization for aggregating data in corresponding order in MergeTree tables.", 0) \
    M(UInt64, read_in_order_two_level_merge_threshold, 100, "Minimal number of parts to read to run preliminary merge step during multithread reading in order of primary key.", 0) \
    M(Bool, low_cardinality_allow_in_native_format, true, "Use LowCardinality type in Native format. Otherwise, convert LowCardinality columns to ordinary for select query, and convert ordinary columns to required LowCardinality for insert query.", 0) \
    M(Bool, cancel_http_readonly_queries_on_client_close, false, "Cancel HTTP readonly queries when a client closes the connection without waiting for response.", 0) \
    M(Bool, external_table_functions_use_nulls, true, "If it is set to true, external table functions will implicitly use Nullable type if needed. Otherwise NULLs will be substituted with default values. Currently supported only by 'mysql', 'postgresql' and 'odbc' table functions.", 0) \