ClickHouse v.21.7.7.47

setting max_memory_usage doesnt work for 'create table .. as' queries

for example:
**this query works**
`create table test_table engine MergeTree order by a as
select a_table.a, b_table.b_arr
from (select arrayJoin(range(10000)) as a) a_table
         cross join (select range(10000) as b_arr) b_table
    settings max_memory_usage = 1;`

**this query doesnt work**
`insert into test_table
select a_table.a, b_table.b_arr
from (select arrayJoin(range(10000)) as a) a_table
         cross join (select range(10000) as b_arr) b_table
    settings max_memory_usage = 1;`
With error:
`DB::Exception: Memory limit (for query) exceeded: would use 4.09 MiB`

**Expected behavior**
**this query should NOT work, and setting max_memory_usage should work for all 'select'\'insert'\'create table' queries**
`create table test_table engine MergeTree order by a as
select a_table.a, b_table.b_arr
from (select arrayJoin(range(10000)) as a) a_table
         cross join (select range(10000) as b_arr) b_table
    settings max_memory_usage = 1;`
InterpreterSetQuery(insert_query->settings_ast, context).executeForCurrentContext();
        if (insert_query && insert_query->data)
        {
            query_end = insert_query->data;
            insert_query->has_tail = has_query_tail;
        }
        else
        {
            query_end = end;
        }
    }
    catch (...)
    {
        
        String query = String(begin, begin + std::min(end - begin, static_cast<ptrdiff_t>(max_query_size)));
        auto query_for_logging = prepareQueryForLogging(query, context);
        logQuery(query_for_logging, context, internal);
        if (!internal)
        {
            onExceptionBeforeStart(query_for_logging, context, time_in_microseconds(current_time), ast);
        }
        throw;
    }
    setQuerySpecificSettings(ast, context);
    
    
    
    
    if (!internal && settings.log_queries && settings.log_queries_probability < 1.0)
    {