**Describe the bug**
`SELECT i FROM generateRandom('i Array(Int8)', 1048575, 10, 1048577) LIMIT 1048575`

Memory limit should be respected.
const char * begin,
    const char * end,
    Context & context,
    bool internal,
    QueryProcessingStage::Enum stage,
    bool has_query_tail,
    ReadBuffer * istr)
{
    
    
    const auto now = std::chrono::system_clock::now();
    auto current_time = time_in_seconds(now);
    auto current_time_microseconds = time_in_microseconds(now);
    
    
    if (!internal)
    {
        context.makeQueryContext();
        CurrentThread::attachQueryContext(context);
    }
    const Settings & settings = context.getSettingsRef();
    ParserQuery parser(end, settings.enable_debug_queries);
    ASTPtr ast;
    const char * query_end;
    
    size_t max_query_size = 0;
    if (!internal)
        max_query_size = settings.max_query_size;
    try
    {