diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-10-22 13:03:41 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-10-22 13:03:41 +0200 |
commit | 9d2e2d753323a934604d25144b9d1ecaf34b47d8 (patch) | |
tree | 051a721f7ea77c2278d09323e36088abe22aa66a /sql/item.cc | |
parent | d11af09865299033d5eef64531704f6ab8af5304 (diff) | |
parent | 2eb3c5e5420a724945a4cba914df25aa1e3744ce (diff) | |
download | mariadb-git-9d2e2d753323a934604d25144b9d1ecaf34b47d8.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/item.cc b/sql/item.cc index da1692ecbf8..ff172e69a04 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2133,6 +2133,9 @@ bool Item_func_or_sum::agg_item_set_converter(const DTCollation &coll, Item **args, uint nargs, uint flags, int item_sep) { + THD *thd= current_thd; + if (thd->lex->is_ps_or_view_context_analysis()) + return false; Item **arg, *safe_args[2]= {NULL, NULL}; /* @@ -2148,7 +2151,6 @@ bool Item_func_or_sum::agg_item_set_converter(const DTCollation &coll, safe_args[1]= args[item_sep]; } - THD *thd= current_thd; bool res= FALSE; uint i; @@ -5835,7 +5837,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, Field_string(max_length, maybe_null, name, collation.collation); break; } - /* Fall through */ + /* fall through */ case MYSQL_TYPE_ENUM: case MYSQL_TYPE_SET: case MYSQL_TYPE_VAR_STRING: @@ -6640,6 +6642,7 @@ bool Item::cache_const_expr_analyzer(uchar **arg) */ if (const_item() && !(basic_const_item() || item->basic_const_item() || + item->type() == Item::NULL_ITEM || /* Item_name_const hack */ item->type() == Item::FIELD_ITEM || item->type() == SUBSELECT_ITEM || item->type() == CACHE_ITEM || @@ -6821,7 +6824,11 @@ public: // Find which select the field is in. This is achieved by walking up // the select tree and looking for the table of interest. st_select_lex *sel; - for (sel= current_select; sel; sel= sel->outer_select()) + for (sel= current_select; + sel ; + sel= (sel->context.outer_context ? + sel->context.outer_context->select_lex: + NULL)) { List_iterator<TABLE_LIST> li(sel->leaf_tables); TABLE_LIST *tbl; @@ -7994,7 +8001,6 @@ bool Item_direct_view_ref::send(Protocol *protocol, String *buffer) bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference) { - DBUG_ASSERT(1); /* view fild reference must be defined */ DBUG_ASSERT(*ref); /* (*ref)->check_cols() will be made in Item_direct_ref::fix_fields */ @@ -9847,7 +9853,7 @@ void Item_direct_view_ref::update_used_tables() table_map Item_direct_view_ref::used_tables() const { - DBUG_ASSERT(null_ref_table); + DBUG_ASSERT(fixed); if (get_depended_from()) return OUTER_REF_TABLE_BIT; |