Bug #43784 assert or broken replication with geometrycollection and decimal columns
Submitted: 22 Mar 2009 8:51 Modified: 30 Dec 2009 8:59
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S1 (Critical)
Version:5.1.32 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: assert

[22 Mar 2009 8:51] Shane Bester
Description:
when replicating a geometrycollection and decimal column in a table, release binary breaks replication with a message:

090125 20:49:55 [ERROR] Slave SQL: Table definition on master and slave does not match: Column 2 size mismatch - master has size 5, test.t1 on slave has size 5. Master's column size should be <= the slave's column size. Error_code: 1535

debug binary asserts:

mysqld-debug: decimal.c:1462: decimal_bin_size: Assertion `scale >= 0 && precision > 0 && scale <= precision' failed.
090125 21:34:19 - mysqld got signal 6 ;

mysqld-debug.exe!_NMSG_WRITE(int rterrnum=10)  Line 198             
mysqld-debug.exe!abort()  Line 68                                   
mysqld-debug.exe!_wassert Line 212                                  
mysqld-debug.exe!decimal_bin_size Line 1462                         
mysqld-debug.exe!my_decimal_get_binary_size Line 218                
mysqld-debug.exe!Field_new_decimal::compatible_field_size  Line 2850
mysqld-debug.exe!table_def::compatible_with Line 209                
mysqld-debug.exe!Rows_log_event::do_apply_event Line 7178           
mysqld-debug.exe!Log_event::apply_event Line 1057                   
mysqld-debug.exe!apply_event_and_update_pos Line 1987               
mysqld-debug.exe!exec_relay_log_event Line 2130                     
mysqld-debug.exe!handle_slave_sql                                   
mysqld-debug.exe!pthread_start                                      
mysqld-debug.exe!_callthreadstart                                   
mysqld-debug.exe!_threadstart                                       
kernel32.dll!BaseThreadStart                                        

How to repeat:
setup replication, using --binlog-format=row
run this on master:

drop table if exists t1;
create table `t1` (`a` int(11) not null auto_increment,
  `col000` geometrycollection default null,
  `col001` decimal(10,0) unsigned zerofill default null,
  primary key (`a`)) engine=myisam  default charset=latin1;

insert into t1(col001) values (null);
[21 Dec 2009 4:12] Alfranio Junior
After the WL#5151 the error is not repeatable as the slave stops with the following messages:

1 - ALL_NON_LOSSY
Last_SQL_Error  Can't create conversion table for table 'test.t1'

2 - ALL_LOSSY
Last_SQL_Error  Column 1 of table 'test.t1' cannot be converted from type 'geometrycollection' to type 'geometry'
[21 Dec 2009 4:48] Alfranio Junior
See BUG#49836.
[22 Dec 2009 11:08] Alfranio Junior
Fixed by WL#5151.
[22 Dec 2009 11:10] Alfranio Junior
WL#5151 has the following revision-id mats@sun.com-20091214110455-g6lw2yfiu14prdnu in mysql-5.1-rep+2.
[30 Dec 2009 8:59] Zhenxing He
Duplicate of Bug#48776