summaryrefslogtreecommitdiff
path: root/sql/log_event_old.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-14 13:55:28 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-14 13:55:28 +0200
commitae29ea2d86cd3fe5b2016baf595744cfb44c52cd (patch)
tree6f5017d7d25380d567084842e35015f52724e8d1 /sql/log_event_old.cc
parent1b50d599606244677215fbe7b05be1a891fecf18 (diff)
parentef3f09f0c9e62ea1bf86b33b5d97e954b3ae34fe (diff)
downloadmariadb-git-ae29ea2d86cd3fe5b2016baf595744cfb44c52cd.tar.gz
Merge branch 'mysql/5.5' into 5.5
Diffstat (limited to 'sql/log_event_old.cc')
-rw-r--r--sql/log_event_old.cc52
1 files changed, 39 insertions, 13 deletions
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 70b3ec12356..51fcf902f77 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -119,16 +119,25 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr&& (i< rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0 ; table_list_ptr&& (i< rli->tables_to_lock_count);
+ table_list_ptr= table_list_ptr->next_global, i++)
{
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST(or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
DBUG_ASSERT(ptr->m_tabledef_valid);
TABLE *conv_table;
if (!ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
@@ -162,7 +171,15 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info
*/
TABLE_LIST *ptr= rli->tables_to_lock;
for (uint i=0; ptr && (i < rli->tables_to_lock_count); ptr= ptr->next_global, i++)
+ {
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (ptr->parent_l)
+ continue;
const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ }
#ifdef HAVE_QUERY_CACHE
query_cache.invalidate_locked_for_write(thd, rli->tables_to_lock);
#endif
@@ -1545,16 +1562,25 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr&& (i< rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0; table_list_ptr&& (i< rli->tables_to_lock_count);
+ table_list_ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr->next_global), i++)
{
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
TABLE *conv_table;
if (ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
ptr->table, &conv_table))