```sql
DROP TABLE IF EXISTS tp;

create table tp (d1 Int32, d2 Int32, eventcnt Int64,
projection p (select sum(eventcnt), d1 group by d1)) 
engine = SummingMergeTree order by (d1, d2);

set allow_experimental_projection_optimization = 1, force_optimize_projection = 1;

select sum(eventcnt) eventcnt, d1
from tp
group by d1;

DB::Exception: No projection is used when allow_experimental_projection_optimization = 1.

```

The exception message is also incorrect, should be "when force_optimize_projection = 1".

}
    }
    if (query_info.projection->merge_tree_data_select_base_cache->sum_marks > 0)
    {
        auto storage_from_base_parts_of_projection = StorageFromBasePartsOfProjection::create(data, metadata_snapshot);
        auto ast = query_info.projection->desc->query_ast->clone();
        auto & select = ast->as<ASTSelectQuery &>();
        if (given_select.where())
            select.setExpression(ASTSelectQuery::Expression::WHERE, given_select.where()->clone());
        if (given_select.prewhere())
            select.setExpression(ASTSelectQuery::Expression::WHERE, given_select.prewhere()->clone());
        
        
        if (processed_stage >= QueryProcessingStage::Enum::WithMergeableState && given_select.groupBy())
            select.setExpression(ASTSelectQuery::Expression::GROUP_BY, given_select.groupBy()->clone());
        auto interpreter = InterpreterSelectQuery(
            ast,
            context,
            storage_from_base_parts_of_projection,
            nullptr,
            SelectQueryOptions{processed_stage}.ignoreAggregation().ignoreProjections());
        ordinary_pipe = QueryPipeline::getPipe(interpreter.execute().pipeline);
    }
    if (query_info.projection->desc->type == ProjectionDescription::Type::Aggregate)
    {