diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-10-17 19:05:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-10-17 19:37:05 +0300 |
commit | f454189c606b9ce7c401a3493c9b85c72651e220 (patch) | |
tree | 14d529b74174aecf0603fde5bcc374ad1652e726 /sql/rpl_utility.cc | |
parent | 2fa4ed031ce6cc6370671058ccc3d119b8cb3d91 (diff) | |
parent | 853a0a4368ec5268aac2e53e862ce4ad975ffd66 (diff) | |
download | mariadb-git-f454189c606b9ce7c401a3493c9b85c72651e220.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/rpl_utility.cc')
-rw-r--r-- | sql/rpl_utility.cc | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 31035fb5dcc..e170b4772c1 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -817,14 +817,44 @@ can_convert_field_to(Field *field, case MYSQL_TYPE_TIME: case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_YEAR: - case MYSQL_TYPE_NEWDATE: case MYSQL_TYPE_NULL: case MYSQL_TYPE_ENUM: case MYSQL_TYPE_SET: case MYSQL_TYPE_TIMESTAMP2: - case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIME2: DBUG_RETURN(false); + case MYSQL_TYPE_NEWDATE: + { + if (field->real_type() == MYSQL_TYPE_DATETIME2 || + field->real_type() == MYSQL_TYPE_DATETIME) + { + *order_var= -1; + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + } + else + { + DBUG_RETURN(false); + } + } + break; + + //case MYSQL_TYPE_DATETIME: TODO: fix MDEV-17394 and uncomment. + // + //The "old" type does not specify the fraction part size which is required + //for correct conversion. + case MYSQL_TYPE_DATETIME2: + { + if (field->real_type() == MYSQL_TYPE_NEWDATE) + { + *order_var= 1; + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + } + else + { + DBUG_RETURN(false); + } + } + break; } DBUG_RETURN(false); // To keep GCC happy } |