summaryrefslogtreecommitdiff
path: root/sql/rpl_utility.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
commit993ea79f2df42292eceeee394e8ece9f4a3f6cf2 (patch)
treed105c8288a89a25d412e9006b740c756db6326d6 /sql/rpl_utility.cc
parent1827d9591e24ee469527021771088d842ab18374 (diff)
parent6599fd3e9c23a8957a63146cbe6a0ffc4c292a3d (diff)
downloadmariadb-git-993ea79f2df42292eceeee394e8ece9f4a3f6cf2.tar.gz
5.5 merge
Diffstat (limited to 'sql/rpl_utility.cc')
-rw-r--r--sql/rpl_utility.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 1b9e744bcc1..8a1170cf4fa 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -878,8 +878,13 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *
DBUG_ENTER("table_def::create_conversion_table");
List<Create_field> field_list;
-
- for (uint col= 0 ; col < size() ; ++col)
+ /*
+ At slave, columns may differ. So we should create
+ min(columns@master, columns@slave) columns in the
+ conversion table.
+ */
+ uint const cols_to_create= min(target_table->s->fields, size());
+ for (uint col= 0 ; col < cols_to_create; ++col)
{
Create_field *field_def=
(Create_field*) alloc_root(thd->mem_root, sizeof(Create_field));