summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2013-08-21 17:42:09 +0300
committerunknown <sanja@montyprogram.com>2013-08-21 17:42:09 +0300
commitf8af4423b4bd9bb2978668b21506677f5dcac873 (patch)
tree5df4ec02183edb9fa2e3aaffc20a5b0ab1306b23 /sql/opt_subselect.cc
parent99992f6ec4600222fc4312f62287b1a42155ea4c (diff)
downloadmariadb-git-f8af4423b4bd9bb2978668b21506677f5dcac873.tar.gz
MDEV-4908: Assertion `((Item_cond *) cond)->functype() == ((Item_cond *) new_item)->functype()' fails on a query with IN and equal conditions, AND/OR, materialization+semijoin
A new AND Item should be prepared (fix_field() call) before using.
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r--sql/opt_subselect.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 149d395a25d..b0d84fe5400 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -5154,10 +5154,12 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
{
eq_cond= new Item_func_eq(subq_pred->left_expr->element_index(i),
new_sink->row[i]);
- if (!eq_cond || eq_cond->fix_fields(join->thd, &eq_cond))
+ if (!eq_cond)
DBUG_RETURN(1);
- (*join_where)= and_items(*join_where, eq_cond);
+ if (!((*join_where)= and_items(*join_where, eq_cond)) ||
+ (*join_where)->fix_fields(join->thd, join_where))
+ DBUG_RETURN(1);
}
}
else