summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-03-26 13:47:00 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-03-26 13:47:00 +0400
commite2554b50cd93c51b7768aa99ddb46d956888e4a5 (patch)
tree6307b6d29bf64906f592302af9c2388d35cdb084 /sql/item_cmpfunc.h
parentd0547098271fc1b52f92dbc34b6dfca405e5882a (diff)
downloadmariadb-git-e2554b50cd93c51b7768aa99ddb46d956888e4a5.tar.gz
BUG#951937: Wrong result (missing rows) with semijoin+materialization, IN subquery, InnoDB, TEMPTABLE view
- Fix equality propagation to work with SJM nests and OR clauses (full descirption of problem and solution in the comment in the patch) (The second commit with post-review fixes)
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index ad4f889f4df..be30afb3bd0 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1700,9 +1700,16 @@ class Item_equal: public Item_bool_func
as datetimes. The comparator is used only if compare_as_dates=TRUE
*/
Arg_comparator cmp;
+
+ /*
+ For Item_equal objects inside an OR clause: one of the fields that were
+ used in the original equality.
+ */
+ Item_field *context_field;
public:
inline Item_equal()
- : Item_bool_func(), with_const(FALSE), eval_item(0), cond_false(0)
+ : Item_bool_func(), with_const(FALSE), eval_item(0), cond_false(0),
+ context_field(NULL)
{ const_item_cache=0 ;}
Item_equal(Item *f1, Item *f2, bool with_const_item);
Item_equal(Item_equal *item_equal);
@@ -1729,6 +1736,8 @@ public:
Item *transform(Item_transformer transformer, uchar *arg);
virtual void print(String *str, enum_query_type query_type);
CHARSET_INFO *compare_collation();
+
+ void set_context_field(Item_field *ctx_field) { context_field= ctx_field; }
friend class Item_equal_fields_iterator;
friend Item *eliminate_item_equal(COND *cond, COND_EQUAL *upper_levels,
Item_equal *item_equal);