summaryrefslogtreecommitdiff
path: root/sql/rpl_utility.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-20 19:30:14 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-23 10:46:16 +0100
commita38b705fe072f282c4d27fe48d7863d6c0cdbdf2 (patch)
tree6dc906e09bfcc8b84bb34cec1953f960c6b6a42c /sql/rpl_utility.cc
parent4cabc608b6c3c16d800d6cd80c730171a534566f (diff)
downloadmariadb-git-a38b705fe072f282c4d27fe48d7863d6c0cdbdf2.tar.gz
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)
Diffstat (limited to 'sql/rpl_utility.cc')
-rw-r--r--sql/rpl_utility.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index f7fd17edb01..ff2cd74c3a7 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -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;
}