From doctrine documentation:

```
There are two types of custom tree walkers that you can hook into the DQL parser:
An output walker. This one actually generates the SQL, and there is only ever one of them. We implemented the default SqlWalker implementation for it.
A tree walker. There can be many tree walkers, they cannot generate the sql, however they can modify the AST before its rendered to sql.
```

So, when query already has output walker, I should leave it, do not replace with ``CountOutputWalker`` (in my test case I also checked [gedmo output walker](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/translatable.md#using-orm-query-hint), which can appear in filters).

I didn't use stanadrd ``Paginator``, because there is custom maxResult limitation:

    $countQuery->setFirstResult(null)->setMaxResults($maxResults);

It cannot be configured in ``Paginator``.

As of result, we can meet this bug only with all of following conditions:
    1) Query already has output walker, so we should leave it.
    2) Query uses DQL GroupBy functions, so has Group by expression.