```
CREATE TABLE a
(
    `number` UInt64,
    `x` MATERIALIZED x
)
ENGINE = MergeTree
ORDER BY number;
-- that should fail!

insert into a values (1);
Received exception from server (version 21.7.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'x' while processing query: 'CAST(x, 'UInt8') AS x', required columns: 'x' 'x'. 
```
#include <gtest/gtest.h>
#include <Interpreters/QueryNormalizer.h>
#include <Parsers/IAST.h>
#include <Parsers/queryToString.h>
#include <Parsers/ExpressionListParsers.h>
#include <Parsers/parseQuery.h>
#include <Core/Settings.h>
using namespace DB;
TEST(QueryNormalizer, SimpleCycleAlias)
{
    String query = "a as b, b as a";
    ParserExpressionList parser(false);
    ASTPtr ast = parseQuery(parser, query, 0, 0);
    Aliases aliases;
    aliases["a"] = parseQuery(parser, "b as a", 0, 0)->children[0];
    aliases["b"] = parseQuery(parser, "a as b", 0, 0)->children[0];
    Settings settings;
    QueryNormalizer::Data normalizer_data(aliases, {}, false, settings);
    EXPECT_THROW(QueryNormalizer(normalizer_data).visit(ast), Exception);
}