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 | |
parent | 2fa4ed031ce6cc6370671058ccc3d119b8cb3d91 (diff) | |
parent | 853a0a4368ec5268aac2e53e862ce4ad975ffd66 (diff) | |
download | mariadb-git-f454189c606b9ce7c401a3493c9b85c72651e220.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/rpl_utility.cc | 34 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 |
3 files changed, 34 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc index e72c2b80288..4eb47dc01c3 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -7617,7 +7617,7 @@ Item *Item_direct_view_ref::derived_field_transformer_for_where(THD *thd, DBUG_ASSERT (producing_item != NULL); return producing_item->build_clone(thd); } - return this; + return (*ref); } static 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 } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5b08522aa38..a3003285f87 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3127,7 +3127,7 @@ bool JOIN::make_aggr_tables_info() remove_duplicates() assumes there is a preceding computation step (and in the degenerate join, there's none) */ - if (top_join_tab_count) + if (top_join_tab_count && tables_list) curr_tab->distinct= true; having= NULL; |