revision-id: b4210f364003fbea3ccd778b5f5f5dbfc2bfa2f8 (mariadb-10.1.35-10-gb4210f36400) parent(s): 75dfd4acb995789ca5f86ccbd361fff9d2797e79 bcc677bb7264db08b22284998706b44c377ed8ec author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-08-21 10:07:26 +0200 message: Merge branch '10.0' into 10.1 mysql-test/r/func_isnull.result | 20 ++++++++++++++++ mysql-test/r/func_time.result | 5 ++++ mysql-test/r/subselect_extra_no_semijoin.result | 19 +++++++++++++++ mysql-test/r/subselect_mat.result | 6 ++--- mysql-test/r/subselect_sj_mat.result | 6 ++--- mysql-test/suite/rpl/r/rpl_row_spatial.result | 14 +++++++++++ mysql-test/suite/rpl/t/rpl_row_spatial.test | 17 ++++++++++++++ mysql-test/t/func_isnull.test | 16 +++++++++++++ mysql-test/t/func_time.test | 4 ++++ mysql-test/t/subselect_extra_no_semijoin.test | 31 ++++++++++++++++++++++++- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 13 +++++++++++ sql/item_cmpfunc.h | 1 + sql/key.cc | 3 ++- sql/mysqld.cc | 22 +++++++++--------- sql/protocol.cc | 8 +++---- sql/sql_list.h | 5 +++- sql/sql_show.cc | 2 +- sql/sql_time.cc | 2 +- 19 files changed, 169 insertions(+), 27 deletions(-) diff --cc mysql-test/r/func_time.result index 2180ec2b83c,6f81ffbd410..74911287a6a --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@@ -2796,6 -2770,9 +2796,11 @@@ SEC_TO_TIME(MAKEDATE(0,RAND(~0)) 838:59:59 Warnings: Warning 1292 Truncated incorrect time value: '20000101' + SELECT PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli')); + PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli')) + 24257 ++Warnings: ++Warning 1292 Truncated incorrect INTEGER value: '-3S\xFA\xDE?\x00\x00\xCA\xB3\xEEE\xA4\xD1\xC1\xA8' # # End of 5.5 tests # diff --cc sql/item_cmpfunc.cc index 6ffd582c133,49bbee9edd2..efd00839e4b --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@@ -5113,13 -4927,19 +5113,26 @@@ Item *and_expressions(THD *thd, Item *a } +bool Item_func_null_predicate::count_sargable_conds(uchar *arg) +{ + ((SELECT_LEX*) arg)->cond_count++; + return 0; +} + + + void Item_func_isnull::print(String *str, enum_query_type query_type) + { + str->append(func_name()); + str->append('('); + if (const_item() && !args[0]->maybe_null && + !(query_type & (QT_NO_DATA_EXPANSION | QT_VIEW_INTERNAL))) + str->append("/*always not null*/ 1"); + else + args[0]->print(str, query_type); + str->append(')'); + } + + longlong Item_func_isnull::val_int() { DBUG_ASSERT(fixed == 1); diff --cc sql/item_cmpfunc.h index 03f234ad1e4,fdefcc86c64..8d85bc8afca --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@@ -1718,10 -1422,11 +1718,11 @@@ public const_item_cache= args[0]->const_item(); } } + COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value, + bool top_level); + virtual void print(String *str, enum_query_type query_type); table_map not_null_tables() const { return 0; } - optimize_type select_optimize() const { return OPTIMIZE_NULL; } Item *neg_transformer(THD *thd); - CHARSET_INFO *compare_collation() { return args[0]->collation.collation; } }; /* Functions used by HAVING for rewriting IN subquery */ diff --cc sql/sql_show.cc index bbf2cb30b97,cdcd6fe47e3..c029b607815 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@@ -2389,8 -2219,7 +2389,8 @@@ static int show_create_view(THD *thd, T We can't just use table->query, because our SQL_MODE may trigger a different syntax, like when ANSI_QUOTES is defined. */ - table->view->unit.print(buff, enum_query_type(QT_ORDINARY | - table->view->unit.print(buff, QT_VIEW_INTERNAL); ++ table->view->unit.print(buff, enum_query_type(QT_VIEW_INTERNAL | + QT_ITEM_ORIGINAL_FUNC_NULLIF)); if (table->with_check != VIEW_CHECK_NONE) {