Description:
When warnings are generated by queries logged into the slow-query log, the warnings should be captured and put out to the log. Sometimes the warnings are very relevant as to why the query is in the slow query log. For example this warning:
| Warning | 3170 | Memory capacity of 1536000 bytes for 'range_optimizer_max_mem_size' exceeded. Range optimization was not done for this query.
It's extremely relevant as to why something is in the slow query log. When people run into issue #78973, it will be very useful to have the warnings available.
How to repeat:
Run a slow query that generates warnings.
Look in the slow query log and you won't see the warnings
Suggested fix:
Output warnings to the slow query log