You have to provide the following information whenever possible.
Describe what's wrong
When WITH TOTALS and Query Cache are used in queries, the results returned by query cache do not contain the WITH TOTALS results.
Before the query cache takes effect
:) select t1,count() from t5 group by t1 with totals order by t1 desc limit 11
┌─t1─┬─count()─┐
│ aa │ 28 │
└────┴─────────┘
Totals:
┌─t1─┬─count()─┐
│ │ 28 │
└────┴─────────┘
After the query cache takes effect
:) select t1,count() from t5 group by t1 with totals order by t1 desc limit 11
┌─t1─┬─count()─┐
│ aa │ 28 │
└────┴─────────┘
Describe what's wrong
When WITH TOTALS and Query Cache are used in queries, the results returned by query cache do not contain the WITH TOTALS results.
Before the query cache takes effect
:) select t1,count() from t5 group by t1 with totals order by t1 desc limit 11
┌─t1─┬─count()─┐
│ aa │ 28 │
└────┴─────────┘
Totals:
┌─t1─┬─count()─┐
│ │ 28 │
└────┴─────────┘
After the query cache takes effect
:) select t1,count() from t5 group by t1 with totals order by t1 desc limit 11
┌─t1─┬─count()─┐
│ aa │ 28 │
└────┴─────────┘