**How to reproduce**

clickhouse-local:
```
CREATE TABLE f (`s` String) ENGINE = File(TSV, '/dev/null');
CREATE VIEW v AS SELECT * FROM f;
SELECT '', NULL FROM merge('', '\0');
```

{
    ASTTableExpression * table_expression = getFirstTableExpression(select_query);
    if (!table_expression->subquery)
        throw Exception("Logical error: incorrect table expression", ErrorCodes::LOGICAL_ERROR);
    ASTPtr subquery = table_expression->subquery;
    table_expression->subquery = {};
    table_expression->database_and_table_name = view_name;
    for (auto & child : table_expression->children)
        if (child.get() == subquery.get())
            child = view_name;
    return subquery->children[0];
}
void registerStorageView(StorageFactory & factory)
{
    factory.registerStorage("View", [](const StorageFactory::Arguments & args)
    {
        if (args.query.storage)
            throw Exception("Specifying ENGINE is not allowed for a View", ErrorCodes::INCORRECT_QUERY);
        return std::make_shared<StorageView>(args.table_id, args.query, args.columns, args.comment);
    });
}
}