summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index afa58afc21d..b1cf6a9024a 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -4049,6 +4049,8 @@ void Query_log_event::print_query_header(IO_CACHE* file,
"@@session.unique_checks", &need_comma);
print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2,
"@@session.autocommit", &need_comma);
+ print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS, ~flags2,
+ "@@session.check_constraint_checks", &need_comma);
my_b_printf(file,"%s\n", print_event_info->delimiter);
print_event_info->flags2= flags2;
}
@@ -4453,7 +4455,8 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
}
thd->enable_slow_log= thd->variables.sql_log_slow;
- mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
+ mysql_parse(thd, thd->query(), thd->query_length(), &parser_state,
+ FALSE, FALSE);
/* Finalize server status flags after executing a statement. */
thd->update_server_status();
log_slow_statement(thd);
@@ -4537,7 +4540,7 @@ compare_errors:
"Error on master: message (format)='%s' error code=%d ; "
"Error on slave: actual message='%s', error code=%d. "
"Default database: '%s'. Query: '%s'",
- ER_SAFE_THD(thd, expected_error),
+ ER_THD(thd, expected_error),
expected_error,
actual_error ? thd->get_stmt_da()->message() : "no error",
actual_error,
@@ -6173,7 +6176,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi,
update it inside mysql_load().
*/
List<Item> tmp_list;
- if (open_temporary_tables(thd, &tables) ||
+ if (thd->open_temporary_tables(&tables) ||
mysql_load(thd, &ex, &tables, field_list, tmp_list, tmp_list,
handle_dup, ignore, net != 0))
thd->is_slave_error= 1;
@@ -8031,7 +8034,7 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
return;
str_to_hex(hex_str, val, val_len);
/*
- For proper behaviour when mysqlbinlog|mysql, we need to explicitely
+ For proper behaviour when mysqlbinlog|mysql, we need to explicitly
specify the variable's collation. It will however cause problems when
people want to mysqlbinlog|mysql into another server not supporting the
character set. But there's not much to do about this and it's unlikely.
@@ -9350,9 +9353,11 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
(!tbl_arg && !cols && tid == ~0UL));
if (thd_arg->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS)
- set_flags(NO_FOREIGN_KEY_CHECKS_F);
+ set_flags(NO_FOREIGN_KEY_CHECKS_F);
if (thd_arg->variables.option_bits & OPTION_RELAXED_UNIQUE_CHECKS)
- set_flags(RELAXED_UNIQUE_CHECKS_F);
+ set_flags(RELAXED_UNIQUE_CHECKS_F);
+ if (thd_arg->variables.option_bits & OPTION_NO_CHECK_CONSTRAINT_CHECKS)
+ set_flags(NO_CHECK_CONSTRAINT_CHECKS_F);
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
@@ -9776,6 +9781,12 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS;
else
thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+
+ if (get_flags(NO_CHECK_CONSTRAINT_CHECKS_F))
+ thd->variables.option_bits|= OPTION_NO_CHECK_CONSTRAINT_CHECKS;
+ else
+ thd->variables.option_bits&= ~OPTION_NO_CHECK_CONSTRAINT_CHECKS;
+
/* A small test to verify that objects have consistent types */
DBUG_ASSERT(sizeof(thd->variables.option_bits) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS));