The following flags can be examined or set to alter the behavior during error handling:
thd->net.report_error is set in
my_message_sql() if the error message was
my_message_sql() is called by
net.report_error, but is always set to 1
my_message_sql() if error was not caught by
an error handler. Used by replication to see if a query generated
any kind of errors.
Normally an error also generates a warning. The warning can be
disabled by setting
thd->no_warnings_for_error. (This allows one
to catch all error messages generated by a statement)
This is set to in case likes
INSERT IGNORE ...
SELECT. In this case we ignore all not fatal errors
generated by the select.
Set this if we should abort the current statement (and any
multi-line statements) because something went fatally wrong. (for
example, a stored procedure continue handler should not be able to
catch this). This is reset by
Strict mode flag, which means that we should abort the statement
if we get a warning. In the
function this changes the warning level from
ERROR. In other
cases, this flag is mostly tested with
thd->really_abort_on_warning() to ensure we
don't abort in the middle of an update with not transactional
If set, we generate warning for field conversations (normal case
This is mainly set to 0 when doing internal copying of data
between fields and we don't want to generate any conversion errors
at any level.
Set in case of error in connection protocol or in case of 'kill'. In this case we should abort the query and kill the connection.
This function returns 1 if a warning should be converted to an
error, like in strict mode when all tables are transactional. The
conversion is handled in
Should be called if we want to abort the current statement and any multi-line statement.