diff options
author | Venkatesh Duggirala <venkatesh.duggirala@oracle.com> | 2013-08-07 07:56:07 +0530 |
---|---|---|
committer | Venkatesh Duggirala <venkatesh.duggirala@oracle.com> | 2013-08-07 07:56:07 +0530 |
commit | e55d4a88a80bc4a64625d95bce8bffc974cac795 (patch) | |
tree | 1cae57da270316fb93b4d2cdd6f98609acb14bab /sql/rpl_utility.cc | |
parent | a5aa74c37abda880a570686c6c0408d302e378e8 (diff) | |
download | mariadb-git-e55d4a88a80bc4a64625d95bce8bffc974cac795.tar.gz |
Bug#16416302 - CRASH WITH LOSSY RBR REPLICATION
OF OLD STYLE DECIMALS
Problem: In RBR, Slave is unable to read row buffer
properly when the row event contains MYSQL_TYPE_DECIMAL
(old style decimals) data type column.
Analysis: In RBR, Slave assumes that Master sends
meta data information for all column types like
text,blob,varchar,old decimal,new decimal,float,
and few other types along with row buffer event.
But Master is not sending this meta data information
for old style decimal columns. Hence Slave is crashing
due to unknown precision value for these column types.
Master cannot send this precision value to Slave which
will break replication cross-version compatibility.
Fix: To fix the crash, Slave will now throw error if it
receives old-style decimal datatype. User should
consider changing the old-style decimal to new style
decimal data type by executing "ALTER table modify column"
query as mentioned in http://dev.mysql.com/
doc/refman/5.0/en/upgrading-from-previous-series.html.
Diffstat (limited to 'sql/rpl_utility.cc')
-rw-r--r-- | sql/rpl_utility.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 2643f2d6059..1527676ee58 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. 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 @@ -878,6 +878,7 @@ 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; + TABLE *conv_table= NULL; /* At slave, columns may differ. So we should create min(columns@master, columns@slave) columns in the @@ -919,10 +920,15 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * break; case MYSQL_TYPE_DECIMAL: - precision= field_metadata(col); - decimals= static_cast<Field_num*>(target_table->field[col])->dec; - max_length= field_metadata(col); - break; + sql_print_error("In RBR mode, Slave received incompatible DECIMAL field " + "(old-style decimal field) from Master while creating " + "conversion table. Please consider changing datatype on " + "Master to new style decimal by executing ALTER command for" + " column Name: %s.%s.%s.", + target_table->s->db.str, + target_table->s->table_name.str, + target_table->field[col]->field_name); + goto err; case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: @@ -950,7 +956,9 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * field_def->interval= interval; } - TABLE *conv_table= create_virtual_tmp_table(thd, field_list); + conv_table= create_virtual_tmp_table(thd, field_list); + +err: if (conv_table == NULL) rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION, ER(ER_SLAVE_CANT_CREATE_CONVERSION), |