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

Function write_bin_log

sql/sql_table.cc:1065–1092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063*/
1064
1065int write_bin_log(THD *thd, bool clear_error,
1066 char const *query, ulong query_length, bool is_trans)
1067{
1068 int error= 0; // No logging of query
1069 if (mysql_bin_log.is_open())
1070 {
1071 int errcode= 0;
1072 thd_proc_info(thd, "Writing to binlog");
1073 if (clear_error)
1074 {
1075 if (global_system_variables.log_warnings > 2)
1076 {
1077 uint err_clear= thd->is_error() ? thd->get_stmt_da()->sql_errno() : 0;
1078 if (err_clear)
1079 sql_print_warning("Error code %d of query '%s' is cleared at its "
1080 "binary logging.", err_clear, query);
1081 }
1082 thd->clear_error();
1083 }
1084 else
1085 errcode= query_error_code(thd, TRUE);
1086 error= thd->binlog_query(THD::STMT_QUERY_TYPE,
1087 query, query_length, is_trans, FALSE, FALSE,
1088 errcode) > 0;
1089 thd_proc_info(thd, 0);
1090 }
1091 return error;
1092}
1093
1094
1095/**

Callers 15

executeMethod · 0.85
mysql_create_tableFunction · 0.85
mysql_create_like_tableFunction · 0.85
log_and_okFunction · 0.85
create_eventMethod · 0.85

Calls 8

query_error_codeFunction · 0.85
sql_errnoMethod · 0.80
get_stmt_daMethod · 0.80
binlog_queryMethod · 0.80
sql_print_warningFunction · 0.70
is_openMethod · 0.45
is_errorMethod · 0.45
clear_errorMethod · 0.45

Tested by

no test coverage detected