Navigation Menu

Skip to content

Commit

Permalink
Split a large condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 4, 2012
1 parent db460a8 commit 1db8839
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions ha_mroonga.cpp
Expand Up @@ -12911,19 +12911,32 @@ bool ha_mroonga::check_written_by_row_based_binlog()
#else
current_stmt_binlog_row = thd->current_stmt_binlog_row_based;
#endif
if (!current_stmt_binlog_row) {
DBUG_RETURN(false);
}

if (table->s->tmp_table != NO_TMP_TABLE) {
DBUG_RETURN(false);
}

if (!binlog_filter->db_ok(table->s->db.str)) {
DBUG_RETURN(false);
}

#ifdef MRN_OPTION_BITS_IS_UNDER_VARIABLES
option_bits = thd->variables.option_bits & OPTION_BIN_LOG;
#else
option_bits = thd->options & OPTION_BIN_LOG;
#endif
if (!option_bits) {
DBUG_RETURN(false);
}

DBUG_RETURN(
current_stmt_binlog_row &&
table->s->tmp_table == NO_TMP_TABLE &&
binlog_filter->db_ok(table->s->db.str) &&
option_bits &&
mysql_bin_log.is_open()
);
if (!mysql_bin_log.is_open()) {
DBUG_RETURN(false);
}

DBUG_RETURN(true);
}

#ifdef MRN_HAVE_HA_REBIND_PSI
Expand Down

0 comments on commit 1db8839

Please sign in to comment.