Bug #79765 MySQL Slow Query log should include query generated warnings
Submitted: 23 Dec 2015 16:19
Reporter: Joe Kislo Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[23 Dec 2015 16:19] Joe Kislo
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