summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-11-26 21:22:49 -0800
committerIgor Babaev <igor@askmonty.org>2016-11-26 21:23:39 -0800
commit1d0f17415a7b0907498fbdf7b499862bed790edd (patch)
tree893ec1c027e76ea5e32a371bdb4a0b10b87c9575 /sql/item.h
parentb5b68b6bb809624b7cee6464eabb4b633443add0 (diff)
downloadmariadb-git-1d0f17415a7b0907498fbdf7b499862bed790edd.tar.gz
Fixed bug mdev-11313.
The fix for bug 11072 was not complete though it also fixed the bug mdev-10800. This patch resolves the problems of all three bugs.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/sql/item.h b/sql/item.h
index 7844b6766d1..1641c6d17bb 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1560,7 +1560,7 @@ public:
{ return 0; }
virtual bool exclusive_dependence_on_grouping_fields_processor(void *arg)
{ return 0; }
- virtual bool cleanup_excluding_outer_fields_processor(void *arg)
+ virtual bool cleanup_excluding_const_fields_processor(void *arg)
{ return cleanup_processor(arg); }
virtual Item *get_copy(THD *thd, MEM_ROOT *mem_root)=0;
@@ -2664,9 +2664,9 @@ public:
virtual void print(String *str, enum_query_type query_type);
bool exclusive_dependence_on_table_processor(void *map);
bool exclusive_dependence_on_grouping_fields_processor(void *arg);
- bool cleanup_excluding_outer_fields_processor(void *arg)
- { return depended_from ? 0 : cleanup_processor(arg); }
-
+ bool cleanup_excluding_const_fields_processor(void *arg)
+ { return field && const_item() ? 0 : cleanup_processor(arg); }
+
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_field>(thd, mem_root, this); }
bool is_outer_field() const
@@ -4282,7 +4282,15 @@ public:
{ return depended_from != NULL; }
bool exclusive_dependence_on_grouping_fields_processor(void *arg)
{ return depended_from != NULL; }
- };
+ bool cleanup_excluding_const_fields_processor(void *arg)
+ {
+ Item *item= real_item();
+ if (item && item->type() == FIELD_ITEM &&
+ ((Item_field *) item)->field && item->const_item())
+ return 0;
+ return cleanup_processor(arg);
+ }
+};
/*