Have you ever wondered exactly does log_warnings=2 log? Well, I
have, and finally decided to check the code. (The manual used to
mention setting this to 2 for diagnosing some connection-related
problems, but I didn’t run into that comment in my most recent
search.)
Basically, in recent 5.6 source code, we find “log_warnings >
1″ in 7 files. In 5.5 source, it is only in 5 files. Here are the
7 files in 5.6:
filesort.cc (line 460)
log_event.cc (lines 4873, 10020, 11209)
rpl_master.cc (line 912)
rpl_rli_pdb.cc (lines 1538, 1596, 1735, 2066)
rpl_slave.cc (lines 3585, 4684, 5405, 5436)
sql_acl.cc (lines 9591, 9613, 11351)
sql_connect.cc (line 791)
Long story short, the main (most common) ones are when a filesort
fails (filesort.cc) or a failed login occurs (sql_acl.cc). Then
there are some replication-specific instances where it logs extra
info, such as master/slave/binlog info, “ignored” errors, and
some summary stats …
[Read more]