1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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:
Sergei Golubchik
2016-02-20 19:30:14 +01:00
parent 4cabc608b6
commit a38b705fe0
6 changed files with 64 additions and 0 deletions

View File

@ -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;
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:
break;
}