diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c4a4312ad85..63dcc6404c6 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3558,6 +3558,24 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end) } +static const char * +show_query_type(THD::enum_binlog_query_type qtype) +{ + switch (qtype) { + case THD::ROW_QUERY_TYPE: + return "ROW"; + case THD::STMT_QUERY_TYPE: + return "STMT"; + case THD::MYSQL_QUERY_TYPE: + return "MYSQL"; + } + + static char buf[64]; + sprintf(buf, "UNKNOWN#%d", qtype); + return buf; +} + + /* Member function that will log query, either row-based or statement-based depending on the value of the 'current_stmt_binlog_row_based' @@ -3586,7 +3604,8 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, THD::killed_state killed_status_arg) { DBUG_ENTER("THD::binlog_query"); - DBUG_PRINT("enter", ("qtype: %d query: '%s'", qtype, query_arg)); + DBUG_PRINT("enter", ("qtype: %s query: '%s'", + show_query_type(qtype), query_arg)); DBUG_ASSERT(query_arg && mysql_bin_log.is_open()); /* @@ -3625,6 +3644,9 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, switch (qtype) { case THD::ROW_QUERY_TYPE: + DBUG_PRINT("debug", + ("current_stmt_binlog_row_based: %d", + current_stmt_binlog_row_based)); if (current_stmt_binlog_row_based) DBUG_RETURN(0); /* Otherwise, we fall through */ |