Take almost all warnings into use except `format-overflow` and `unused-function`. format-overflow needs to be handled in a separate commit.
Only commands that can contain an SQL statements should be stored for retrying (COM_QUERY and COM_EXECUTE). Other commands are either session commands or do not work with query retrying.