1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#15888454: SLAVE CRASHES WHEN DML REQUIRES CONVERSION & TABLE HAS

LESS COLUMNS THAN MASTER

Problem:
========
If DML operation requires a converstion at slave and if slave contains
less number of columns than master, slave is crashing.

Fix:
====
When Slave applies any DML operation, it sees if any of the columns 
requires conversion. If yes, it creates conversion table. 
While creating the coversion table, it should look into the actual number 
of columns required to create the table instead of getting the number
of columns from Master (size()). Columns would have dropped or added
at Slave. So the value should be min(columns@master, columns@slave)
This commit is contained in:
Venkatesh Duggirala
2012-11-29 17:33:06 +05:30
parent 6a2f2338e4
commit d68cba3413

View File

@ -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));