summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2010-02-26 15:39:25 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2010-02-26 15:39:25 +0400
commitfe94dec6799b81ddc6660b3d9301deff5ac82507 (patch)
tree86ad600c103f19ca2727b788b2ae1cd8df029f49 /sql/item_cmpfunc.h
parent79d8de67a911be0f18adfd4c19c65909879b76eb (diff)
downloadmariadb-git-fe94dec6799b81ddc6660b3d9301deff5ac82507.tar.gz
Bug#50995 Having clause on subquery result produces incorrect results.
The problem is that cond->fix_fields(thd, 0) breaks condition(cuts off 'having'). The reason of that is that NULL valued Item pointer is present in the middle of Item list and it breaks the Item processing loop.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 38025ff0af5..425f54fb079 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1474,9 +1474,21 @@ public:
Item_cond(THD *thd, Item_cond *item);
Item_cond(List<Item> &nlist)
:Item_bool_func(), list(nlist), abort_on_null(0) {}
- bool add(Item *item) { return list.push_back(item); }
- bool add_at_head(Item *item) { return list.push_front(item); }
- void add_at_head(List<Item> *nlist) { list.prepand(nlist); }
+ bool add(Item *item)
+ {
+ DBUG_ASSERT(item);
+ return list.push_back(item);
+ }
+ bool add_at_head(Item *item)
+ {
+ DBUG_ASSERT(item);
+ return list.push_front(item);
+ }
+ void add_at_head(List<Item> *nlist)
+ {
+ DBUG_ASSERT(nlist->elements);
+ list.prepand(nlist);
+ }
bool fix_fields(THD *, Item **ref);
enum Type type() const { return COND_ITEM; }