MCPcopy Create free account
hub / github.com/MariaDB/server / query_error_code

Function query_error_code

sql/log.cc:9907–9934  ·  view source on GitHub ↗

Helper function to get the error code of the query to be binlogged. */

Source from the content-addressed store, hash-verified

9905 Helper function to get the error code of the query to be binlogged.
9906 */
9907int query_error_code(THD *thd, bool not_killed)
9908{
9909 int error;
9910
9911 if (not_killed || (killed_mask_hard(thd->killed) == KILL_BAD_DATA))
9912 {
9913 error= thd->is_error() ? thd->get_stmt_da()->sql_errno() : 0;
9914 if (!error)
9915 return error;
9916
9917 /* thd->get_get_stmt_da()->sql_errno() might be ER_SERVER_SHUTDOWN or
9918 ER_QUERY_INTERRUPTED, So here we need to make sure that error
9919 is not set to these errors when specified not_killed by the
9920 caller.
9921 */
9922 if (error == ER_SERVER_SHUTDOWN || error == ER_QUERY_INTERRUPTED ||
9923 error == ER_NEW_ABORTING_CONNECTION || error == ER_CONNECTION_KILLED)
9924 error= 0;
9925 }
9926 else
9927 {
9928 /* killed status for DELAYED INSERT thread should never be used */
9929 DBUG_ASSERT(!(thd->system_thread & SYSTEM_THREAD_DELAYED_INSERT));
9930 error= thd->killed_errno();
9931 }
9932
9933 return error;
9934}
9935
9936
9937bool MYSQL_BIN_LOG::write_incident_already_locked(THD *thd)

Callers 15

mysql_insertFunction · 0.85
prepare_eofMethod · 0.85
abort_result_setMethod · 0.85
binlog_show_create_tableFunction · 0.85
binlog_savepoint_setFunction · 0.85
execute_functionMethod · 0.85
update_single_tableMethod · 0.85
abort_result_setMethod · 0.85
send_eofMethod · 0.85
mysql_create_db_internalFunction · 0.85
mysql_alter_db_internalFunction · 0.85

Calls 4

sql_errnoMethod · 0.80
get_stmt_daMethod · 0.80
killed_errnoMethod · 0.80
is_errorMethod · 0.45

Tested by

no test coverage detected