summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-10-24 14:53:18 +0200
committerSergei Golubchik <serg@mariadb.org>2017-10-24 14:53:18 +0200
commite0a1c745ec3ed1ec6c0375a2a624697c29f480a6 (patch)
tree24ded2c6ebe3ea3413ce56af89ea0f2f63bb3a39 /sql/item.cc
parent4ec88ea9c3ec52d996b39167d12a61ab95fdeacc (diff)
parent2aa51f528fd5d23cc54eca8fbd07e88e7b2993c7 (diff)
downloadmariadb-git-e0a1c745ec3ed1ec6c0375a2a624697c29f480a6.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 910fdd06303..efd82d4f873 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2248,6 +2248,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};
/*
@@ -2263,7 +2266,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;
@@ -6188,7 +6190,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:
@@ -7000,6 +7002,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 ||
@@ -7355,7 +7358,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;
@@ -8529,7 +8536,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 */
@@ -10597,7 +10603,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;