mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-9560 Mariadb 10.1 Crashes when replicating from 10.0
when replicating old temporal type fields (that don't store metadata in the binlog), take the precision from destination fields. (this fixes the replication failure, crashes were fixed in a different commit)
This commit is contained in:
11
mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff
Normal file
11
mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- suite/rpl/r/temporal_row-9560.result
|
||||||
|
+++ suite/rpl/r/temporal_row-9560.reject
|
||||||
|
@@ -7,7 +7,7 @@
|
||||||
|
insert into t1 values ('2016-02-15 12:50:06.123');
|
||||||
|
select @@mysql56_temporal_format;
|
||||||
|
@@mysql56_temporal_format
|
||||||
|
-0
|
||||||
|
+1
|
||||||
|
select * from t1;
|
||||||
|
ts
|
||||||
|
2016-02-15 12:50:06.123
|
15
mysql-test/suite/rpl/r/temporal_row-9560.result
Normal file
15
mysql-test/suite/rpl/r/temporal_row-9560.result
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
include/master-slave.inc
|
||||||
|
[connection master]
|
||||||
|
select @@mysql56_temporal_format;
|
||||||
|
@@mysql56_temporal_format
|
||||||
|
0
|
||||||
|
create table t1 (ts timestamp(3), t time(3), dt datetime(3));
|
||||||
|
insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
|
||||||
|
select @@mysql56_temporal_format;
|
||||||
|
@@mysql56_temporal_format
|
||||||
|
0
|
||||||
|
select * from t1;
|
||||||
|
ts t dt
|
||||||
|
2016-02-15 12:50:06.123 12:50:06.123 2016-02-15 12:50:06.123
|
||||||
|
drop table t1;
|
||||||
|
include/rpl_end.inc
|
1
mysql-test/suite/rpl/t/temporal_row-9560-master.opt
Normal file
1
mysql-test/suite/rpl/t/temporal_row-9560-master.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--disable-mysql56-temporal-format
|
6
mysql-test/suite/rpl/t/temporal_row-9560.combinations
Normal file
6
mysql-test/suite/rpl/t/temporal_row-9560.combinations
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[old2old]
|
||||||
|
--disable-mysql56-temporal-format
|
||||||
|
|
||||||
|
[old2new]
|
||||||
|
--enable-mysql56-temporal-format
|
||||||
|
|
20
mysql-test/suite/rpl/t/temporal_row-9560.test
Normal file
20
mysql-test/suite/rpl/t/temporal_row-9560.test
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#
|
||||||
|
# MDEV-9560 Mariadb 10.1 Crashes when replicating from 10.0
|
||||||
|
#
|
||||||
|
source include/have_binlog_format_row.inc;
|
||||||
|
source include/master-slave.inc;
|
||||||
|
|
||||||
|
select @@mysql56_temporal_format;
|
||||||
|
create table t1 (ts timestamp(3), t time(3), dt datetime(3));
|
||||||
|
insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
|
||||||
|
|
||||||
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
select @@mysql56_temporal_format;
|
||||||
|
select * from t1;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
source include/rpl_end.inc;
|
||||||
|
|
@ -991,6 +991,17 @@ TABLE *table_def::create_conversion_table(THD *thd, rpl_group_info *rgi,
|
|||||||
*/
|
*/
|
||||||
unsigned_flag= static_cast<Field_num*>(target_field)->unsigned_flag;
|
unsigned_flag= static_cast<Field_num*>(target_field)->unsigned_flag;
|
||||||
break;
|
break;
|
||||||
|
case MYSQL_TYPE_TIMESTAMP:
|
||||||
|
case MYSQL_TYPE_TIME:
|
||||||
|
case MYSQL_TYPE_DATETIME:
|
||||||
|
/*
|
||||||
|
As we don't know the precision of the temporal field on the master,
|
||||||
|
assume it's the same on master and slave. This is true when not
|
||||||
|
using conversions so it should be true also when using conversions.
|
||||||
|
*/
|
||||||
|
if (target_field->decimals())
|
||||||
|
max_length+= target_field->decimals() + 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user