The MySQL wire protocol includes useful result data and metadata,
such as warnings and errors raised by the query. These often
indicate bugs that will cause problems you may not discover for a
long time, when the cleanup can be costly and damaging.
A quick background. If you're not familiar with how this works,
the server collects warnings from queries and stores them as part
of your connection state. Warnings can be raised at many points
during query execution, including while processing rows. Warnings
aren't part of the result, but there's a set of metadata in the
EOF packet that says how many warnings were raised. Errors, on
the other hand, are the response from the server.
The problem is, these errors and warnings can go undiscovered all
too easily. This should be a concern to everyone: devs because
they don't know what their code is really doing, ops/DBA because
they bear the burden of discovering and diagnosing such …
[Read more]