summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-04-01 16:02:26 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-04-01 16:02:26 +0500
commit02884a4d986f29c50ff60cefa15464faa26e79bb (patch)
tree6ae1f30b11048b37450792def05c41e1b9d22e8f /sql/item.h
parent01e647352df15f7c58e8f0848aa7d17dc694efec (diff)
downloadmariadb-git-02884a4d986f29c50ff60cefa15464faa26e79bb.tar.gz
Backport bug #37348 fix 5.1 --> 5.0.
Original commentary: Bug #37348: Crash in or immediately after JOIN::make_sum_func_list The optimizer pulls up aggregate functions which should be aggregated in an outer select. At some point it may substitute such a function for a field in the temporary table. The setup_copy_fields function doesn't take this into account and may overrun the copy_field buffer. Fixed by filtering out the fields referenced through the specialized reference for aggregates (Item_aggregate_ref). Added an assertion to make sure bugs that cause similar discrepancy don't go undetected. mysql-test/r/func_group.result: Backport bug #37348 fix 5.1 --> 5.0. mysql-test/t/func_group.test: Backport bug #37348 fix 5.1 --> 5.0. sql/item.cc: Backport bug #37348 fix 5.1 --> 5.0. sql/item.h: Backport bug #37348 fix 5.1 --> 5.0. sql/sql_select.cc: Backport bug #37348 fix 5.1 --> 5.0.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h
index 852b0fcc1ba..22eb0c08e2d 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1899,7 +1899,7 @@ class Item_ref :public Item_ident
protected:
void set_properties();
public:
- enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF };
+ enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF, AGGREGATE_REF };
Field *result_field; /* Save result here */
Item **ref;
Item_ref(Name_resolution_context *context_arg,