Bug #43785 different master/slave table defs cause crash: date null vs not null
Description:
similar to bug #43783
when a 'not null' and 'null' column exist on master/slave for a date column, valgrind errors and/or crashes can happen on the slave.
1 errors in context 1 of 2:
Invalid read of size 1
at memcpy (mc_replace_strmem.c:406)
by Field::unpack (field.cc:1498)
by unpack_row (rpl_record.cc:242)
by Rows_log_event::write_row (log_event.h:3548)
by Write_rows_log_event::do_exec_row (log_event.cc:8513)
by Rows_log_event::do_apply_event (log_event.cc:7281)
by apply_event_and_update_pos (log_event.h:1056)
by _ZL20exec_relay_log_eventP3THDP14Relay_log_info (slave.cc:2130)
by handle_slave_sql (slave.cc:2801)
by start_thread
by clone
Address 0x7A64BFD is 0 bytes after a block of size 5 alloc'd
at malloc (vg_replace_malloc.c:149)
by my_malloc (my_malloc.c:34)
by Rows_log_event::Rows_log_event (log_event.cc:6961)
by Write_rows_log_event::Write_rows_log_event (log_event.cc:8131)
by Log_event::read_log_event (log_event.cc:1183)
by Log_event::read_log_event (log_event.cc:1032)
by _ZL10next_eventP14Relay_log_info (slave.cc:3834)
by _ZL20exec_relay_log_eventP3THDP14Relay_log_info (slave.cc:2095)
by handle_slave_sql (slave.cc:2801)
by start_thread
by clone
How to repeat:
1. create table on master:
create table t1(`a` int, `b` date DEFAULT NULL,
primary key(`a`))engine=myisam DEFAULT CHARSET=latin1;
2. create table on slave:
create table t1(`a` int, `b` date NOT NULL DEFAULT '0000-00-00',
primary key(`a`))engine=myisam DEFAULT CHARSET=latin1;
3. start replication using --binlog-format=row
4. on master, insert a row and see slave crash or have valgrind errors:
insert into t1 values (1,null);
Suggested fix:
do conversion properly
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.